How do I turn on the geometry shader? #1517
-
I set an empty geometry shader and crash when call viewer->compile |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
When you say empty geometry shader it's too open ended to know exactly what you've done, but clearly something in setting up the shader modules associated with the shaders. In general if you don't need to use a shader stage you simply don't assign it. Often it's useful to see correct code to compare against. A quick search of vsgExamples shoes the vsgcompilemanager test enabled geometryShader: grep -r geometryShader .
./tests/vsgcompilemanager/vsgcompilemanager.cpp: requestFeatures->get().geometryShader = VK_TRUE; // for gl_PrimitiveID I didn't write this test so can't say exactly what it does off the top of my head. The test runs just fine on my Kubuntu 24.04 + Geforce 2060. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Could you check whether your VSG version has shader compilation support enabled? This requires the VSG to be compiled with compile with glslang. You can check whether shader compilation is supported via the CMake var VSG_SUPPORTS_ShaderCompiler or the include/vsg/core/Version.h VSG_SUPPORTS_ShaderCompiler define. |
Beta Was this translation helpful? Give feedback.
-
I don't have any other ideas what is going wrong on your system at this point, so it'll have to be a case of just turning over stone by stone till you find what is wrong. Broadly it looks to be an issue with getting all the required shader modules compiled from source into SPIRV and then passed on to the creation of the VkShaderModuleCreateInfo, so putting debugging code or breakpoints into the src/vsg/state/ShaderModule.cpp and src/vsg/utils/ShaderCompiler.cpp might help illuminate when the null is being introduced. The vsg::ShaderCompiler also has a debug messages that you will not see at level notification level by if you up the notification level to DEBUG you'll see them: vsg::Logger::instance()->level = vsg::Logger::LOGGER_DEBUG; This might illuminate what might be going on. Helping debug this type of thing remote is really hard, what would help others like myself would be an example program that reproduces the problem. What can work well is programmers creating a small example program that can go in vsgExamples that doesn't yet work on their system, share that then others can figure out what is wrong, fix it, then the whole community will have an example program that illustrates a feature and it can also be used as a form of unit test to make sure that feature still works as intended. |
Beta Was this translation helpful? Give feedback.
I don't have any other ideas what is going wrong on your system at this point, so it'll have to be a case of just turning over stone by stone till you find what is wrong.
Broadly it looks to be an issue with getting all the required shader modules compiled from source into SPIRV and then passed on to the creation of the VkShaderModuleCreateInfo, so putting debugging code or breakpoints into the src/vsg/state/ShaderModule.cpp and src/vsg/utils/ShaderCompiler.cpp might help illuminate when the null is being introduced.
The vsg::ShaderCompiler also has a debug messages that you will not see at level notification level by if you up the notification level to DEBUG you'll see them:
vsg::Logger:…