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

Handling of final combiner flags is silently unimplemented #765

Closed
abaire opened this issue Mar 12, 2022 · 1 comment · Fixed by #770
Closed

Handling of final combiner flags is silently unimplemented #765

abaire opened this issue Mar 12, 2022 · 1 comment · Fixed by #770
Labels
bug Something isn't working

Comments

@abaire
Copy link
Contributor

abaire commented Mar 12, 2022

Bug Description

While investigating the shimmer effect in #270 I noticed that Ninja Gaiden Black sets the PS_FINALCOMBINERSETTING_CLAMP_SUM flag in the bugged render pass (it doesn't seem to actually use the V1R0 sum so I don't think it's directly causing the issue here).

Looking at the pixel shader generator code, I see that the flags are set, but they don't seem to actually be applied anywhere (there are no references to any of those flags other than this initial assignment in psh_translate:

        ps.final_input.clamp_sum = flags & PS_FINALCOMBINERSETTING_CLAMP_SUM;
        ps.final_input.inv_v1 = flags & PS_FINALCOMBINERSETTING_COMPLEMENT_V1;
        ps.final_input.inv_r0 = flags & PS_FINALCOMBINERSETTING_COMPLEMENT_R0;

Expected Behavior

The flags should be implemented to match HW behavior.

Ninja Gaiden Black does make use of the PS_REGISTER_V1R0_SUM register for several other draws in that same frame (which was captured when entering the magma caverns in chapter 12).

The clamp flag also set during the bootup sequence, though I didn't capture the pgraph logs to see if the sum register is actually used in the pixel shader.

xemu Version

My near head development version (I'm confident that I have made no changes that would've removed acting on the flags)

Version: 0.6.2-109-ga16eea7d86
Branch: work
Commit: a16eea7
Date: Sat Mar 12 06:38:59 AM UTC 2022

System Information

"cpu": "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz",
"gl_renderer": "NVIDIA GeForce GTX 1070/PCIe/SSE2",
"gl_shading_language_version": "4.00 NVIDIA via Cg compiler",
"gl_vendor": "NVIDIA Corporation",
"gl_version": "4.0.0 NVIDIA 470.103.01",
"os_platform": "Linux",
"os_version": "Ubuntu 21.10",

Additional Context

No response

@abaire abaire added the bug Something isn't working label Mar 12, 2022
@RageXbox
Copy link
Contributor

This may be the reason why #580 has this problem. Pull request #720 partially fixes boot animation lighting but still not Halo 2 battle rifle shines.
Master:
Screenshot 2022-03-12 005802

PR:
Screenshot 2022-03-12 010818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants