diff options
author | Marek Olšák <[email protected]> | 2019-09-30 21:29:11 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-10-10 15:49:18 -0400 |
commit | e621b30787cebbc967468f2983f4bf90a2d287ea (patch) | |
tree | 754a99cde5496b0c2d6b1b20db64ee4825ddf771 /src/compiler/nir/nir_lower_drawpixels.c | |
parent | 3340c066a17735c0214dfde3df396799bd4275ef (diff) |
nir/drawpixels: handle load_color0, load_input, load_interpolated_input
for radeonsi
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_drawpixels.c')
-rw-r--r-- | src/compiler/nir/nir_lower_drawpixels.c | 27 |
1 files changed, 26 insertions, 1 deletions
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; } } } |