summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c11
-rw-r--r--src/mesa/state_tracker/st_program.c3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index fdf023d6ae3..bacd091853b 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -176,7 +176,7 @@ dst_register( struct st_translate *t,
else if (t->procType == TGSI_PROCESSOR_FRAGMENT)
assert(index < FRAG_RESULT_MAX);
else
- assert(0 && "geom shaders not handled in dst_register() yet");
+ assert(index < GEOM_RESULT_MAX);
assert(t->outputMapping[index] < Elements(t->outputs));
@@ -305,6 +305,15 @@ translate_src( struct st_translate *t,
{
struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index );
+ if (t->procType == TGSI_PROCESSOR_GEOMETRY && SrcReg->HasIndex2) {
+ src = src_register( t, SrcReg->File, SrcReg->Index2 );
+ if (SrcReg->RelAddr2)
+ src = ureg_src_dimension_indirect( src, ureg_src(t->address[0]),
+ SrcReg->Index);
+ else
+ src = ureg_src_dimension( src, SrcReg->Index);
+ }
+
src = ureg_swizzle( src,
GET_SWZ( SrcReg->Swizzle, 0 ) & 0x3,
GET_SWZ( SrcReg->Swizzle, 1 ) & 0x3,
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 1d748965f80..6f3ecdbce11 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -492,6 +492,9 @@ st_translate_geometry_program(struct st_context *st,
/* which vertex output goes to the first geometry input */
vslot = 0;
+ memset(inputMapping, 0, sizeof(inputMapping));
+ memset(outputMapping, 0, sizeof(outputMapping));
+
/*
* Convert Mesa program inputs to TGSI input register semantics.
*/