r600/shader: reserve first register of vertex shader.
authorDave Airlie <airlied@redhat.com>
Mon, 13 Nov 2017 03:05:25 +0000 (13:05 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 13 Nov 2017 20:16:05 +0000 (06:16 +1000)
r0 in input into vertex shaders contains things like vertexid,
we need to reserve it even if we have no inputs.

This fixes a bunch of tessellation piglits.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index af866c4bddbd5a75c8a03a1e9ce78df9f3efb870..c6e445744edea6229c48ed97226a851fc3e1fe7b 100644 (file)
@@ -3051,9 +3051,11 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
                ctx.file_offset[i] = 0;
        }
 
-       if (ctx.type == PIPE_SHADER_VERTEX && ctx.info.num_inputs) {
+       if (ctx.type == PIPE_SHADER_VERTEX)  {
+
                ctx.file_offset[TGSI_FILE_INPUT] = 1;
-               r600_bytecode_add_cfinst(ctx.bc, CF_OP_CALL_FS);
+               if (ctx.info.num_inputs)
+                       r600_bytecode_add_cfinst(ctx.bc, CF_OP_CALL_FS);
        }
        if (ctx.type == PIPE_SHADER_FRAGMENT) {
                if (ctx.bc->chip_class >= EVERGREEN)