0

I have 2 framebuffers. First, one is layered. And renders HDR image to Cubemap. In this Renderpass Geometry Shader is used.

Debug layer gives me the following error message.

[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)

I searched for SPIR-V geometry shader requirements but I couldn't find what I am missing. My Geometry shader code is

#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();
} 
aramok
  • 35
  • 1
  • 1
  • 6
  • 1
    The SPIR-V specification outlines [what the capabilities are](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_capability_a_capability). What are the features that you've activated in your Vulkan device? Your question isn't about SPIR-V; your GLSL-to-SPIR-V compiler is the one that outputs the SPIR-V capabilities; what you need to do is provide the matching Vulkan *features*. – Nicol Bolas Apr 17 '21 at 15:52
  • 1
    I simply enabled geometry shader. `VkPhysicalDeviceFeatures deviceFeatures{};` `deviceFeatures.geometryShader = VK_TRUE;` it seems ok for now. Thank you – aramok Apr 17 '21 at 16:36

0 Answers0