From: Marek Olšák Date: Tue, 1 Oct 2019 01:29:11 +0000 (-0400) Subject: nir/drawpixels: handle load_color0, load_input, load_interpolated_input X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e621b30787cebbc967468f2983f4bf90a2d287ea;p=mesa.git nir/drawpixels: handle load_color0, load_input, load_interpolated_input for radeonsi Reviewed-by: Timothy Arceri --- diff --git a/src/compiler/nir/nir_lower_drawpixels.c b/src/compiler/nir/nir_lower_drawpixels.c index c4c0c508757..c0da1a4a258 100644 --- a/src/compiler/nir/nir_lower_drawpixels.c +++ b/src/compiler/nir/nir_lower_drawpixels.c @@ -239,7 +239,9 @@ lower_drawpixels_block(lower_drawpixels_state *state, nir_block *block) nir_foreach_instr_safe(instr, block) { if (instr->type == nir_instr_type_intrinsic) { nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr); - if (intr->intrinsic == nir_intrinsic_load_deref) { + + switch (intr->intrinsic) { + case nir_intrinsic_load_deref: { nir_deref_instr *deref = nir_src_as_deref(intr->src[0]); nir_variable *var = nir_deref_instr_get_variable(deref); @@ -252,6 +254,29 @@ lower_drawpixels_block(lower_drawpixels_state *state, nir_block *block) assert(deref->deref_type == nir_deref_type_var); lower_texcoord(state, intr); } + break; + } + + case nir_intrinsic_load_color0: + lower_color(state, intr); + break; + + case nir_intrinsic_load_interpolated_input: + case nir_intrinsic_load_input: { + /* The intrinsic doesn't carry the variable. We need to find it + * manually. + */ + nir_foreach_variable(var, &state->b.shader->inputs) { + if ((var->data.driver_location == nir_intrinsic_base(intr)) && + (nir_intrinsic_component(intr) >= var->data.location_frac && + nir_intrinsic_component(intr) < + (var->data.location_frac + glsl_get_components(var->type)))) + lower_texcoord(state, intr); + } + break; + } + default: + break; } } }