diff --git a/.pick_status.json b/.pick_status.json index 707e7f966a2..c5b9dba8260 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -924,7 +924,7 @@ "description": "radv: Fix shader replay allocation condition", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index a0ce999f8d5..7303685e5a6 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -1344,14 +1344,14 @@ radv_replay_shader_arena_block(struct radv_device *device, const struct radv_ser if (!hole->freelist.prev) continue; - if (hole->offset + hole->size < src->offset) - continue; - uint32_t hole_begin = hole->offset; uint32_t hole_end = hole->offset + hole->size; + if (hole_end < block_end) + continue; + /* If another allocated block overlaps the current replay block, allocation is impossible */ - if (block_begin > hole_begin || (hole_end < block_end && hole_end >= block_begin)) + if (hole_begin > block_begin) return NULL; union radv_shader_arena_block *block = insert_block(device, hole, block_begin - hole_begin, src->size, NULL);