info->prop.gp.instanceCount = 1;
info->prop.gp.maxVertices = 1;
}
- info->prop.cp.numThreads = 1;
+ if (info->type == PIPE_SHADER_COMPUTE) {
+ info->prop.cp.numThreads[0] =
+ info->prop.cp.numThreads[1] =
+ info->prop.cp.numThreads[2] = 1;
+ }
info->io.pointSize = 0xff;
info->io.instanceId = 0xff;
info->io.vertexId = 0xff;
uint32_t inputOffset; /* base address for user args */
uint32_t sharedOffset; /* reserved space in s[] */
uint32_t gridInfoBase; /* base address for NTID,NCTAID */
- uint32_t numThreads; /* max number of threads */
+ uint16_t numThreads[3]; /* max number of threads */
} cp;
} prop;
}
info->io.viewportId = -1;
- info->prop.cp.numThreads = 1;
info->immd.data = (uint32_t *)MALLOC(scan.immediate_count * 16);
info->immd.type = (ubyte *)MALLOC(scan.immediate_count * sizeof(ubyte));
info->prop.tp.outputPrim = PIPE_PRIM_TRIANGLES; /* anything but points */
break;
case TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH:
+ info->prop.cp.numThreads[0] = prop->u[0].Data;
+ break;
case TGSI_PROPERTY_CS_FIXED_BLOCK_HEIGHT:
+ info->prop.cp.numThreads[1] = prop->u[0].Data;
+ break;
case TGSI_PROPERTY_CS_FIXED_BLOCK_DEPTH:
- info->prop.cp.numThreads *= prop->u[0].Data;
+ info->prop.cp.numThreads[2] = prop->u[0].Data;
break;
case TGSI_PROPERTY_NUM_CLIPDIST_ENABLED:
info->io.clipDistances = prop->u[0].Data;
return ld->getDef(0);
case TGSI_FILE_SYSTEM_VALUE:
assert(!ptr);
+ if (info->sv[idx].sn == TGSI_SEMANTIC_THREAD_ID &&
+ info->prop.cp.numThreads[swz] == 1)
+ return zero;
ld = mkOp1(OP_RDSV, TYPE_U32, getSSA(), srcToSym(src, c));
ld->perPatch = info->sv[idx].patch;
return ld->getDef(0);
virtual void getBuiltinCode(const uint32_t **code, uint32_t *size) const = 0;
virtual void parseDriverInfo(const struct nv50_ir_prog_info *info) {
- threads = info->prop.cp.numThreads;
+ threads = info->prop.cp.numThreads[0] *
+ info->prop.cp.numThreads[1] *
+ info->prop.cp.numThreads[2];
if (threads == 0)
threads = info->target >= NVISA_GK104_CHIPSET ? 1024 : 512;
}