[Mesa-dev] [PATCH 01/10] i965/nir: Do lower_io late for fragment shaders
Iago Toral
itoral at igalia.com
Fri Feb 26 09:52:45 UTC 2016
Series is:
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
On Thu, 2016-02-25 at 11:01 -0800, Kenneth Graunke wrote:
> From: Jason Ekstrand <jason.ekstrand at intel.com>
>
> The Vulkan driver wants to be able to delete fragment outputs that are
> beyond key.nr_color_regions; this is a lot easier if we lower outputs at
> specialization time rather than link time.
>
> (Rationale added to commit message by Ken)
> ---
> src/mesa/drivers/dri/i965/brw_fs.cpp | 1 +
> src/mesa/drivers/dri/i965/brw_nir.c | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index b506040..6c9ba36 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -5594,6 +5594,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
> nir_shader *shader = nir_shader_clone(mem_ctx, src_shader);
> shader = brw_nir_apply_sampler_key(shader, compiler->devinfo, &key->tex,
> true);
> + shader = brw_nir_lower_io(shader, compiler->devinfo, true, false, NULL);
> shader = brw_postprocess_nir(shader, compiler->devinfo, true);
>
> /* key->alpha_test_func means simulating alpha testing via discards,
> diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
> index 41059b3..61acf38 100644
> --- a/src/mesa/drivers/dri/i965/brw_nir.c
> +++ b/src/mesa/drivers/dri/i965/brw_nir.c
> @@ -627,7 +627,8 @@ brw_create_nir(struct brw_context *brw,
>
> if (nir->stage != MESA_SHADER_VERTEX &&
> nir->stage != MESA_SHADER_TESS_CTRL &&
> - nir->stage != MESA_SHADER_TESS_EVAL) {
> + nir->stage != MESA_SHADER_TESS_EVAL &&
> + nir->stage != MESA_SHADER_FRAGMENT) {
> nir = brw_nir_lower_io(nir, devinfo, is_scalar, false, NULL);
> }
>
More information about the mesa-dev
mailing list