mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-01 05:48:11 +03:00
Vulkan: Minor cleanup of mPrevUploadedMutableTexture
When texture is transit from mutable to immutable, we need to remove it from SharedGroupVk::mPrevUploadedMutableTexture if it is pointing to. Right now we did not clear the pointer, but rely on next texImage call to detect that mPrevUploadedMutableTexture is pointing to a immutable texture and then set it to new tetxure. This is a bit confusing since we only add a mutable texture to this mPrevUploadedMutableTexture pointer but at some point it becomes immutable. This CL changes to immediately reset the pointer when texture is respecified from mutable to immutable, and added assertion that mPrevUploadedMutableTexture is mutable. Bug: b/301289624 Change-Id: I97a11616887367cd4c2069419fe17d3dea052b50 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4879087 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
This commit is contained in:
committed by
Angle LUCI CQ
parent
9f94ab7f86
commit
26148a0237
@@ -263,11 +263,13 @@ angle::Result TextureUpload::onMutableTextureUpload(ContextVk *contextVk, Textur
|
||||
{
|
||||
// This feature is currently disabled in the case of display-level texture sharing.
|
||||
ASSERT(!contextVk->hasDisplayTextureShareGroup());
|
||||
ASSERT(!newTexture->isImmutable());
|
||||
ASSERT(mPrevUploadedMutableTexture == nullptr || !mPrevUploadedMutableTexture->isImmutable());
|
||||
|
||||
// If the previous texture is null, it should be set to the current texture. We also have to
|
||||
// make sure that the previous texture pointer is still a mutable texture. Otherwise, we skip
|
||||
// the optimization.
|
||||
if (mPrevUploadedMutableTexture == nullptr || mPrevUploadedMutableTexture->isImmutable())
|
||||
if (mPrevUploadedMutableTexture == nullptr)
|
||||
{
|
||||
mPrevUploadedMutableTexture = newTexture;
|
||||
return angle::Result::Continue;
|
||||
|
||||
@@ -1580,6 +1580,10 @@ angle::Result TextureVk::setStorageMultisample(const gl::Context *context,
|
||||
}
|
||||
else if (mImage)
|
||||
{
|
||||
if (!contextVk->hasDisplayTextureShareGroup())
|
||||
{
|
||||
contextVk->getShareGroup()->onTextureRelease(this);
|
||||
}
|
||||
mImage->releaseStagedUpdates(contextVk->getRenderer());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user