diff options
author | Zack Rusin <[email protected]> | 2010-07-10 02:02:35 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2010-07-10 02:02:35 -0400 |
commit | 425870c5fdb40f7daf2e25323fa28c90c4367bae (patch) | |
tree | 00c1aed27016d3404c7c1d5a794a5ae5192b8879 /src/mesa/slang | |
parent | 9808308f9ad05c5fd6916cb808c66be23f21db60 (diff) |
mesa: get the translation from mesa 2d regs to tgsi working
first working version of arb_geometry_shader4
Diffstat (limited to 'src/mesa/slang')
-rw-r--r-- | src/mesa/slang/slang_emit.c | 8 | ||||
-rw-r--r-- | src/mesa/slang/slang_link.c | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/mesa/slang/slang_emit.c b/src/mesa/slang/slang_emit.c index 4a02ba6d466..6cd9ce65a02 100644 --- a/src/mesa/slang/slang_emit.c +++ b/src/mesa/slang/slang_emit.c @@ -2320,7 +2320,13 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) } else if (n->Store->File == PROGRAM_INPUT) { assert(n->Store->Index >= 0); - emitInfo->prog->InputsRead |= (1 << n->Store->Index); + /* geometry shaders have the input index in the second + * index */ + if (emitInfo->prog->Target == MESA_GEOMETRY_PROGRAM && + n->Store->Is2D) { + emitInfo->prog->InputsRead |= (1 << n->Store->Index2D); + } else + emitInfo->prog->InputsRead |= (1 << n->Store->Index); } if (n->Store->Index < 0) { diff --git a/src/mesa/slang/slang_link.c b/src/mesa/slang/slang_link.c index bc2bd31fda5..8d5a9e96ad9 100644 --- a/src/mesa/slang/slang_link.c +++ b/src/mesa/slang/slang_link.c @@ -761,9 +761,15 @@ _slang_update_inputs_outputs(struct gl_program *prog) const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); for (j = 0; j < numSrc; j++) { if (inst->SrcReg[j].File == PROGRAM_INPUT) { - prog->InputsRead |= get_inputs_read_mask(prog->Target, - inst->SrcReg[j].Index, - inst->SrcReg[j].RelAddr); + if (prog->Target == MESA_GEOMETRY_PROGRAM && + inst->SrcReg[j].HasIndex2D) + prog->InputsRead |= get_inputs_read_mask(prog->Target, + inst->SrcReg[j].Index2D, + inst->SrcReg[j].RelAddr2D); + else + prog->InputsRead |= get_inputs_read_mask(prog->Target, + inst->SrcReg[j].Index, + inst->SrcReg[j].RelAddr); } else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) { maxAddrReg = MAX2(maxAddrReg, (GLuint) (inst->SrcReg[j].Index + 1)); |