D3D11: Fix stale SRVs with tiny depth textures.
When the tiny depth texture would get re-created on change, it was
not freeing any cached SRVs which were pointing to the old tex.
Fix this by erasing the cache entry if the texure is recreated.
Also include a test which hooks into the workarounds to force
testing on every platform.
Also narrow the workaround to only apply to depth/stencil textures
which use these mips in GL, rather than D3D, where we always create
a full mip chain.
BUG=angleproject:1664
Change-Id: If0ac396b8847e1bf9b50165e5332da573e9bb3e4
Reviewed-on: https://chromium-review.googlesource.com/421567
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index d9c7e36..ed4cd8b 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -890,10 +890,10 @@
stream->readString(&mVertexHLSL);
stream->readBytes(reinterpret_cast<unsigned char *>(&mVertexWorkarounds),
- sizeof(D3DCompilerWorkarounds));
+ sizeof(angle::CompilerWorkaroundsD3D));
stream->readString(&mPixelHLSL);
stream->readBytes(reinterpret_cast<unsigned char *>(&mPixelWorkarounds),
- sizeof(D3DCompilerWorkarounds));
+ sizeof(angle::CompilerWorkaroundsD3D));
stream->readBool(&mUsesFragDepth);
stream->readBool(&mUsesPointSize);
stream->readBool(&mUsesFlatInterpolation);
@@ -1075,10 +1075,10 @@
stream->writeString(mVertexHLSL);
stream->writeBytes(reinterpret_cast<unsigned char *>(&mVertexWorkarounds),
- sizeof(D3DCompilerWorkarounds));
+ sizeof(angle::CompilerWorkaroundsD3D));
stream->writeString(mPixelHLSL);
stream->writeBytes(reinterpret_cast<unsigned char *>(&mPixelWorkarounds),
- sizeof(D3DCompilerWorkarounds));
+ sizeof(angle::CompilerWorkaroundsD3D));
stream->writeInt(mUsesFragDepth);
stream->writeInt(mUsesPointSize);
stream->writeInt(mUsesFlatInterpolation);
@@ -1309,8 +1309,8 @@
gl::Error error = mRenderer->compileToExecutable(
*currentInfoLog, geometryHLSL, SHADER_GEOMETRY, mStreamOutVaryings,
- (mState.getTransformFeedbackBufferMode() == GL_SEPARATE_ATTRIBS), D3DCompilerWorkarounds(),
- &mGeometryExecutables[geometryShaderType]);
+ (mState.getTransformFeedbackBufferMode() == GL_SEPARATE_ATTRIBS),
+ angle::CompilerWorkaroundsD3D(), &mGeometryExecutables[geometryShaderType]);
if (!infoLog && error.isError())
{
@@ -2249,10 +2249,10 @@
}
mVertexHLSL.clear();
- mVertexWorkarounds = D3DCompilerWorkarounds();
+ mVertexWorkarounds = angle::CompilerWorkaroundsD3D();
mPixelHLSL.clear();
- mPixelWorkarounds = D3DCompilerWorkarounds();
+ mPixelWorkarounds = angle::CompilerWorkaroundsD3D();
mUsesFragDepth = false;
mPixelShaderKey.clear();
mUsesPointSize = false;