nir/lower_image: Handle index and bindless image_size

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12005>
This commit is contained in:
Jason Ekstrand 2021-07-22 00:17:33 -05:00
parent 1d6c790f9f
commit c6102dda0a

View file

@ -70,14 +70,20 @@ lower_image_instr(nir_builder *b, nir_instr *instr, void *state)
const nir_lower_image_options *options = state;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
if (options->lower_cube_size &&
intrin->intrinsic == nir_intrinsic_image_deref_size &&
nir_intrinsic_image_dim(intrin) == GLSL_SAMPLER_DIM_CUBE) {
lower_cube_size(b, intrin);
return true;
}
switch (intrin->intrinsic) {
case nir_intrinsic_image_size:
case nir_intrinsic_image_deref_size:
case nir_intrinsic_bindless_image_size:
if (options->lower_cube_size &&
nir_intrinsic_image_dim(intrin) == GLSL_SAMPLER_DIM_CUBE) {
lower_cube_size(b, intrin);
return true;
}
return false;
return false;
default:
return false;
}
}
bool