From 21943c35f75d90f464f8495f5282037e1c7c79d0 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 21 Oct 2016 14:15:03 -0700 Subject: intel/blorp: Handle NIR clear inputs the same way as blit inputs By using offsetof() we can ensure that adding fiels to wm_inputs is always safe as long as we maintain alignment. Signed-off-by: Jason Ekstrand Reviewed-by: Topi Pohjolainen --- src/intel/blorp/blorp_blit.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/intel/blorp/blorp_blit.c') diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index 893a4bc4b16..27af21f2548 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -67,13 +67,7 @@ brw_blorp_blit_vars_init(nir_builder *b, struct brw_blorp_blit_vars *v, assert(!key->use_kill || !(key->blend && key->blit_scaled)); #define LOAD_INPUT(name, type)\ - v->v_##name = nir_variable_create(b->shader, nir_var_shader_in, \ - type, #name); \ - v->v_##name->data.interpolation = INTERP_MODE_FLAT; \ - v->v_##name->data.location = VARYING_SLOT_VAR0 + \ - offsetof(struct brw_blorp_wm_inputs, name) / (4 * sizeof(float)); \ - v->v_##name->data.location_frac = \ - (offsetof(struct brw_blorp_wm_inputs, name) / sizeof(float)) % 4; + v->v_##name = BLORP_CREATE_NIR_INPUT(b->shader, name, type); LOAD_INPUT(discard_rect, glsl_vec4_type()) LOAD_INPUT(rect_grid, glsl_vec4_type()) -- cgit v1.2.3