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

nv2a: Implement SET_SHADE_MODEL #1086

Merged

Conversation

abaire
Copy link
Contributor

@abaire abaire commented Jun 22, 2022

Fixes #692
Fixes #912

Unfortunately this involves some non-trivial & ugly changes due to the fact that GL doesn't allow type qualifiers inside of structs, coupled with the fact that on the nv2a the shade model is only applied to a subset of the attributes.

Test
HW results

@abaire
Copy link
Contributor Author

abaire commented Jun 22, 2022

Draft due to dependence on fix for #912 (the xemu results depart from HW for all of the complex primitives due to the geometry shader expansion). Might be worth merging and doing the geometry shader fix as a followup since it'll add some complexity (I guess it'll need to duplicate the flat shaded attributes across all generated provoking vertices to simulate a single primitive)

UPDATE: I'm wrong, even the basic triangles are using the wrong values, so there's something interesting about what the hardware considers the provoking vertex for flat shading (looks like it uses the first vertex in the primitive instead of the last).

@abaire abaire force-pushed the fix/692/implements_set_shade_model branch 8 times, most recently from ed436f8 to 3eacd81 Compare June 23, 2022 04:59
@abaire abaire marked this pull request as ready for review June 23, 2022 04:59
@abaire
Copy link
Contributor Author

abaire commented Jun 23, 2022

Adjusted the geometry shaders such that the provoking vertex matches hardware. Apart from the usual (practically invisible) differences in blending between my GTX1070 and Xbox 1.0, the output with this PR matches the hardware results, so this is ready for review. #912 is also fixed in this PR due to the change I made to the fixed orientation of the triangles when generating quads (they now match hardware).

@mborgerson mborgerson force-pushed the fix/692/implements_set_shade_model branch from 3eacd81 to 2bdf2f3 Compare June 26, 2022 02:53
@mborgerson
Copy link
Member

Thanks! Rebased and fixed merge conflicts

@mborgerson mborgerson merged commit 4132845 into xemu-project:master Jun 26, 2022
@abaire abaire deleted the fix/692/implements_set_shade_model branch June 26, 2022 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants