KhronosGroup / Vulkan-LoaderAndValidationLayers

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

Validation layers don't check SPIR-V version in vkCreateShaderModule #2419

Open baldurk opened 6 years ago

baldurk commented 6 years ago

Uploading a SPIR-V module with version 1.1 or higher is not currently legal in Vulkan as far as I know (only 1.0 is supported), but the validation layers don't verify this and won't complain unless there's something else wrong with the SPIR-V.

mark-lunarg commented 6 years ago

@baldurk, can you point to a reference? The spec says "A Vulkan 1.0 implementation must support the 1.0 version of SPIR-V and the 1.0 version of the SPIR-V Extended Instructions for GLSL.", which would seem to leave the door open for newer versions. Is it that the 1.1 and 1.2 SPIR-V features are OpenCL-only or something like that?

sheredom commented 6 years ago

The point in the spec where we mandate SPIR-V 1.0 (https://github.com/KhronosGroup/Vulkan-Docs/blob/1.0/doc/specs/vulkan/appendices/spirvenv.txt#L17) was meant to mean 'Only the versions listed here are supported.'

I agree with @baldurk that it'd be a useful validation layer error if the Vulkan 1.0 API was passed a SPIR-V binary that had a version > 1.0!

mark-lunarg commented 6 years ago

@sheredom, @baldurk, thank you very much. It's on the list.