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] Clear pLockedRect/Box contents universally on lock #4543

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

Conversation

WinterSnowfall
Copy link
Contributor

@WinterSnowfall WinterSnowfall commented Dec 22, 2024

Based on a test that I wrote and ran on Windows XP it looks like:

  • d3d9 behaves similarly to d3d8 during LockRect/Box
  • LockRect doesn't discriminate based on RTYPE and textures also get their pLockedRect contents cleared

So the Wine tests were partially incorrect for d3d8 and incomplete for d3d9 (the Wine test in question was d3d8 specific, in all fairness).

I'm waiting for @Blisto91 to confirm modern native behavior, and in the meantime I will do some general testing. Not that I expect anything to blow up due to this minor nit, but you never know.

Edit: All the above is confirmed on modern AMD and Intel Windows drivers.

@WinterSnowfall
Copy link
Contributor Author

WinterSnowfall commented Dec 22, 2024

As tradition dictates, it appears the Wine d3d8 test was ultimately correct, and D3DRTYPE_TEXTURE surfaces don't get cleared... outside of D3DPOOL_DEFAULT. This API...

The behavior is however consistent between d3d8 and d3d9, that much still holds.

@WinterSnowfall WinterSnowfall marked this pull request as ready for review December 23, 2024 00:03
@WinterSnowfall
Copy link
Contributor Author

WinterSnowfall commented Dec 23, 2024

Sigh... in the true spirit of d3d9, turns out there is a difference on LockRect. Anyway, it's all good now.

P.S.: @Blisto91 just confirmed the d3d9 test passes on Windows, so this seems fully inline with native now (famous last words).

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.

1 participant