Skip to content
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

ShaderReflection constructor fails when using copy = true #11

Closed
danginsburg opened this issue Oct 10, 2017 · 1 comment
Closed

ShaderReflection constructor fails when using copy = true #11

danginsburg opened this issue Oct 10, 2017 · 1 comment

Comments

@danginsburg
Copy link
Contributor

danginsburg commented Oct 10, 2017

I hit a bug when using the C++ ShaderReflection() constructor where setting the bool copy to true:

https://github.com/chaoticbob/SPIRV-Reflect/blob/d6c8ac8d25fdaa5fff532cad9bd977f33a1e372e/spirv_reflect.h#L381

The problem is that m_result is set to SPV_REFLECT_RESULT_NOT_READY on entry to the constructor so then it never actually performs the memcpy so then reflection fails.

Another minor point: my first attempt at using ShaderReflection I was getting back descriptor bindings with corrupt names. I tracked it down to the fact that my spir-v code was out of scope and I had not passed true to the copy parameter in the constructor. I think the behavior that it tries to conserve memory by pointing to the spir-v is probably a good one, but it did take me a bit to track down.

@chaoticbob
Copy link
Contributor

Thanks, Dan.

I changed the behavior to copy the incoming SPIR-V before it does anything: 9755897.

This should address the issue you ran into...and address the minor point. Let me know if it's still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants