diff options
| author | NeoBrainX <NeoBrainX@googlemail.com> | 2010-06-19 01:02:43 +0000 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2010-06-19 01:02:43 +0000 |
| commit | d7bbddcbd34590b07a060d5bbe7df5d680893933 (patch) | |
| tree | 1897786d88983e144da7dd295abbe62aa34a35ed /Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | |
| parent | 08d7861578da48b07286cf80be5d84fbebe52cb7 (diff) | |
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
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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; |
