-
Notifications
You must be signed in to change notification settings - Fork 718
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
[ SPIR-V ] NonSemantic.Shader.DebugInfo.100 DebugDeclare: expected operand Variable must be a result id of OpVariable or OpFunctionParameter #5191
Comments
I've done some investigating and it appears to be coming from the exhaustive inlining pass. |
I've stumbled upon this problem myself recently, after investigation it appears to be a problem in |
I'm working on fix to the optimizer to convert access chain function call arguments to temporary OpVariables so the inlining pass can handle DebubDeclare correctly. |
After discussing with @s-perron and @greg-lunarg, I believe the work that @llvm-beanz is doing will completely avoid this problem and it is the ideal way to fix this issue. |
It will avoid it until we add reference to the language. We can wait until references are implemented to fix it. Otherwise we won't be able to test the fix. |
As far as I see it, this problem still persists. I stumbled over it recently as well. In case you need a simple reproducer, see here: https://godbolt.org/z/nYeW4KrbE Compile
with options Actual Behavior
|
Issue is still there. I got it in MANY different places, but this is my easiest reproduce: |
DXC tries to avoid the copy-in-copy-out for some parameters when it thinks it is possible. However, the SPIR-V spec says that if a parameter is a pointer, it must point to a memory object declarion or a pointer to an element in a sampler or image array. This PR enforces this. If the pointer for the parameter is not an OpVariable (a memory object declaration), then we do not elide the copy-in copy-out. Fixes microsoft#7095 Fixes microsoft#5191
I have a PR that should fix some of the cases. Let me know if there are other. |
@s-perron #7127 Fixed some cases, but, for example, this will still fail: struct SomeStruct
{
float a;
float getA(){ return a; }
};
cbuffer ConstBuffer {
SomeStruct str;
}
[numthreads(1, 1, 1)]
void computeMain()
{
float a = str.getA();
}
|
@kp-eagle btw the Godbolt instance still says |
I didn't test it in Godbolt. Link is just for convenience. I built it locally with merged commit. So, if you think that it actually works after it - no, it doesn't =) |
I see, I'm still waiting on Godbolt to see if my other stuff breaks because of |
We encountered the following error with one of our shaders when using
-fspv-debug=vulkan-with-source
to debug the shader in RenderDoc:@jeremy-lunarg helped strip it down to a test case we could share (attached). You can reproduce the error with this shader and the following command-line:
shaderdebug_simple.zip
The text was updated successfully, but these errors were encountered: