@@ -870,7 +870,7 @@ class DeviceWrapper final : public ID3D11Device, IDXGIDevice1 {
870
870
desc.Format = DXGI_FORMAT_R16_UNORM;
871
871
pDesc = &desc;
872
872
}
873
- if (config.msaaSamples && tdesc.Format == DXGI_FORMAT_B8G8R8A8_TYPELESS && !(isPowerOfTwo (tdesc.Width ) && !isPowerOfTwo (tdesc.Height ))) {
873
+ if (config.msaaSamples && ( tdesc.Format == DXGI_FORMAT_B8G8R8A8_TYPELESS || tdesc. Format == DXGI_FORMAT_B8G8R8A8_UNORM) && !(isPowerOfTwo (tdesc.Width ) && !isPowerOfTwo (tdesc.Height ))) {
874
874
// Not shadow texture
875
875
MSAACandidateState state = MSAACandidateState::None;
876
876
UINT size = sizeof (state);
@@ -1030,6 +1030,7 @@ class ContextWrapper final : public ID3D11DeviceContext {
1030
1030
LONG refcnt;
1031
1031
UINT numIndexedDraws = 0 ;
1032
1032
ID3D11DeviceContext* ctx;
1033
+ ID3D11Resource* needsResolve;
1033
1034
ID3D11BlendState* alphaToCoverageBlend = nullptr ;
1034
1035
ID3D11BlendState* requestedBlend = nullptr ;
1035
1036
ID3D11PixelShader* requestedPS = nullptr ;
@@ -1173,7 +1174,14 @@ class ContextWrapper final : public ID3D11DeviceContext {
1173
1174
void Flush () override { ctx->Flush (); }
1174
1175
D3D11_DEVICE_CONTEXT_TYPE GetType () override { return ctx->GetType (); }
1175
1176
UINT GetContextFlags () override { return ctx->GetContextFlags (); }
1176
- HRESULT FinishCommandList (BOOL RestoreDeferredContextState, ID3D11CommandList** ppCommandList) override { return ctx->FinishCommandList (RestoreDeferredContextState, ppCommandList); }
1177
+
1178
+ HRESULT FinishCommandList (BOOL RestoreDeferredContextState, ID3D11CommandList** ppCommandList) override {
1179
+ if (needsResolve) {
1180
+ resolveIfMSAA (ctx, needsResolve);
1181
+ needsResolve = nullptr ;
1182
+ }
1183
+ return ctx->FinishCommandList (RestoreDeferredContextState, ppCommandList);
1184
+ }
1177
1185
1178
1186
void RSSetViewports (UINT NumViewports, const D3D11_VIEWPORT* pViewports) override
1179
1187
{
@@ -1555,6 +1563,7 @@ class ContextWrapper final : public ID3D11DeviceContext {
1555
1563
dev->Release ();
1556
1564
// We're rendering to the texture so it's now dirty
1557
1565
base->SetPrivateData (IID_MSAACandidate, sizeof (state), &MSAACandidateStateDirty);
1566
+ needsResolve = base;
1558
1567
}
1559
1568
base->Release ();
1560
1569
}
0 commit comments