From 3e9aacb139dc4cb101780e235fc5dd45acf860f3 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Mon, 6 Jan 2020 21:54:26 -0500 Subject: [PATCH] gm107/ir: avoid combining geometry shader stores at 0x60 This corresponds to gl_PrimitiveID and gl_Layer. When both of these are stored in a single AST.64 or AST.128 operation, then it appears as though the whole store fails. Fixes the recently extended glsl-1.50-transform-feedback-builtins piglit, and also gtf30.GL3Tests.transform_feedback.transform_feedback_builtins. The issue was reproduced on GM107 and GP108 but not GK208 nor GK104. Signed-off-by: Ilia Mirkin --- .../drivers/nouveau/codegen/nv50_ir_peephole.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 673fcd187ca..2f46b0e886a 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -2804,6 +2804,16 @@ MemoryOpt::combineSt(Record *rec, Instruction *st) if (prog->getType() == Program::TYPE_COMPUTE && rec->rel[0]) return false; + // There's really no great place to put this in a generic manner. Seemingly + // wide stores at 0x60 don't work in GS shaders on SM50+. Don't combine + // those. + if (prog->getTarget()->getChipset() >= NVISA_GM107_CHIPSET && + prog->getType() == Program::TYPE_GEOMETRY && + st->getSrc(0)->reg.file == FILE_SHADER_OUTPUT && + rec->rel[0] == NULL && + MIN2(offRc, offSt) == 0x60) + return false; + // remove any existing load/store records for the store being merged into // the existing record. purgeRecords(st, DATA_FILE_COUNT); -- 2.30.2