summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-04-26 14:31:24 +1000
committerDave Airlie <airlied@redhat.com>2016-04-26 14:36:37 +1000
commit10c0fa7f7b457d996b3405f749af3976fa42af78 (patch)
treeaa2c784685040097ac2f36f1c04887458783bb44
parentbc331f5de66f7b78adf1ea8663e7095726f296a5 (diff)
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 <airlied@redhat.com>
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c5
1 files changed, 4 insertions, 1 deletions
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;