gamescope
gamescope copied to clipboard
CVulkanCmdBuffer::dispatch(): VU fix + layout tweak
Fix VUID-VkWriteDescriptorSet-descriptorType-09506 found by VVL (vkUpdateDescriptorSets(): pDescriptorWrites[4].pImageInfo[<num>].imageView is VK_NULL_HANDLE. The Vulkan spec states: If descriptorType is VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, dstSet was allocated with a layout that included immutable samplers for dstBinding, and those samplers enable sampler Y'CBCR conversion, then imageView must not be VK_NULL_HANDLE
)
Switch {imageDescriptors[i],ycbcrImageDescriptors[i]}.imageLayout
to VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
, since the shaders only read from those two descriptors.
Not sure if the layout change makes much of a difference normally.
However, when compiling gamescope w/ the color management shader code commented out, it seemed like the switch to the read only layout slightly increased the peak gpu utilization reported by intel_gpu_top
(probably due to higher cache hits).