Mesa (master): svga: fix clip plane regression after recent tgsi_scan change

Brian Paul brianp at kemper.freedesktop.org
Thu Oct 22 02:24:32 UTC 2015


Module: Mesa
Branch: master
Commit: 18a631eb9056857a9ced477e7e3d1a435a906be2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18a631eb9056857a9ced477e7e3d1a435a906be2

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Oct 21 16:07:33 2015 -0600

svga: fix clip plane regression after recent tgsi_scan change

Before the change "tgsi/scan: use properties for clip/cull distance
writemasks", the tgsi_shader_info::num_written_clipdistance field
was a multiple of four, now it's an accurate count.  In the svga
driver, we need a minor change to the loop test.

Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/drivers/svga/svga_tgsi_vgpu10.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
index d62f2bb..332904f 100644
--- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
+++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
@@ -3097,7 +3097,7 @@ emit_clip_distance_instructions(struct svga_shader_emitter_v10 *emit)
    unsigned i;
    unsigned clip_plane_enable = emit->key.clip_plane_enable;
    unsigned clip_dist_tmp_index = emit->clip_dist_tmp_index;
-   unsigned num_written_clipdist = emit->info.num_written_clipdistance;
+   int num_written_clipdist = emit->info.num_written_clipdistance;
 
    assert(emit->clip_dist_out_index != INVALID_INDEX);
    assert(emit->clip_dist_tmp_index != INVALID_INDEX);
@@ -3109,7 +3109,7 @@ emit_clip_distance_instructions(struct svga_shader_emitter_v10 *emit)
     */
    emit->clip_dist_tmp_index = INVALID_INDEX;
 
-   for (i = 0; i < 2 && num_written_clipdist; i++, num_written_clipdist-=4) {
+   for (i = 0; i < 2 && num_written_clipdist > 0; i++, num_written_clipdist-=4) {
 
       tmp_clip_dist_src = make_src_temp_reg(clip_dist_tmp_index + i);
 




More information about the mesa-commit mailing list