summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2010-07-10 02:02:35 -0400
committerZack Rusin <[email protected]>2010-07-10 02:02:35 -0400
commit425870c5fdb40f7daf2e25323fa28c90c4367bae (patch)
tree00c1aed27016d3404c7c1d5a794a5ae5192b8879 /src/mesa/state_tracker
parent9808308f9ad05c5fd6916cb808c66be23f21db60 (diff)
mesa: get the translation from mesa 2d regs to tgsi working
first working version of arb_geometry_shader4
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c19
-rw-r--r--src/mesa/state_tracker/st_program.c3
2 files changed, 13 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 050b5d164d7..c870db2d699 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->HasIndex2D) {
+ src = src_register( t, SrcReg->File, SrcReg->Index2D );
+ if (SrcReg->RelAddr2D)
+ 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,
@@ -330,14 +339,6 @@ translate_src( struct st_translate *t,
}
}
- if (SrcReg->HasIndex2D) {
- if (SrcReg->RelAddr2D)
- src = ureg_src_dimension_indirect( src, ureg_src(t->address[0]),
- SrcReg->Index2D);
- else
- src = ureg_src_dimension( src, SrcReg->Index2D);
- }
-
return src;
}
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.
*/