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

[d3d8/9] Proper (and age accurate) handling of d3d9.shaderModel = 0 #4629

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WinterSnowfall
Copy link
Contributor

@WinterSnowfall WinterSnowfall commented Jan 20, 2025

Fixes #4625 and follows up on an idea I've had in the d8vk days, see AlpyneDreams#208.

Extends D3D7-compatible FF only caps (aka disabling programmable shader support) to D3D8 when using d3d9.shaderModel = 0, and also validates shader versions on creation in D3D9.

Useful for debugging and for nostalgia reasons (with games that do handle such situations properly).

@WinterSnowfall WinterSnowfall force-pushed the shadermodel0 branch 4 times, most recently from e300bfb to db884c1 Compare January 21, 2025 15:00
@WinterSnowfall
Copy link
Contributor Author

I wasn't expecting any revelations from testing the caps on my GeForce 4 MX 440 card, but apparently I was wrong.

Late generations of fixed-function only hardware actually advertised support for VS 1.1 (with no PS support), which makes a lot of sense actually, since games would try to use VS 1.1 anyway, even if we tried to force them to not create programmable shaders of any kind.

This PR replicates the above behavior when d3d9.shaderModel = 0 is used and also fixes some other minor SM1 derps.

@WinterSnowfall WinterSnowfall marked this pull request as ready for review January 21, 2025 15:04
@WinterSnowfall WinterSnowfall changed the title [d3d8/9] Properly disable programmable shaders with d3d9.shaderModel [d3d8/9] Proper (and age accurate) handling of d3d9.shaderModel = 0 Jan 21, 2025
src/d3d9/d3d9_device.cpp Show resolved Hide resolved
@WinterSnowfall
Copy link
Contributor Author

WinterSnowfall commented Jan 22, 2025

One more nit: turns out the MaxVS/PShaderInstructionsExecuted caps are SM2 (and above) specific and will be zero otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skybox position, scale, and orientation incorrect and variable when using d3d9.shaderModel = 0
2 participants