简体   繁体   中英

Vulkan: Invalid Shader Module Object

I've written a small Vulkan test app to familiarize myself Vulkan though I've run into an issue trying to create a pipeline.

vkCreateGraphicsPipeline causes the Validation Layer to produce the following errors: Invalid Shader Module Object 0x8 Invalid Shader Module Object 0x9

And then it the program crashes within the validation layer. I had created a VkShaderModule for the vertex shader and fragment shader and used glslangvalidator -V to convert them to SPIR-V modules which vkCreateShaderModule didn't complain about.

Is there anything I may've missed? The examples seem to be doing things exactly the same way I am.

The error message and the layer crash behavior points to an invalid Vulkan object handle (eg object unsuccessfuly vkCreate* d or vkDestroy ed before use) as detected by the VK_LAYER_LUNARG_object_tracker validation layer.

Validation layers should probably not crash if they are all enabled and that in the prescribed order. That can be ensured by using only VK_LAYER_LUNARG_standard_validation meta-layer.

As in any good validator, error messages are completely unreadable by puny humans.
Standard validation layers are open-sourced in GitHub/KhronosGroup/Vulkan-LoaderAndValidationLayers/layers , so if in doubt it can be searched for the given message text. Usually it is in core_validation.cpp but in your case it would be object_tracker.cpp . (The message would be in printf format eg "Invalid %s Object 0x%" making it bit harder to search for).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM