<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - gl_PrimitiveID is zero when rendering points of size > 1"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96853#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - gl_PrimitiveID is zero when rendering points of size > 1"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96853">bug 96853</a>
              from <span class="vcard"><a class="email" href="mailto:sroland@vmware.com" title="Roland Scheidegger <sroland@vmware.com>"> <span class="fn">Roland Scheidegger</span></a>
</span></b>
        <pre>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);</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>