KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
739 stars 398 forks source link

Mixing LunarG SDK with latest Validation Layers? #478

Closed remoe closed 5 years ago

remoe commented 5 years ago

Is it possible to use latest LunarG-SDK (for example: 1.1.85) and use the latest master of Vulkan-ValidationLayers (1.1.91)? I mean copy all libraries to a path where all binaries are located and set the "VK_LAYER_PATH" environment to this path.

I've tried this, but then i have this error:

SPIR-V module not valid: In the Vulkan environment, the OriginLowerLeft execution mode must not be used.

I don't have this issue with original 1.1.85 SDK.

So it's not correct to do this?

remoe commented 5 years ago

Now, the 1.1.92 is released and i can get this now ;) But it is still interesting to know if one can get a newer Validation Layers library with a released SDK.

karl-lunarg commented 5 years ago

Yes, you can do what you want, with a couple of considerations and limitations.

If you build this repo according to the instructions in BUILD.md and your build folder is in /someplace/Vulkan-ValidationLayers/build, then you can set VK_LAYER_PATH to include /someplace/Vulkan-ValidationLayers/build/layers.

Note that this is the place where the loader looks for the JSON files that describe the layers. But this repo builds the layers and JSON files in such a way that the JSON files are placed into the build/layers directory and are configured to locate the libraries in the same place.

Another consideration is that the layers do use spirv-tools libraries to perform shader validation. You need to make sure that you use the correct spirv-tools libraries when building the layers. This dependency is covered pretty well in BUILD.md.

The SPIR-V message you got may also have been caused by using an older glslang compiler (glslangValidator) from the older SDK. It may have been updated for the newer SDK to go along with the new validation check related to the message you encountered. TBH, I didn't look to see if this is actually what happened, but in the general case, it is best to use the shader compiler that matches the validation code, and that means using consistent versions of glslang and spirv-tools for the compiler and layers. It is likely that you used the shader compiler from the older SDK and didn't "pick up" the new shader compiler that you probably built when you built the new layers. If you followed BUILD.md, you should have also built a new glslangValidator which may have compiled a shader that wouldn't cause that message.

I'm going to go ahead and close this because I think it answers your question. Please feel free to follow up with more questions, if needed.