opt |= PT_SHADE;
}
- if (draw->pt.middle.llvm && !draw->gs.geometry_shader) {
+ if (draw->pt.middle.llvm) {
middle = draw->pt.middle.llvm;
} else {
if (opt == 0)
}
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) {
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));
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));
{
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,
}
}
- 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;
}
/* 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.
*/