diff --git a/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp b/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp index 98bf6b2931..30b689ef9b 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp @@ -1783,6 +1783,19 @@ angle::Result Blit11::initResolveDepthOnly(const gl::Context *context, dsvDesc.Texture2D.MipSlice = 0; dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + // --------------------------------------------------------------------- + // FAULT INJECTION (POC ONLY — do not land): + // Deterministically reproduce the partial-allocation desync by forcing + // CreateDepthStencilView to "fail" with E_OUTOFMEMORY on the *second* + // cache-miss invocation (i.e. after CreateTexture2D has already + // overwritten mResolvedDepth with the new-extents texture). + // --------------------------------------------------------------------- + static int sInitResolveDepthOnlyCalls = 0; + if (++sInitResolveDepthOnlyCalls == 2) + { + ANGLE_TRY_HR(context11, E_OUTOFMEMORY, + "POC fault-inject: simulated CreateDepthStencilView OOM"); + } ANGLE_TRY(mRenderer->allocateResource(context11, dsvDesc, mResolvedDepth.get(), &mResolvedDepthDSView)); mResolvedDepthDSView.setInternalName("Blit11::mResolvedDepthDSView");