[Mesa-dev] [Bug 96410] [Perf] Pre validate _mesa_sampler_uniforms_pipeline_are_valid like _mesa_sampler_uniforms_are_valid

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jun 18 00:19:51 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=96410

--- Comment #2 from Timothy Arceri <t_arceri at yahoo.com.au> ---
(In reply to gregory.hainaut from comment #1)
> Currently looking at the code of single program flow namely
> _mesa_update_shader_textures_used
> 
> The current check fails to detect wrongly reused sampler in multiple shader
> stage. The spec seems to imply that is must be checked in the full program
> (all stages).
> 
> <<
>      Errors
>   It is not allowed to have variables of different sampler types pointing to
>   the same texture image unit within a program object. This situation can
> only
>   be detected at the next rendering command issued which triggers shader
> invo-
>   cations, and an INVALID_OPERATION error will then be generated.
> >>
> 
> Here a typical example of an invalid program that will wrongly run fine.
> 
> ***** Vertex Shader
> layout(binding = 0) uniform sampler1D sampler_1d;
> 
> ***** Fragment Shader
> layout(binding = 0) uniform sampler2D sampler_2d;

See the FIXME I added when I mostly fixed this a while ago:
https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/main/uniform_query.cpp#n1095

The problem is the spec requires samplers to default to 0. So unless we manage
to eliminate everything that is unused (including early array elements) we will
likely trigger errors in programs that run fine elsewhere (since last time I
checked Nvidia doesn't do this validation at all)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160618/5ff5c91f/attachment-0001.html>


More information about the mesa-dev mailing list