[Mesa-dev] [Bug 96853] gl_PrimitiveID is zero when rendering points of size > 1

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 8 00:15:25 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=96853

--- Comment #1 from Roland Scheidegger <sroland at vmware.com> ---
I think this would be a bug in the emulation code used for large points.
Specifically, a gs is used to generate two tris out of a point, which means the
prim id cannot be first used in the fs, it has to be passed from gs.

Maybe something like this would fix it, but don't quote me on that...

diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c
b/src/gallium/auxiliary/util/u_simple_shaders.c
index 1220e18..9527d96 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -874,11 +874,14 @@ util_make_geometry_passthrough_shader(struct pipe_context
*pipe,
       src[i] = ureg_src_dimension(src[i], 0);
       dst[i] = ureg_DECL_output(ureg, semantic_names[i], semantic_indexes[i]);
    }
+   src[i] = ureg_DECL_input(ureg, TGSI_SEMANTIC_PRIM_ID, 0, 0, 1);
+   dst[i] = ureg_DECL_output(ureg, TGSI_SEMANTIC_PRIM_ID, 0);

    /* MOV dst[i] src[i] */
    for (i = 0; i < num_attribs; i++) {
       ureg_MOV(ureg, dst[i], src[i]);
    }
+   ureg_MOV(ureg, dst[i], src[i]);

    /* EMIT IMM[0] */
    ureg_insn(ureg, TGSI_OPCODE_EMIT, NULL, 0, &imm, 1);

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160708/2fc983f1/attachment.html>


More information about the mesa-dev mailing list