-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Create use-after-free detector for Metal textures #7250
Conversation
5a7dfac
to
943655f
Compare
metalTexture->terminate(); | ||
|
||
// Delay the destruction of this texture handle. | ||
if (mContext->texturesToDestroy.full()) { |
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.
if (mContext->texturesToDestroy.full()) { | |
if (UTILS_LIKELY(mContext->texturesToDestroy.full())) { |
metalTexture->terminate(); | ||
|
||
if (auto handleToFree = mContext->texturesToDestroy.push(th)) { | ||
// Delay the destruction of this texture handle. |
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.
this comment confuses me a little shouldn't it be "delayed destruction of a previously destroyed handle" or something to that effect?
@@ -854,22 +870,26 @@ | |||
assert_invariant(sb->size == data.size / sizeof(SamplerDescriptor)); | |||
auto const* const samplers = (SamplerDescriptor const*) data.buffer; | |||
|
|||
#ifndef NDEBUG | |||
// In debug builds, verify that all the textures in the sampler group are still alive. | |||
// Verify that all the textures in the sampler group are still alive. |
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.
unfortunate that this whole loop is technically not needed.
No description provided.