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
VideoCommon: fix uint shader compiler error when using d3d #10836
Conversation
|
I'm a bit confused why the same initialization isn't done with |
@Pokechu22 - actually, I think it should be. I believe before we didn't need it because d3d was either
See this comment: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/PixelShaderGen.cpp#L1808
I can't find it now but I recall seeing a comment related to that idea. -- And just in general, as I've been reviewing @TellowKrinkle 's code, I've noticed our pixel shader has a lot of holes. Places where it should be this or that but we instead we do if this and if that. |
|
dolphin/Source/Core/VideoCommon/PixelShaderGen.cpp Lines 311 to 320 in fa30ba1
IMO it'd be clearer to remove the extra D3D since if |
|
It looks like UberShaderPixel still has a case of |
|
@Pokechu22 - good catch. Sorry, I tend to focus on the specialized shaders. I'll fix that too |
…his error is in renderers that use uint for their color output (for logic ops). Remove D3D check for uint output since other backends could use uint output as well.
…color output that has been defined as uints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a bit confused about ocol1, as it's initialized in 2 places and one is always float4:
dolphin/Source/Core/VideoCommon/PixelShaderGen.cpp
Lines 848 to 854 in 7b2b559
| if (!uid_data->no_dual_src) | |
| { | |
| out.Write("{} out {} ocol1;\n", | |
| has_broken_decoration ? "FRAGMENT_OUTPUT_LOCATION(1)" : | |
| "FRAGMENT_OUTPUT_LOCATION_INDEXED(0, 1)", | |
| uid_data->uint_output ? "uvec4" : "vec4"); | |
| } |
dolphin/Source/Core/VideoCommon/PixelShaderGen.cpp
Lines 917 to 920 in 7b2b559
| if (uid_data->blend_enable) | |
| { | |
| out.Write("\tfloat4 ocol1;\n"); | |
| } |
and WriteColor always uses float4 for ocol1, but uid_data->uint_output doesn't ever write ocol1. This is probably something to handle in a separate PR, though. For now, this looks good to me.
|
@Pokechu22 - agreed. I think there are some scenarios to resolve (some of these seem like they aren't hittable, which if so, means the code should be written to reflect that) but I was just aiming to fix the bug in this PR. Appreciate the review! |
Since ocol1 is used for blending, while uint_output is used for logic ops, they should never both be enabled at once Maybe put in an assertion for that? |
When doing some testing on a separate PR, I noticed that the NES Legend of Zelda (on the Gamecube Collector's Edition) would give a shader compiler error when using D3D.
The compiler error was:
This PR fixes that error.