nv50/ir/nir: fix smem size for GL

Originally I fixed the case where the nir itself has a shared mem size of
0, but the frontend (e.g. clover) set it to some other value.

But st/mesa sets the shared mem size on the state object as well and we
end up actually doubling the value in the driver as we set smemSize to the
value from the state object before calling into the compiler.

So just max the value instead.

Fixes the compute_shader.shared-max CTS test.

Fixes: dc667b1f19 ("nv50/ir/nir: fix smem size")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11047>
This commit is contained in:
Karol Herbst 2021-05-27 18:59:37 +02:00
parent d6dd13a62e
commit ff55412f40
1 changed files with 1 additions and 1 deletions

View File

@ -1301,7 +1301,7 @@ Converter::parseNIR()
info->prop.cp.numThreads[0] = nir->info.workgroup_size[0];
info->prop.cp.numThreads[1] = nir->info.workgroup_size[1];
info->prop.cp.numThreads[2] = nir->info.workgroup_size[2];
info_out->bin.smemSize += nir->info.shared_size;
info_out->bin.smemSize = std::max(info_out->bin.smemSize, nir->info.shared_size);
break;
case Program::TYPE_FRAGMENT:
info_out->prop.fp.earlyFragTests = nir->info.fs.early_fragment_tests;