[Mesa-dev] [PATCH 1/2] prog_to_nir: Use a variable for uniform data

Jason Ekstrand jason at jlekstrand.net
Sat May 23 11:52:46 PDT 2015

On Sat, May 23, 2015 at 11:47 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On Tuesday, May 19, 2015 05:28:17 PM Jason Ekstrand wrote:
>> Previously, the prog_to_nir pass was directly generating uniform load/store
>> intrinsics.  This converts it to use a single giant "parameters" variable
>> and we now depend on lowering to get the uniform load/store intrinsics.
>> One advantage of this is that we now have one code-path after we do the
>> initial conversion into NIR.
>> No shader-db changes.
>> Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
>> ---
>>  src/mesa/drivers/dri/i965/brw_nir.c | 15 ++-------
>>  src/mesa/program/prog_to_nir.c      | 65 ++++++++++++++++++++-----------------
>>  2 files changed, 38 insertions(+), 42 deletions(-)
> That is indeed nicer...much less special casing.  This patch also makes
> an eventual goal of mine easier:
> If we ever start converting ARB programs directly to NIR, we'll be able
> to create multiple variables for disjoint sections of parameters---several
> arrays, rather than one giant array.  (Currently, that information is lost
> in Mesa IR, as far as I know.)  This would allow us to eliminate more
> unused parameters in the presence of indirects.

Yeah, hopefully we can start doing some sort of array-splitting in NIR
which would help with that.  Doing that on uniforms can be tricky

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


More information about the mesa-dev mailing list