-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Direct3D 12: Enhance management of texture data life cycle #87872
Direct3D 12: Enhance management of texture data life cycle #87872
Conversation
8ea1653
to
2f91d22
Compare
3378ebf
to
e3b4cba
Compare
e3b4cba
to
dea87ba
Compare
Needs a rebase, and a re-review. |
dea87ba
to
b4492cc
Compare
Rebased! |
b4492cc
to
f05e218
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fixing the error I mentioned above at least everything seems to still work, but the behavior regarding the excessive amount of clears likely needs to be reviewed, as the comment indicates it shouldn't happen often but it triggers often enough to go above the default limit.
5dd724d
to
4e244c6
Compare
4e244c6
to
b5f53f2
Compare
b5f53f2
to
d47021a
Compare
Approved. The new approach to clearing the textures seems a lot cleaner and also requires far less tracking that can hurt performance. |
Thanks! |
When available, graphics memory is asked not to be zero-initialized.
That brings better performance since in most cases those bytes will be overwritten anyway.
2. Texture memory initialization is tracked across the limbo, garbage and done states.- Limbo: resource just allocated, contents are dangerous unless overwritten by certain operations (like a clear), or discarded.- Garbage: the memory has been discarded (i.e., D3D12 knows it has to ignore previous contents), but it's still not guaranteed to be black, orthogonally to the non-zero-mem feature.- Done: the texture has known contents, either because it was updated with some image data or because it was cleared, worst case by this code, to black, to ensure garbage data is never used.UPDATE: Approach simplified. It turns out that texture with many many subresources would add a lot of strain.