[Mesa-dev] gl_nir_lower_samplers_as_deref vs drawpixels lowering

Dave Airlie airlied at gmail.com
Mon Nov 25 05:56:21 UTC 2019


I was asked to use some newer radeonsi code in my tgsi info gathering
wrapper for NIR. One of the things it does is use
nir->info.textures_used.

Now with the piglit test draw-pixel-with-texture there is a reentrancy
issue with the passes.

We create a shader and gl_nir_lower_samplers_as_deref get called on
it, this sets nir->info.textures_used to 1, and it also lowers all
texture derefs in the shader.

The shader gets used in a variant later for drawpixels, the drawpixels
lowering then adds it's own "drawpix" sampler an accesses it with
derefs. Then gl_nir_lower_samplers_as_deref gets called again for the
whole shader in finalisation, but this time the first set of derefs
have already been lowered so it only lowers the new drawpix ones, and
sets nir->info.textures_used to 2 (it's a bitfield), it should be 3.

Are the other drivers seeing this? any ideas on what needs to be
fixed, the nir sampler lowering could I suppose record
nir->info.textures_used for non-deref textures as well.

Dave.


More information about the mesa-dev mailing list