Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22793>
nir_lower_non_uniform_ssbo_access = (1 << 1),
nir_lower_non_uniform_texture_access = (1 << 2),
nir_lower_non_uniform_image_access = (1 << 3),
+ nir_lower_non_uniform_get_ssbo_size = (1 << 4),
};
/* Given the nir_src used for the resource, return the channels which might be non-uniform. */
progress = true;
break;
+ case nir_intrinsic_get_ssbo_size:
+ if ((options->types & nir_lower_non_uniform_get_ssbo_size) &&
+ lower_non_uniform_access_intrin(options, &b, intrin, 0))
+ progress = true;
+ break;
+
case nir_intrinsic_image_load:
case nir_intrinsic_image_sparse_load:
case nir_intrinsic_image_store:
if ((types & nir_lower_non_uniform_image_access) &&
has_non_uniform_access_intrin(intrin))
return true;
+ } else if (intrin->intrinsic == nir_intrinsic_get_ssbo_size) {
+ if ((types & nir_lower_non_uniform_get_ssbo_size) &&
+ has_non_uniform_access_intrin(intrin))
+ return true;
} else {
/* Nothing to do */
}