-
Notifications
You must be signed in to change notification settings - Fork 566
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
Issue with EliminateDeadOutputStores when reading from out variable #5516
Comments
Sorry to ping this, it's affecting a lot of my users due to this being a common writing workflow in shaders it seems. |
With the recent paper highlighting this workflow, I'd again like to ping this one |
Hi Malcolm,
Very sorry about missing this. I am semi-retired and not doing as good a
job at monitoring email, issues, etc.
I will make sure someone starts working on this.
Best regards,
Greg
Greg Fischer
Senior Engineer
LunarG, Inc. - 3D Driver Innovations
***@***.*** ***@***.***>
…On Mon, Apr 1, 2024 at 1:59 PM Malcolm Bechard ***@***.***> wrote:
With the recent paper highlighting this workflow, I'd again like to ping
this one
—
Reply to this email directly, view it on GitHub
<#5516 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZPVK672XVP2QGF46VXJLDY3G4BRAVCNFSM6AAAAABBKPFLBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZQGQ3DANBYGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@mbechard Sorry. This fell through the cracks. I'll start looking at this tomorrow. |
This looks like it's going to be non-trivial. I think |
Thanks. right so more specifically this occurs if 'pos' is not consumed by the pixel shader, and thus it tries to be eliminated from the vertex shader during the call to SpirvToolsEliminateDeadOutputStores(), which causes this issue. Ideally if the pass is trying to eliminate an output variable that is being used for a store-load, it should be converted to a temporary variable. Leaving it as-is would work for standalone outputs, but would cause an interface mismatch if the output is part of a block, where it's been eliminated from the block in the pixel but getting left as-is in the vertex |
Fix KhronosGroup#5516 Pass: eliminate dead output stores Stores to write-only output variables are safe to eliminate; however, stores to read-write output variables may be required for functional correctness. If a read-write output variable is detected, then it will be demoted to a private variable and any associated stores will not be eliminated.
Hey, wanted to ping this one again. It's a pretty commonly used workflow in GLSL, and a large problem that it's failing here. Any chance this can be finished off? |
Hey,
If I have a GLSL shader that is reading from an 'out' variable such as
And then I run the resulting SPIRV through the EliminateDeadOutputStores() pass, I get an assert saying 'unexpected use of output variable'.
This should be legal code since "During shader execution they will behave as normal unqualified global variables" as per the GLSL spec.
@jeremy-lunarg can you take a look since you took over maintenance of this feature?
Thanks!
Malcolm
The text was updated successfully, but these errors were encountered: