[Mesa-dev] [PATCH] draw: initialize shader inputs

Roland Scheidegger sroland at vmware.com
Wed Oct 12 03:35:09 UTC 2016


Am 12.10.2016 um 02:21 schrieb Kenneth Graunke:
> On Wednesday, October 12, 2016 12:04:34 AM PDT sroland at vmware.com wrote:
>> From: Roland Scheidegger <sroland at vmware.com>
>>
>> This should make the code more robust if a shader tries to use inputs which
>> aren't defined by the vertex element layout (which usually shouldn't happen).
>>
>> No piglit change.
>> ---
>>  src/gallium/auxiliary/draw/draw_llvm.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
> 
> Well, "robust", or "hiding application bugs"...this likely introduces a
> small but non-zero cost for correctly written applications, and only
> benefits broken ones...seems like a bad trade-off to me...
> 
> For shader temporaries, we made this a drirc option.

Well, typically we'd like to operate with dx10 rules in mind, which
mandate "do not crash" (and more). (llvmpipe generally honors everything
robust_buffer_access, robust_buffer_access_behavior would require, and
sometimes actually at a significant cost - the cost here should be very
minimal since llvm can deduce these inputs aren't actually used (with
correct apps) and throw the code out, the assembly will stay the same).
Though I'm not sure this case can actually be hit with mesa/st, even
with incorrect apps...

If you'd really like to have faster, but not robust llvmpipe, you could
make it configurable - I assure you there's way more bigger fish to fry
than this particular bit (even in draw).

Roland



More information about the mesa-dev mailing list