gm107/ir: avoid combining geometry shader stores at 0x60
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 7 Jan 2020 02:54:26 +0000 (21:54 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 12 Jan 2020 17:11:16 +0000 (12:11 -0500)
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 <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 673fcd1..2f46b0e 100644 (file)
@@ -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);