diff options
author | Zack Rusin <zackr@vmware.com> | 2013-06-10 23:36:59 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2013-06-13 12:13:11 -0400 |
commit | 5507c11f85dda4fbcdc9b36494551c933471a070 (patch) | |
tree | ded8a6152801200b5b6d79f02a180f838e7af763 /src/gallium/auxiliary/draw/draw_vs.c | |
parent | b63eeaf7b7df83a2c52c5ddb701454fd8a49b987 (diff) | |
download | external_mesa3d-5507c11f85dda4fbcdc9b36494551c933471a070.zip external_mesa3d-5507c11f85dda4fbcdc9b36494551c933471a070.tar.gz external_mesa3d-5507c11f85dda4fbcdc9b36494551c933471a070.tar.bz2 |
gallium/draw: add limits to the clip and cull distances
There are strict limits on those registers. Define the maximums
and use them instead of magic numbers. Also allows us to add
some extra sanity checks.
Suggested by Brian.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index a0bebcc..bbccbe4 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -86,12 +86,12 @@ draw_create_vertex_shader(struct draw_context *draw, found_clipvertex = TRUE; vs->clipvertex_output = i; } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) { - if (vs->info.output_semantic_index[i] == 0) - vs->clipdistance_output[0] = i; - else - vs->clipdistance_output[1] = i; + debug_assert(vs->info.output_semantic_index[i] < + PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT); + vs->clipdistance_output[vs->info.output_semantic_index[i]] = i; } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CULLDIST) { - debug_assert(vs->info.output_semantic_index[i] < Elements(vs->culldistance_output)); + debug_assert(vs->info.output_semantic_index[i] < + PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT); vs->culldistance_output[vs->info.output_semantic_index[i]] = i; } } |