Skip to content

[d3d9] Handling more state-related setters/getters #5153

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

Merged
merged 4 commits into from
Aug 18, 2025

Conversation

WinterSnowfall
Copy link
Contributor

@WinterSnowfall WinterSnowfall commented Aug 16, 2025

Apparently there are a few games (mostly d3d8) that use Set/GetPaletteEntries and Set/GetCurrentTexturePalette, although, strangely, they do not employ any paletted textures whatsoever...

SetNPatchMode calls are also somewhat common, even though the games do not make use of n patches. It might be the games explicitly disabling it (probably in most cases with few calls), however there are some doing thousands/hundred of thousands of calls 🐸...

GetGPUThreadPriority has no known users, but I've returned 0 for good measure since we D3D_OK it, so it would expect something.

Drafting until I do a bit more testing and investigate potential corner cases around palettes.

@Blisto91 Blisto91 added the d3d9 label Aug 16, 2025
@WinterSnowfall WinterSnowfall force-pushed the d3d9-state branch 3 times, most recently from c54a5a2 to 407e17e Compare August 17, 2025 09:29
@WinterSnowfall WinterSnowfall marked this pull request as ready for review August 17, 2025 11:17
@WinterSnowfall
Copy link
Contributor Author

WinterSnowfall commented Aug 17, 2025

Should be good to go. The texture palette setters & getters seem to work just fine on XP, even with cards/driver that don't support P8, although they won't do anything useful in that case, of course (and yes, some games still call them, because why not).

I've also piped in D3DRS_PATCHSEGMENTS from D3D8 into Set/GetNPatchMode. Of course there's no documentation around it, but since D3DRS_PATCHSEGMENTS is missing in D3D9, if we ever do get around to adding support for "TruForm", I'm guessing that's needed to get things working properly anyway, since values > 1.0f are what enable n-patches tessellation in both D3D8 and D3D9.

@K0bin K0bin merged commit 46488ce into doitsujin:master Aug 18, 2025
4 checks passed
@WinterSnowfall WinterSnowfall deleted the d3d9-state branch August 18, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants