r600: workaround empty geom shader.
authorDave Airlie <airlied@redhat.com>
Tue, 24 Feb 2015 04:09:40 +0000 (14:09 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Dec 2015 02:58:43 +0000 (12:58 +1000)
We need to emit at least one cut/emit in every
geometry shader, the easiest workaround it to
stick a single CUT at the top of each geom shader.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.6 11.0 11.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index 6233753e71678ca021bd5ba37fc6835d55175f84..9fe20b0286109942df332e3b6e75d0c9804d1422 100644 (file)
@@ -2219,6 +2219,11 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
                if (ctx.type == TGSI_PROCESSOR_GEOMETRY) {
                        struct r600_bytecode_alu alu;
                        int r;
+
+                       /* GS thread with no output workaround - emit a cut at start of GS */
+                       if (ctx.bc->chip_class == R600)
+                               r600_bytecode_add_cfinst(ctx.bc, CF_OP_CUT_VERTEX);
+
                        for (j = 0; j < 4; j++) {
                                memset(&alu, 0, sizeof(struct r600_bytecode_alu));
                                alu.op = ALU_OP1_MOV;