diff --git a/GPU/D3D11/FramebufferManagerD3D11.cpp b/GPU/D3D11/FramebufferManagerD3D11.cpp index 4b47dfa89e..f7d1179ae6 100644 --- a/GPU/D3D11/FramebufferManagerD3D11.cpp +++ b/GPU/D3D11/FramebufferManagerD3D11.cpp @@ -206,7 +206,6 @@ void FramebufferManagerD3D11::MakePixelTexture(const u8 *srcPixels, GEBufferForm convBuf = (u8*)map.pData; - // Final format is BGRA(directx) if (srcPixelFormat != GE_FORMAT_8888 || srcStride != 512) { for (int y = 0; y < height; y++) { switch (srcPixelFormat) { @@ -237,7 +236,7 @@ void FramebufferManagerD3D11::MakePixelTexture(const u8 *srcPixels, GEBufferForm { const u32_le *src = (const u32_le *)srcPixels + srcStride * y; u32 *dst = (u32 *)(convBuf + map.RowPitch * y); - ConvertRGBA8888ToBGRA8888(dst, src, width); + memcpy(dst, src, width * 4); } break; } @@ -246,7 +245,7 @@ void FramebufferManagerD3D11::MakePixelTexture(const u8 *srcPixels, GEBufferForm for (int y = 0; y < height; y++) { const u32_le *src = (const u32_le *)srcPixels + srcStride * y; u32 *dst = (u32 *)(convBuf + map.RowPitch * y); - ConvertRGBA8888ToBGRA8888(dst, src, width); + memcpy(dst, src, width * 4); } } diff --git a/ext/native/thin3d/thin3d_d3d11.cpp b/ext/native/thin3d/thin3d_d3d11.cpp index 3d7587dd81..7eaf004e3b 100644 --- a/ext/native/thin3d/thin3d_d3d11.cpp +++ b/ext/native/thin3d/thin3d_d3d11.cpp @@ -1102,12 +1102,12 @@ void D3D11DrawContext::BindSamplerStates(int start, int count, SamplerState **st } void D3D11DrawContext::Clear(int mask, uint32_t colorval, float depthVal, int stencilVal) { - if (mask & ClearFlag::COLOR) { + if ((mask & ClearFlag::COLOR) && curRenderTargetView_) { float colorRGBA[4]; Uint8x4ToFloat4(colorRGBA, colorval); context_->ClearRenderTargetView(curRenderTargetView_, colorRGBA); } - if (mask & (ClearFlag::DEPTH | ClearFlag::STENCIL)) { + if ((mask & (ClearFlag::DEPTH | ClearFlag::STENCIL)) && curDepthStencilView_) { UINT clearFlag = 0; if (mask & ClearFlag::DEPTH) clearFlag |= D3D11_CLEAR_DEPTH;