[Mesa-dev] [PATCH 09/12] i965: Move lower_output_reads to brw_link_shader().

Kenneth Graunke kenneth at whitecape.org
Fri Apr 10 02:26:32 PDT 2015


On Wednesday, April 08, 2015 12:06:32 AM Kenneth Graunke wrote:
> This makes it so emit_nir_code() doesn't modify the GLSL IR.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 1 -
>  src/mesa/drivers/dri/i965/brw_shader.cpp | 3 +++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index 7c56290..145a447 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -90,7 +90,6 @@ fs_visitor::emit_nir_code()
>     nir_shader *nir;
>     /* First, lower the GLSL IR or Mesa IR to NIR */
>     if (shader_prog) {
> -      lower_output_reads(shader->base.ir);
>        nir = glsl_to_nir(&shader->base, options);
>     } else {
>        nir = prog_to_nir(prog, options);
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index bf9aceb..8700077 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -199,6 +199,9 @@ process_glsl_ir(struct brw_context *brw,
>                                          options, ctx->Const.NativeIntegers) || progress;
>     } while (progress);
>  
> +   if (options->NirOptions != NULL)
> +      lower_output_reads(shader->ir);
> +
>     validate_ir_tree(shader->ir);
>  
>     /* Now that we've finished altering the linked IR, reparent any live IR back
> 

I just pushed patches 1-8 - thanks for the review!

I think it would be wise to land "i965: Don't set NirOptions for stages
that will use the vec4 backend." before landing the rest of this series.
It introduces a few more dependencies on NirOptions != NULL.

NIR works with these patches, but I honestly can't recall whether I
tested non-NIR properly.  I'll have to check that again, to be safe.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150410/d7c7bfb8/attachment.sig>


More information about the mesa-dev mailing list