case 0x00: // rrr
break;
case 0x01: // arr/grr
- if (progType == Program::TYPE_GEOMETRY) {
+ if (progType == Program::TYPE_GEOMETRY && i->src(0).isIndirect(0)) {
code[0] |= 0x01800000;
if (enc == NV50_OP_ENC_LONG || enc == NV50_OP_ENC_LONG_ALT)
code[1] |= 0x00200000;
code[1] |= (i->getSrc(1)->reg.fileIndex << 22);
break;
case 0x09: // acr/gcr
- if (progType == Program::TYPE_GEOMETRY) {
+ if (progType == Program::TYPE_GEOMETRY && i->src(0).isIndirect(0)) {
code[0] |= 0x01800000;
} else {
code[0] |= (enc == NV50_OP_ENC_LONG_ALT) ? 0x01000000 : 0x00800000;
switch (sf) {
case FILE_SHADER_INPUT:
- if (progType == Program::TYPE_GEOMETRY)
+ if (progType == Program::TYPE_GEOMETRY && i->src(0).isIndirect(0))
code[0] = 0x11800001;
else
// use 'mov' where we can
return mkOp1v(OP_RDSV, TYPE_F32, getSSA(), mkSysVal(SV_FACE, 0));
return interpolate(src, c, shiftAddress(ptr));
} else
- if (ptr && prog->getType() == Program::TYPE_GEOMETRY) {
+ if (prog->getType() == Program::TYPE_GEOMETRY) {
+ if (!ptr && info->in[idx].sn == TGSI_SEMANTIC_PRIMID)
+ return mkOp1v(OP_RDSV, TYPE_U32, getSSA(), mkSysVal(SV_PRIMITIVE_ID, 0));
// XXX: This is going to be a problem with scalar arrays, i.e. when
// we cannot assume that the address is given in units of vec4.
//
// nv50 and nvc0 need different things here, so let the lowering
// passes decide what to do with the address
- return mkLoadv(TYPE_U32, srcToSym(src, c), ptr);
+ if (ptr)
+ return mkLoadv(TYPE_U32, srcToSym(src, c), ptr);
}
return mkLoadv(TYPE_U32, srcToSym(src, c), shiftAddress(ptr));
case TGSI_FILE_OUTPUT: