mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
venus: Fix detection of push descriptor set
- Fix null deref. VkPipelineLayoutCreateInfo::pSetLayouts is allowed to contain VK_NULL_HANDLE. - The loop 'break' was misplaced. Fixes crash in dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_00_11_11 after VK_EXT_graphics_pipeline_library is enabled in a later patch. Fixes:91966f2eff("venus: extend lifetime of push descriptor set layout") Signed-off-by: Lina Versace <linyaa@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Dawn Han <dawnhan@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23810> (cherry picked from commit98c8d7b7cf)
This commit is contained in:
parent
b2c94821ff
commit
d93ab51421
2 changed files with 14 additions and 3 deletions
|
|
@ -1147,7 +1147,7 @@
|
|||
"description": "venus: Fix detection of push descriptor set",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "91966f2eff17cc7c95ca8a89ac40d5d211e5b407"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -126,11 +126,22 @@ vn_CreatePipelineLayout(VkDevice device,
|
|||
for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; i++) {
|
||||
struct vn_descriptor_set_layout *descriptor_set_layout =
|
||||
vn_descriptor_set_layout_from_handle(pCreateInfo->pSetLayouts[i]);
|
||||
if (descriptor_set_layout->is_push_descriptor) {
|
||||
|
||||
/* Avoid null derefs. pSetLayouts may contain VK_NULL_HANDLE.
|
||||
*
|
||||
* From the Vulkan 1.3.254 spec:
|
||||
* VUID-VkPipelineLayoutCreateInfo-pSetLayouts-parameter
|
||||
*
|
||||
* If setLayoutCount is not 0, pSetLayouts must be a valid pointer to
|
||||
* an array of setLayoutCount valid or VK_NULL_HANDLE
|
||||
* VkDescriptorSetLayout handles
|
||||
*/
|
||||
if (descriptor_set_layout &&
|
||||
descriptor_set_layout->is_push_descriptor) {
|
||||
layout->push_descriptor_set_layout =
|
||||
vn_descriptor_set_layout_ref(dev, descriptor_set_layout);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
layout->has_push_constant_ranges = pCreateInfo->pPushConstantRanges > 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue