i965: Fix BRW_VARYING_SLOT_PAD handling in the scalar VS backend.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 10 Sep 2015 03:23:04 +0000 (20:23 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 26 Sep 2015 18:59:56 +0000 (11:59 -0700)
We can't just break for padding slots.  Instead, treat them like
unwritten output variables, so we handle flushing and incrementing
urb_offset correctly.

Paul introduced the concept of padding slots back in 2011, but we've
never actually used them for anything.  So it's unsurprising that the
scalar VS backend didn't handle them quite right.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 5bf6449fa131e48c60e5c9bf979601e3305299ad..47d7ae4f57c56f39c70b68e1a0ad47e8af2d51c8 100644 (file)
@@ -939,9 +939,6 @@ fs_visitor::emit_urb_writes()
          unreachable("unexpected scalar vs output");
          break;
 
-      case BRW_VARYING_SLOT_PAD:
-         break;
-
       default:
          /* gl_Position is always in the vue map, but isn't always written by
           * the shader.  Other varyings (clip distances) get added to the vue
@@ -951,7 +948,8 @@ fs_visitor::emit_urb_writes()
           * slot for writing we flush a mlen 5 urb write, otherwise we just
           * advance the urb_offset.
           */
-         if (this->outputs[varying].file == BAD_FILE) {
+         if (varying == BRW_VARYING_SLOT_PAD ||
+             this->outputs[varying].file == BAD_FILE) {
             if (length > 0)
                flush = true;
             else