[Mesa-dev] vertex shader that processes 0 vertex data

keith whitwell keith.whitwell at gmail.com
Wed Sep 1 00:17:17 PDT 2010


On Wed, Sep 1, 2010 at 7:14 AM, Dave Airlie <airlied at gmail.com> wrote:
> I was looking at glsl-vs-point-size in piglit today and it doesn't
> work on gallium.
>
> void main()
> {
>        gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
>        gl_PointSize = 16.0;
>        gl_FrontColor = vec4(1.0, 1.0, 1.0, 1.0);
> }
>
> Since the vertex shader doesn't have any declared inputs,
>
> we work out the vp in gallium and then in st_draw.c:st_draw_vbo we hit
>
>   if (num_vbuffers == 0 || num_velements == 0)
>      return;
>
> Any ideas on what should happen here?
>

I hadn't really considered this case, but it's clearly valid.  What
should be happening seems clear - there should be zero vertex buffers
bound and zero vertex elements referencing them and the draw call
should be legal.

Basically, the test above is incorrect and should be removed.  I
suspect the same assumption is built in elsewhere in the code and
you'll hit a few asserts and crashes in the process of getting this
working.

Keith


More information about the mesa-dev mailing list