From ff55412f40a7d588e47e2c35d175aea0ac3cfe95 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 27 May 2021 18:59:37 +0200 Subject: [PATCH] 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: dc667b1f192 ("nv50/ir/nir: fix smem size") Signed-off-by: Karol Herbst Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index d6dcc6b11af..75e3ef14786 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -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;