summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_vs_variant.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-05-25 01:02:46 -0400
committerZack Rusin <zackr@vmware.com>2013-05-25 09:49:20 -0400
commitd7d676252d2ae1fd6d3dd76d4e205251ad7c6152 (patch)
treeee2de4e74375ddb379c1da9f440231eb557216a3 /src/gallium/auxiliary/draw/draw_vs_variant.c
parent26fe24c47975f1484c193617a18cd2a9cdb65eb4 (diff)
downloadexternal_mesa3d-d7d676252d2ae1fd6d3dd76d4e205251ad7c6152.zip
external_mesa3d-d7d676252d2ae1fd6d3dd76d4e205251ad7c6152.tar.gz
external_mesa3d-d7d676252d2ae1fd6d3dd76d4e205251ad7c6152.tar.bz2
draw: clamp the viewports to always be between 0 and max
If the viewport index is larger than the PIPE_MAX_VIEWPORTS, then the first (0-th) viewport should be used. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: José Fonseca<jfonseca@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_variant.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_variant.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_variant.c b/src/gallium/auxiliary/draw/draw_vs_variant.c
index 0387eaf..152c130 100644
--- a/src/gallium/auxiliary/draw/draw_vs_variant.c
+++ b/src/gallium/auxiliary/draw/draw_vs_variant.c
@@ -91,9 +91,8 @@ find_viewport(struct draw_context *draw,
int viewport_index =
draw_current_shader_uses_viewport_index(draw) ?
data[viewport_index_output * 4] : 0;
-
- debug_assert(viewport_index < PIPE_MAX_VIEWPORTS);
- viewport_index = MIN2(viewport_index, PIPE_MAX_VIEWPORTS - 1);
+
+ viewport_index = draw_clamp_viewport_idx(viewport_index);
return &draw->viewports[viewport_index];
}