Commit 9585a784 by John Bauman Committed by Commit Bot

Clear SRV cache on keyed mutex texture unbind from TextureStorage11_External

This fixes the same issue as https://chromium-review.googlesource.com/328400, except with NV12 external storage textures. The SRV cache thinks the texture is still bound, but releasing the keyed mutex has unbound it. BUG=625900,626524 Change-Id: I991cb3eeaaea0a1c4570b88de2ba873ae868ec2a Reviewed-on: https://chromium-review.googlesource.com/359430Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: John Bauman <jbauman@chromium.org>
parent e8d5c5c4
...@@ -1420,6 +1420,7 @@ TextureStorage11_External::TextureStorage11_External( ...@@ -1420,6 +1420,7 @@ TextureStorage11_External::TextureStorage11_External(
mTextureHeight = desc.Height; mTextureHeight = desc.Height;
mTextureDepth = 1; mTextureDepth = 1;
mInternalFormat = glDesc.internalFormat; mInternalFormat = glDesc.internalFormat;
mHasKeyedMutex = (desc.MiscFlags & D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX) != 0;
const d3d11::TextureFormat &formatInfo = const d3d11::TextureFormat &formatInfo =
d3d11::GetTextureFormatInfo(mInternalFormat, renderer->getRenderer11DeviceCaps()); d3d11::GetTextureFormatInfo(mInternalFormat, renderer->getRenderer11DeviceCaps());
...@@ -1430,6 +1431,12 @@ TextureStorage11_External::TextureStorage11_External( ...@@ -1430,6 +1431,12 @@ TextureStorage11_External::TextureStorage11_External(
TextureStorage11_External::~TextureStorage11_External() TextureStorage11_External::~TextureStorage11_External()
{ {
SafeRelease(mTexture); SafeRelease(mTexture);
if (mHasKeyedMutex)
{
// If the keyed mutex is released that will unbind it and cause the state cache to become
// desynchronized.
mRenderer->getStateManager()->invalidateBoundViews();
}
} }
gl::Error TextureStorage11_External::copyToStorage(TextureStorage *destStorage) gl::Error TextureStorage11_External::copyToStorage(TextureStorage *destStorage)
......
...@@ -225,6 +225,7 @@ class TextureStorage11_External : public TextureStorage11 ...@@ -225,6 +225,7 @@ class TextureStorage11_External : public TextureStorage11
ID3D11Texture2D *mTexture; ID3D11Texture2D *mTexture;
int mSubresourceIndex; int mSubresourceIndex;
bool mHasKeyedMutex;
Image11 *mAssociatedImage; Image11 *mAssociatedImage;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment