summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-04-26 09:48:46 +1000
committerDave Airlie <airlied@redhat.com>2016-04-26 14:36:37 +1000
commitae11b66d0351ca7d2367aa6ce8acc015c27a13f0 (patch)
treed1cf674de057f94d8663cbe596f6e2fe99fe2a80
parent4965c5bf72d95a73a1a4219843fe36c65b7b10c2 (diff)
tgsi: move to using vector for system values.
For compute support some of the system values are .xyz types, so move to using a vector instead of a single channel. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_exec.c8
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index ca03238885c..adba9316517 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -197,7 +197,7 @@ static void tgsi_gs_prepare(struct draw_geometry_shader *shader,
if (shader->info.uses_invocationid) {
unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INVOCATIONID];
for (j = 0; j < TGSI_QUAD_SIZE; j++)
- machine->SystemValue[i].i[j] = shader->invocation_id;
+ machine->SystemValue[i].xyzw[0].i[j] = shader->invocation_id;
}
}
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index da0d1a7f9a8..fe6ad5b33d9 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -107,7 +107,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INSTANCEID];
assert(i < Elements(machine->SystemValue));
for (j = 0; j < TGSI_QUAD_SIZE; j++)
- machine->SystemValue[i].i[j] = shader->draw->instance_id;
+ machine->SystemValue[i].xyzw[0].i[j] = shader->draw->instance_id;
}
for (i = 0; i < count; i += MAX_TGSI_VERTICES) {
@@ -130,19 +130,19 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
if (shader->info.uses_vertexid) {
unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID];
assert(vid < Elements(machine->SystemValue));
- machine->SystemValue[vid].i[j] = i + j;
+ machine->SystemValue[vid].xyzw[0].i[j] = i + j;
/* XXX this should include base vertex. Where to get it??? */
}
if (shader->info.uses_basevertex) {
unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_BASEVERTEX];
assert(vid < Elements(machine->SystemValue));
- machine->SystemValue[vid].i[j] = 0;
+ machine->SystemValue[vid].xyzw[0].i[j] = 0;
/* XXX Where to get it??? */
}
if (shader->info.uses_vertexid_nobase) {
unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID_NOBASE];
assert(vid < Elements(machine->SystemValue));
- machine->SystemValue[vid].i[j] = i + j;
+ machine->SystemValue[vid].xyzw[0].i[j] = i + j;
}
for (slot = 0; slot < shader->info.num_inputs; slot++) {
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 4567a945e88..f582230b0be 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1277,7 +1277,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]].u[i];
+ chan->u[i] = mach->SystemValue[index->i[i]].xyzw[0].u[i];
}
break;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index 5e554d584cc..b12f7bed9b8 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -356,7 +356,7 @@ struct tgsi_exec_machine
/* System values */
unsigned SysSemanticToIndex[TGSI_SEMANTIC_COUNT];
- union tgsi_exec_channel SystemValue[TGSI_MAX_MISC_INPUTS];
+ struct tgsi_exec_vector SystemValue[TGSI_MAX_MISC_INPUTS];
struct tgsi_exec_vector *Addrs;
struct tgsi_exec_vector *Predicates;