我有 2 个帧缓冲区。首先,一个是分层的。并将 HDR 图像渲染到 Cubemap。在此 Renderpass 几何着色器中使用。
调试层给了我以下错误信息。
[VAL][VUID-VkShaderModuleCreateInfo-pCode-01091] Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-01091 ]
Object 0: handle = 0x14f9a58bfe8, type = VK_OBJECT_TYPE_DEVICE;
| MessageID = 0xa7bb8db6 | vkCreateShaderModule(): The SPIR-V Capability (Geometry) was declared, but none of the requirements were met to use it.
The Vulkan spec states: If pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://vulkan.lunarg.com/doc/view/1.2.170.0/windows/1.2-extensions/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01091)
我搜索了 SPIR-V 几何着色器要求,但找不到我所缺少的。我的几何着色器代码是
#version 450 core
layout(triangles, invocations = 6) in;
layout(triangle_strip, max_vertices = 3) out;
void main()
{
for(int i = 0; i < 3; i++)
{
gl_Layer = gl_InvocationID ;
gl_Position = gl_in[i].gl_Position + vec4(vec3(gl_InvocationID)/5 , 1);
EmitVertex();
}
EndPrimitive();
}