[Mesa-dev] [PATCH 1/2] r600/shader: reserve first register of vertex shader.

Dave Airlie airlied at gmail.com
Mon Nov 13 04:18:06 UTC 2017


From: Dave Airlie <airlied at redhat.com>

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.
---
 src/gallium/drivers/r600/r600_shader.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index af866c4..c6e4457 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -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)
-- 
2.9.5



More information about the mesa-dev mailing list