summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-02-08 17:04:07 -0600
committerJason Ekstrand <[email protected]>2019-04-19 19:56:42 +0000
commitbf61f057f72b57e977440ff66dc557d1140fede3 (patch)
tree15a7a5ab0c1e94dd3c0184990db5cf61914eff22 /src/intel
parentf16fcb9db779bd9b48a79df144358ac50428e6e8 (diff)
anv: Pass the plane into lower_tex_deref
Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_nir_apply_pipeline_layout.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c
index 9d25b9420fc..ab0103cfcd4 100644
--- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c
+++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c
@@ -745,7 +745,7 @@ lower_load_constant(nir_intrinsic_instr *intrin,
static void
lower_tex_deref(nir_tex_instr *tex, nir_tex_src_type deref_src_type,
- unsigned *base_index,
+ unsigned *base_index, unsigned plane,
struct apply_pipeline_layout_state *state)
{
int deref_src_idx = nir_tex_instr_src_index(tex, deref_src_type);
@@ -763,11 +763,11 @@ lower_tex_deref(nir_tex_instr *tex, nir_tex_src_type deref_src_type,
nir_tex_src_type offset_src_type;
if (deref_src_type == nir_tex_src_texture_deref) {
offset_src_type = nir_tex_src_texture_offset;
- *base_index = state->set[set].surface_offsets[binding];
+ *base_index = state->set[set].surface_offsets[binding] + plane;
} else {
assert(deref_src_type == nir_tex_src_sampler_deref);
offset_src_type = nir_tex_src_sampler_offset;
- *base_index = state->set[set].sampler_offsets[binding];
+ *base_index = state->set[set].sampler_offsets[binding] + plane;
}
nir_ssa_def *index = NULL;
@@ -827,12 +827,10 @@ lower_tex(nir_tex_instr *tex, struct apply_pipeline_layout_state *state)
unsigned plane = tex_instr_get_and_remove_plane_src(tex);
lower_tex_deref(tex, nir_tex_src_texture_deref,
- &tex->texture_index, state);
- tex->texture_index += plane;
+ &tex->texture_index, plane, state);
lower_tex_deref(tex, nir_tex_src_sampler_deref,
- &tex->sampler_index, state);
- tex->sampler_index += plane;
+ &tex->sampler_index, plane, state);
/* The backend only ever uses this to mark used surfaces. We don't care
* about that little optimization so it just needs to be non-zero.