[Mesa-dev] [PATCH 13/18] i965/blorp: Use flat inputs instead of uniforms

Pohjolainen, Topi topi.pohjolainen at intel.com
Mon Jul 4 05:42:25 UTC 2016


On Fri, Jul 01, 2016 at 01:10:59PM -0700, Jason Ekstrand wrote:
>    On Thu, Jun 23, 2016 at 12:17 PM, Topi Pohjolainen
>    <[1]topi.pohjolainen at intel.com> wrote:
> 
>      Signed-off-by: Topi Pohjolainen <[2]topi.pohjolainen at intel.com>
>      ---
>       src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  | 43
>      ++++++++++++++-------------
>       src/mesa/drivers/dri/i965/brw_blorp_clear.cpp |  9 +++---
>       2 files changed, 27 insertions(+), 25 deletions(-)
>      diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>      b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>      index 1683f8e..616f87e 100644
>      --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>      +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>      @@ -331,10 +331,10 @@ enum sampler_message_arg
>       struct brw_blorp_blit_vars {
>          /* Input values from brw_blorp_wm_inputs */
>      -   nir_variable *u_discard_rect;
>      -   nir_variable *u_rect_grid;
>      -   nir_variable *u_coord_transform;
>      -   nir_variable *u_src_z;
>      +   nir_variable *v_discard_rect;
>      +   nir_variable *v_rect_grid;
>      +   nir_variable *v_coord_transform;
>      +   nir_variable *v_src_z;
>          /* gl_FragCoord */
>          nir_variable *frag_coord;
>      @@ -349,34 +349,35 @@ brw_blorp_blit_vars_init(nir_builder *b,
>      struct brw_blorp_blit_vars *v,
>       {
>          if (key->use_kill) {
>             assert(!(key->blend && key->blit_scaled));
>      -      v->u_discard_rect = nir_variable_create(b->shader,
>      nir_var_uniform,
>      +      v->v_discard_rect = nir_variable_create(b->shader,
>      nir_var_shader_in,
> 
>      glsl_type::uvec4_type,
>                                                     "discard_rect");
>      -      v->u_discard_rect->data.location =
>      -         offsetof(struct brw_blorp_wm_inputs, discard_rect);
>      -      v->u_rect_grid = NULL;
>      +      v->v_discard_rect->data.location = VARYING_SLOT_VAR0;
> 
>    I think I'd prefer "VARYING_SLOT_VAR0 + offsetof() / 16".  That way, if
>    someone adds a new varying in the middle, slots automatically get
>    updated.  That's the reason why I made the UNIFORM macro in the first
>    place.

That makes perfect sense, I also kept the macro (just renamed it LOAD_INPUT).
Update coming up.


More information about the mesa-dev mailing list