diff options
author | Paul Berry <[email protected]> | 2013-02-22 15:37:41 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-03-19 16:56:56 -0700 |
commit | db81d3b8f78d1f5a70ce909981807825d11fc6f3 (patch) | |
tree | 08f86bf3a2bb9504b87ce6edd72123229f46e477 /Makefile.am | |
parent | 0af56c9d53a454477645f4537b8086120a638d3e (diff) |
ff_fragment_shader: Don't do unnecessary (and dangerous) uniform setup.
Previously, right after calling _mesa_glsl_link_shader(), the fixed
function fragment shader code made several calls with the ostensible
purpose of setting up uniforms for the fragment shader it just
created.
These calls are unnecessary, since _mesa_glsl_link_shader() calls
driver->LinkShader(), which takes care of calling these functions (or
their equivalent). Also, they are dangerous to call after
_mesa_glsl_link_shader() has returned, because on back-ends such as
i965 which do precompilation, _mesa_glsl_link_shader() may have
already cached pointers to the existing uniform structures; attempting
to set up the uniforms again invalidates those cached pointers.
It was only by sheer coincidence that this wasn't manifesting itself
as a bug. It turns out that i965's precompile mechanism was always
setting bit 0 of brw_wm_prog_key::proj_attrib_mask to 0 for fixed
function fragment shaders, but during normal usage this bit usually
gets set to 1. As a result, the precompiled shader (with its invalid
uniform pointers) was not being used.
I'm about to introduce some changes that cause bit 0 of
proj_attrib_mask to be set consistently between precompilation and
normal usage, so to avoid regressions I need to get rid of the
dangerous duplicate uniform setup code first.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'Makefile.am')
0 files changed, 0 insertions, 0 deletions