From 10c0fa7f7b457d996b3405f749af3976fa42af78 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 26 Apr 2016 14:31:24 +1000 Subject: tgsi/exec: misc fixes for compute shaders. We want to use the SysSemanticToIndex to tell if we've seen the semantics at all. Also add semantic swizzle support. Signed-off-by: Dave Airlie --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index d914ef5d6f0..d86b1ca52e8 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -898,6 +898,9 @@ tgsi_exec_machine_bind_shader( mach->ImmLimit = 0; mach->NumOutputs = 0; + for (k = 0; k < TGSI_SEMANTIC_COUNT; k++) + mach->SysSemanticToIndex[k] = -1; + if (mach->ShaderType == PIPE_SHADER_GEOMETRY && !mach->UsedGeometryShader) { struct tgsi_exec_vector *inputs; @@ -1284,7 +1287,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach, * gl_FragCoord, for example, in a sys value register. */ for (i = 0; i < TGSI_QUAD_SIZE; i++) { - chan->u[i] = mach->SystemValue[index->i[i]].xyzw[0].u[i]; + chan->u[i] = mach->SystemValue[index->i[i]].xyzw[swizzle].u[i]; } break; -- cgit v1.2.3