v3dv: Implement robust_image_access_2 flag

This flag is used to implement robustImageAccess2.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39430>
This commit is contained in:
Daivik Bhatia 2026-01-25 06:53:08 +05:30 committed by Marge Bot
parent 33092de196
commit bd3e836046
3 changed files with 8 additions and 2 deletions

View file

@ -416,6 +416,7 @@ struct v3d_key {
bool robust_uniform_access;
bool robust_storage_access;
bool robust_image_access;
bool robust_image_access_2;
};
struct v3d_fs_key {

View file

@ -1791,7 +1791,7 @@ should_lower_robustness(const nir_intrinsic_instr *intr, const void *data)
case nir_intrinsic_image_store:
case nir_intrinsic_image_atomic:
case nir_intrinsic_image_atomic_swap:
return key->robust_image_access;
return key->robust_image_access || key->robust_image_access_2;
default:
return false;
@ -1877,7 +1877,7 @@ v3d_attempt_compile(struct v3d_compile *c)
NIR_PASS(_, c->s, nir_lower_alu);
if (c->key->robust_uniform_access || c->key->robust_storage_access ||
c->key->robust_image_access) {
c->key->robust_image_access || c->key->robust_image_access_2) {
/* nir_lower_robust_access assumes constant buffer
* indices on ubo/ssbo intrinsics so run copy propagation and
* constant folding passes before we run the lowering to warrant

View file

@ -1027,6 +1027,9 @@ pipeline_populate_v3d_key(struct v3d_key *key,
const VkPipelineRobustnessBufferBehaviorEXT robust_buffer_enabled =
VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT;
const VkPipelineRobustnessImageBehaviorEXT robust_image2_enabled =
VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT;
const VkPipelineRobustnessImageBehaviorEXT robust_image_enabled =
VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT;
@ -1036,6 +1039,8 @@ pipeline_populate_v3d_key(struct v3d_key *key,
p_stage->robustness.storage_buffers == robust_buffer_enabled;
key->robust_image_access =
p_stage->robustness.images == robust_image_enabled;
key->robust_image_access_2 =
p_stage->robustness.images == robust_image2_enabled;
}
uint32_t