[Mesa-dev] Gallium: src_offset of pipe_vertex_element should be more restricted

Jose Fonseca jfonseca at vmware.com
Fri Mar 30 11:18:45 PDT 2012

----- Original Message -----
> Hi everyone,
> I noticed the src_offset of pipe_vertex_element has 32 bits, but no
> hardware can do such a large value per vertex element and it leads to
> awkward workarounds in hardware drivers. To my knowledge, nv50 can
> only do 12 bits and r600 can only do 16 bits. There's no such
> limitation on pipe_vertex_buffer::buffer_offset.
> I am proposing to change src_offset to 12 bits. Then the
> pipe_vertex_element struct can be packed like this:

D3D9 uses 16bits:


D3D11 uses 32bits:


> The Mesa state tracker change should be trivial. 

Could you elaborate? Would it be trivial to modify the state tracker so that it only uses 12bits all the time?

> Opinions?

I agree workaround this on every driver is not nice. I'm not sure it makes sense to enforce the least common denominator everywhere, or maybe just advertise the maximum in a cap. Probably most apps would not trigger anyway.


More information about the mesa-dev mailing list