-
Notifications
You must be signed in to change notification settings - Fork 969
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
Remove the Destroyed state from Storage #4970
Conversation
0791cd6
to
3c1c78e
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.
We were previously marking the resources as destroyed immediately after the destroy fn was called and subsequent attempts at getting the resources would fail.
We are now manually checking if the hal resource was destroyed which won't be the case until later. It also looks like we don't check this after every {textures,buffers}.get(id)
anymore.
It seemed that Element::Destroyed
and Element::Error
were both equivalent with the invalid flag in the spec and we haven't yet fully moved invalidity inside objects.
There are a lot of places where the check is now happening by getting an I personally preferred the way the registry was providing this check transparently, but since our plan is to get rid of the registry altogether, doing the checks manually is the the way forward. Moving the |
I see. I think that removing I'm not very well-versed in this area of the code, I'll let someone else also chime in. |
What do you envision for proper object validation? Is it some missing |
I think we'll need a system to do it in a more generic way since almost all API calls check for validity (and almost all objects can be invalid). https://gpuweb.github.io/gpuweb/#abstract-opdef-valid-to-use-with
|
Yep. Probably something like that, or something along the lines of |
Ci is stuck because github had a cold the other day but this is ready to land. |
It probably needs a rebase since it's waiting for "Test Mac aarch64" which was recently added. |
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.
Minor comment - take or leave, g2g after.
It used to be how we handled destroying buffers and textures but we moved to different approach.
This used to be checked automatically when getting the resource from the registry, but has to be done manually now that we track we track the destroyed state in the resources.
Connections
Depends on #4896
Description
Removes the logic to express destroyed resources in the registry, since we have moved to handling it in the resources themselves.
Checklist
cargo fmt
.cargo clippy
.cargo xtask test
to run tests.