[Mesa-dev] [PATCH 1/2] glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass

Kenneth Graunke kenneth at whitecape.org
Fri Oct 21 17:21:27 PDT 2011


On 10/21/2011 11:49 AM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Setting this flag prevents declarations of uniforms from being removed
> from the IR.  Since the IR is directly used by several API functions
> that query uniforms in shaders, uniform declarations cannot be removed
> after the locations have been set.  However, it should still be safe
> to reorder the declarations (this is not tested).
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
> Cc: Brian Paul <brianp at vmware.com>
> Cc: Bryan Cain <bryancain3 at gmail.com>
> Cc: Vinson Lee <vlee at vmware.com>
> Cc: José Fonseca <jfonseca at vmware.com>
> Cc: Kenneth Graunke <kenneth at whitecape.org>

I had wondered why we couldn't just check var->mode == ir_var_uniform &&
var->location == -1, but Ian mentioned that (at least after his upcoming
patches) it wasn't set yet.

So...I think this plan seems reasonable.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list