KhronosGroup / Vulkan-LoaderAndValidationLayers

**Deprecated repository** for Vulkan loader and validation layers
Apache License 2.0
414 stars 172 forks source link

ShaderValidation: may has incorrect check for read only buffers #2546

Closed TiemoJung closed 6 years ago

TiemoJung commented 6 years ago

Hi,

we are getting this error:

Error: (objectType=0, object=0x0, location=0, errorCode=15) Validation: Object: VK_NULL_HANDLE (Type = 0) | Shader requires VkPhysicalDeviceFeatures::vertexPipelineStoresAndAtomics but is not enabled on the device

Our baseline is DX11 HLSL 5 - it has only support for UAV resources in pixel and compute shaders. We translate the HLSL into GLSL and let glslang do the transformation to Spir-V. We validated the GLSL and it only correctly emits storage objects as readonly for vertex shaders. So we where surprised to see this error.

Here is an example: spir-v dissaembly source glsl

The resource binding slots/sets are different as they are rearranged in the glslang ioremap phase to compact the descriptor sets.

mark-lunarg commented 6 years ago

@chrisforbes, would you be willing/able to triage this one?

chrisforbes commented 6 years ago

Issue here is decoration at the member rather than block level. SC currently only understands the NonWritable decoration at the block level. I'll fix this.

chrisforbes commented 6 years ago

Closing as duplicate of #2526.

chrisforbes commented 6 years ago

@mark-lunarg I've got a plan for fixing this now, but have my hands full with another project. How urgent is fixing this?

mark-lunarg commented 6 years ago

@chrisforbes, thanks for asking! I think if you moved it towards the head of your validation list that'd be fine for the time being. If the priority spikes, we can try to work it from the LunarG-end, which we're happy to do, but that would still require some of your time.