[Mesa-dev] [PATCH] mesa: expand the fragprog_inputs_read bitfield in ffvertex_prog.c

Eric Anholt eric at anholt.net
Fri Nov 9 09:45:20 PST 2012


Brian Paul <brianp at vmware.com> writes:

> On 11/07/2012 10:18 AM, Eric Anholt wrote:
>> Brian Paul<brianp at vmware.com>  writes:
>>
>>> The glean glsl1 test was failing an assertion because FRAG_ATTRIB_FACE
>>> (and FRAG_ATTRIB_PNTC) doesn't fit in a 12-bit field.
>>>
>>> In the failing case we're using a fragment shader with fixed-function
>>> vertex processing.
>>
>> What about if they have an FS reading generic attribs, and forget to
>> bind a VS.  Should they still assertion fail?
>
> I modified the glean test to also read a 'foo' varying var in the FS 
> and I didn't see a failure.

FRAG_BIT_VAR0 is 1<<16, so I don't see how you got this result if the
assertion is working like you intend.

The code before was implicitly truncating to the 12 bits it cared about,
and this assertion seems to just be getting in the way.  If you want to
explicitly mask to 12 bits to shut up a static analysis tool, or also
static assert that FRAT_ATTRIB_TEX7 < 12 for safety or something, I
guess that's fine, but the assertion can't just be looking at
fs->InputsRead, and there's no reason to extend the bitfield to 14 but
not FRAG_ATTRIB_MAX.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121109/95b006c1/attachment.pgp>


More information about the mesa-dev mailing list