From d7bbddcbd34590b07a060d5bbe7df5d680893933 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sat, 19 Jun 2010 01:02:43 +0000 Subject: DX11: Prefer DXGI_FORMAT_R8G8B8A8 to DXGI_FORMAT_B8G8R8A8 wherever appropriate. Slightly modify the way we're doing screenshots once again, thanks to Orphis this time ;) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5743 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp') diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index 6db655a6d1..e8c030063b 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -271,8 +271,9 @@ TextureCache::TCacheEntry* TextureCache::Load(unsigned int stage, u32 address, u if (pcfmt == PC_TEX_FMT_NONE) pcfmt = TexDecoder_Decode(temp, ptr, expandedWidth, expandedHeight, tex_format, tlutaddr, tlutfmt); - DXGI_FORMAT d3d_fmt = DXGI_FORMAT_B8G8R8A8_UNORM; + DXGI_FORMAT d3d_fmt = DXGI_FORMAT_R8G8B8A8_UNORM; bool swap_r_b = false; + if (pcfmt == PC_TEX_FMT_BGRA32 && D3D::BGRATexturesSupported()) d3d_fmt = DXGI_FORMAT_B8G8R8A8_UNORM; entry.oldpixel = ((u32*)ptr)[0]; if (g_ActiveConfig.bSafeTextureCache) entry.hash = hash_value; @@ -400,7 +401,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, boo entry.Scaledh = Scaledtex_h; entry.fmt = copyfmt; entry.isNonPow2 = true; - entry.texture = D3DTexture2D::Create(Scaledtex_w, Scaledtex_h, (D3D11_BIND_FLAG)((int)D3D11_BIND_RENDER_TARGET|(int)D3D11_BIND_SHADER_RESOURCE), D3D11_USAGE_DEFAULT, DXGI_FORMAT_B8G8R8A8_UNORM); + entry.texture = D3DTexture2D::Create(Scaledtex_w, Scaledtex_h, (D3D11_BIND_FLAG)((int)D3D11_BIND_RENDER_TARGET|(int)D3D11_BIND_SHADER_RESOURCE), D3D11_USAGE_DEFAULT, DXGI_FORMAT_R8G8B8A8_UNORM); if (entry.texture == NULL) PanicAlert("CopyRenderTargetToTexture failed to create entry.texture at %s %d\n", __FILE__, __LINE__); textures[address] = entry; tex = entry.texture; -- cgit v1.2.3