<div dir="ltr">LGTM. R-B still applies<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 4, 2016 at 9:45 AM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@intel.com" target="_blank">topi.pohjolainen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2 (Jason): Use LOAD_INPUT() macro<br>
<br>
Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> (v1)<br>
---<br>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 24 +++++++++++++-----------<br>
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 9 +++++----<br>
2 files changed, 18 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
index 0d9fb92..76e771f 100644<br>
<span class="">--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
@@ -331,10 +331,10 @@ enum sampler_message_arg<br>
<br>
struct brw_blorp_blit_vars {<br>
/* Input values from brw_blorp_wm_inputs */<br>
- nir_variable *u_discard_rect;<br>
- nir_variable *u_rect_grid;<br>
- nir_variable *u_coord_transform;<br>
- nir_variable *u_src_z;<br>
+ nir_variable *v_discard_rect;<br>
+ nir_variable *v_rect_grid;<br>
+ nir_variable *v_coord_transform;<br>
+ nir_variable *v_src_z;<br>
<br>
/* gl_FragCoord */<br>
nir_variable *frag_coord;<br>
</span>@@ -351,9 +351,11 @@ brw_blorp_blit_vars_init(nir_builder *b, struct brw_blorp_blit_vars *v,<br>
assert(!key->use_kill || !(key->blend && key->blit_scaled));<br>
<br>
#define LOAD_INPUT(name, type)\<br>
- v->u_##name = nir_variable_create(b->shader, nir_var_uniform, type, #name); \<br>
- v->u_##name->data.location = \<br>
- offsetof(struct brw_blorp_wm_inputs, name);<br>
+ v->v_##name = nir_variable_create(b->shader, nir_var_shader_in, \<br>
+ type, #name); \<br>
+ v->v_##name->data.interpolation = INTERP_QUALIFIER_FLAT; \<br>
+ v->v_##name->data.location = VARYING_SLOT_VAR0 + \<br>
+ offsetof(struct brw_blorp_wm_inputs, name) / (4 * sizeof(float));<br>
<br>
LOAD_INPUT(discard_rect, glsl_vec4_type())<br>
LOAD_INPUT(rect_grid, glsl_vec4_type())<br>
@@ -395,7 +397,7 @@ nir_ssa_def *<br>
<span class=""> blorp_blit_apply_transform(nir_builder *b, nir_ssa_def *src_pos,<br>
struct brw_blorp_blit_vars *v)<br>
{<br>
- nir_ssa_def *coord_transform = nir_load_var(b, v->u_coord_transform);<br>
+ nir_ssa_def *coord_transform = nir_load_var(b, v->v_coord_transform);<br>
<br>
nir_ssa_def *offset = nir_vec2(b, nir_channel(b, coord_transform, 1),<br>
nir_channel(b, coord_transform, 3));<br>
</span>@@ -410,7 +412,7 @@ blorp_nir_discard_if_outside_rect(nir_builder *b, nir_ssa_def *pos,<br>
<span class=""> struct brw_blorp_blit_vars *v)<br>
{<br>
nir_ssa_def *c0, *c1, *c2, *c3;<br>
- nir_ssa_def *discard_rect = nir_load_var(b, v->u_discard_rect);<br>
+ nir_ssa_def *discard_rect = nir_load_var(b, v->v_discard_rect);<br>
nir_ssa_def *dst_x0 = nir_channel(b, discard_rect, 0);<br>
nir_ssa_def *dst_x1 = nir_channel(b, discard_rect, 1);<br>
nir_ssa_def *dst_y0 = nir_channel(b, discard_rect, 2);<br>
</span>@@ -498,7 +500,7 @@ blorp_nir_txf(nir_builder *b, struct brw_blorp_blit_vars *v,<br>
<span class=""> */<br>
assert(pos->num_components == 2);<br>
pos = nir_vec3(b, nir_channel(b, pos, 0), nir_channel(b, pos, 1),<br>
- nir_load_var(b, v->u_src_z));<br>
+ nir_load_var(b, v->v_src_z));<br>
<br>
tex->sampler_dim = GLSL_SAMPLER_DIM_3D;<br>
tex->coord_components = 3;<br>
</span>@@ -1031,7 +1033,7 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,<br>
<span class=""> struct brw_blorp_blit_vars *v)<br>
{<br>
nir_ssa_def *pos_xy = nir_channels(b, pos, 0x3);<br>
- nir_ssa_def *rect_grid = nir_load_var(b, v->u_rect_grid);<br>
+ nir_ssa_def *rect_grid = nir_load_var(b, v->v_rect_grid);<br>
nir_ssa_def *scale = nir_imm_vec2(b, key->x_scale, key->y_scale);<br>
<br>
/* Translate coordinates to lay out the samples in a rectangular grid<br>
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp<br>
</span>index 4345ee5..a38ea0c 100644<br>
<div class="HOEnZb"><div class="h5">--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp<br>
@@ -67,16 +67,17 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw,<br>
nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);<br>
b.shader-><a href="http://info.name" rel="noreferrer" target="_blank">info.name</a> = ralloc_strdup(b.shader, "BLORP-clear");<br>
<br>
- nir_variable *u_color = nir_variable_create(b.shader, nir_var_uniform,<br>
- glsl_vec4_type(), "u_color");<br>
- u_color->data.location = 0;<br>
+ nir_variable *v_color = nir_variable_create(b.shader, nir_var_shader_in,<br>
+ glsl_vec4_type(), "v_color");<br>
+ v_color->data.location = VARYING_SLOT_VAR0;<br>
+ v_color->data.interpolation = INTERP_QUALIFIER_FLAT;<br>
<br>
nir_variable *frag_color = nir_variable_create(b.shader, nir_var_shader_out,<br>
glsl_vec4_type(),<br>
"gl_FragColor");<br>
frag_color->data.location = FRAG_RESULT_COLOR;<br>
<br>
- nir_copy_var(&b, frag_color, u_color);<br>
+ nir_copy_var(&b, frag_color, v_color);<br>
<br>
struct brw_wm_prog_key wm_key;<br>
brw_blorp_init_wm_prog_key(&wm_key);<br>
--<br>
2.5.5<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>