[Mesa-dev] [PATCH 1/3] i965: Drop unnecessary switch statement in nir_setup_outputs()

Iago Toral itoral at igalia.com
Mon Oct 24 11:05:28 UTC 2016


Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

On Sun, 2016-10-23 at 23:44 -0700, Kenneth Graunke wrote:
> TCS and FS are skipped above.  CS has no output variables.
> All remaining cases take the same path.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index 4e68ffb..9cad1a6 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -87,18 +87,9 @@ fs_visitor::nir_setup_outputs()
>     nir_outputs = bld.vgrf(BRW_REGISTER_TYPE_F, nir->num_outputs);
>  
>     nir_foreach_variable(var, &nir->outputs) {
> -      switch (stage) {
> -      case MESA_SHADER_VERTEX:
> -      case MESA_SHADER_TESS_EVAL:
> -      case MESA_SHADER_GEOMETRY: {
> -         fs_reg reg = offset(nir_outputs, bld, var-
> >data.driver_location);
> -         unsigned location = var->data.location;
> -         nir_setup_single_output_varying(&reg, var->type,
> &location);
> -         break;
> -      }
> -      default:
> -         unreachable("unhandled shader stage");
> -      }
> +      fs_reg reg = offset(nir_outputs, bld, var-
> >data.driver_location);
> +      unsigned location = var->data.location;
> +      nir_setup_single_output_varying(&reg, var->type, &location);
>     }
>  }
>  


More information about the mesa-dev mailing list