mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
nv50/ir: fix threads calculation for non-compute shaders
We were using the "cp" union fields, which are only valid for compute
shaders. The threads calculation affects the available GPRs, so just
pick a small number for other shader types to avoid limiting available
registers.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 3645268748)
This commit is contained in:
parent
5835f4f4c6
commit
ff04dfc28a
1 changed files with 9 additions and 5 deletions
|
|
@ -174,11 +174,15 @@ public:
|
|||
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[0] *
|
||||
info->prop.cp.numThreads[1] *
|
||||
info->prop.cp.numThreads[2];
|
||||
if (threads == 0)
|
||||
threads = info->target >= NVISA_GK104_CHIPSET ? 1024 : 512;
|
||||
if (info->type == PIPE_SHADER_COMPUTE) {
|
||||
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;
|
||||
} else {
|
||||
threads = 32; // doesn't matter, just not too big.
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool runLegalizePass(Program *, CGStage stage) const = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue