简体   繁体   English

Vulkan:无效的着色器模块对象

[英]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. 我编写了一个小型Vulkan测试应用程序,以使自己熟悉Vulkan,尽管在尝试创建管道时遇到了问题。

vkCreateGraphicsPipeline causes the Validation Layer to produce the following errors: Invalid Shader Module Object 0x8 Invalid Shader Module Object 0x9 vkCreateGraphicsPipeline导致验证层产生以下错误:无效的着色器模块对象0x8无效的着色器模块对象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. 我已经为顶点着色器和片段着色器创建了VkShaderModule,并使用glslangvalidator -V将其转换为vkCreateShaderModule不会抱怨的SPIR-V模块。

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. 错误消息和层崩溃行为指向由VK_LAYER_LUNARG_object_tracker验证层检测到的无效Vulkan对象句柄(例如,使用前对象vkCreate* d或vkDestroy不成功)。

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. 通过仅使用VK_LAYER_LUNARG_standard_validation元层可以确保这VK_LAYER_LUNARG_standard_validation

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. 标准验证层在GitHub / KhronosGroup / Vulkan-LoaderAndValidationLayers / layers中是开源的,因此如有疑问,可以在其中搜索给定的消息文本。 Usually it is in core_validation.cpp but in your case it would be object_tracker.cpp . 通常在core_validation.cpp但在您的情况下为object_tracker.cpp (The message would be in printf format eg "Invalid %s Object 0x%" making it bit harder to search for). (该消息将采用printf格式,例如“ Invalid%s Object 0x%”,使其很难搜索)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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