Re: [Mesa-dev] gl_nir_lower_samplers_as_deref vs drawpixels lowering

2019-11-25 Thread Dave Airlie
On Tue, 26 Nov 2019 at 05:19, Marek Olšák wrote: > > The way shader variants work in st/mesa is that NIR is generated, finalized, > and stored in the cache. This helps the most common case when there is only > one variant. If shader variants make changes to NIR, like adding samplers, >

Re: [Mesa-dev] gl_nir_lower_samplers_as_deref vs drawpixels lowering

2019-11-25 Thread Marek Olšák
The way shader variants work in st/mesa is that NIR is generated, finalized, and stored in the cache. This helps the most common case when there is only one variant. If shader variants make changes to NIR, like adding samplers, uniforms, and inputs, it needs to be finalized again, which means many

Re: [Mesa-dev] gl_nir_lower_samplers_as_deref vs drawpixels lowering

2019-11-25 Thread Kenneth Graunke
Yeah...I thought the drawpixels lowering set up samplers directly with explicit bindings. There should be no need to call it twice. We can't handle setting textures_used in nir_shader_gather_info because that is called both before and after lowering, and some of the information needed is no

Re: [Mesa-dev] gl_nir_lower_samplers_as_deref vs drawpixels lowering

2019-11-25 Thread Connor Abbott
Why are you calling gl_nir_lower_samplers_as_deref twice? The entire point of it is to deal with the crazy legacy GL model where samplers are "just normal uniforms" that can be embedded in structs and calling glUniform() can update the sampler binding. It doesn't touch samplers with an explicit