-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I query vertex attributes that are not used in shader? #2280
Comments
It should contain that. Which API did you use? Compiler::get_shader_resources() should return all variables that are part of the entry point. Remember that unused vertex inputs may be stripped away by your GLSL or HLSL compiler, which makes it impossible for spirv-cross to know about missing inputs. Do you have an example SPIR-V? |
I use Vulkan and C++, compile with shaderc with generate debug info. I link Spirv-cross and shaderc libraries from VulkanSDK. Shader example looks like this:
ShaderResources::stage_inputs contains only a_Position, but spirv byte code actually contains all inputs. |
How do you invoke the SPIRV-Cross API? I'm getting the inputs just fine here in both --reflect and --dump-resources. Also, do you have the exact SPIR-V you're using?
|
My code looks like this:
Sorry, but I dont understand what the SPIR-V do you want. Like actual byte code I get after compilation? I opened it in text editor, some of the symbols is not ASCII and there also was whole copy of my shader. I am compiling with shaderc library from latest VulkanSDK. |
Why spirv_cross::ShaderResources::stage_inputs does not contain inputs that do not used by shader(vertex stage)? I think it is important information to calculate offsets of each attribute and stride for whole vertex. Is there a way to get this information?
The text was updated successfully, but these errors were encountered: