Don't access sampler handles for sampled image descriptors
The Vulkan 1.1 spec states that:
"For VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, only the imageView and
imageLayout members of each element of VkWriteDescriptorSet::pImageInfo
are accessed."
Also remove the zeroing of sampler descriptor data in
SampledImageDescriptor when no sampler handle is provided. This was
intended to detect bugs but we didn't do it consistently for all
descriptor types (VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER also uses
SampledImageDescriptor and has no sampler data). We now pass a null
pointer to the sampling routine when no sampler descriptor is available
(specifically for OpImageFetch) so it is less likely to still access it
unintentionally.
Bug: b/139401791
Change-Id: Id1394493e88b7465fe3628c4c7d410cd3eaa3ccf
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35388
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Reviewed-by:
Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Showing
Please
register
or
sign in
to comment