Skip to content

Fix DescriptorSetLayout Hash to look at VkSamplerCreateInfo #10560

@spencer-lunarg

Description

@spencer-lunarg

(possibility duplicate of #10098) and internal spec tracker at https://gitlab.khronos.org/vulkan/vulkan/-/issues/4415

The core issue is if you go

VkSamplerCreateInfo ci;
vkCreateSample(ci, &sampler_0);
vkCreateSample(ci, &sampler_1);

vkCreatePipelineLayout(pImmutableSamplers = sampler_0, &pipe_layout_0);
vkCreatePipelineLayout(pImmutableSamplers = sampler_1, &pipe_layout_1);

vkCmdBindPipeline(pipeline); // layout_0
vkCmdBindDescriptorSets(pipe_layout_1);
vkCmdDraw();

you will hit VUID-vkCmdDraw-None-08600 but that is wrong

The reason for this is because the vvl::DescriptorSetLayoutDef::hash() doesn't account for the contents of pImmutableSamplers. For 2 VkSampler to be "identically defined" (Compatible) the VkSamplerCreateInfo must match

I have some tests (--gtest_filter=*ImmutableSamplerIdenticallyDefined*) that can be used to test the expected output (https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/10548/files)

We have a CompareSamplerCreateInfo that can be made use

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions