From c2e32371f6ecda152efe5ec579bea9dd77b0a2ff Mon Sep 17 00:00:00 2001 From: Orphis Date: Tue, 22 Jun 2010 00:52:17 +0000 Subject: Refactor and prepare the OpenCL texture decoder for decoding textures to RGBA format required by DX11. Fix the decoder codepath when OpenCL is enabled and the DX11 plugin is used. Added the DX11 plugin to the Dolphin project dependencies. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5764 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/TextureDecoder.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp') diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 91cf47b7f9..ae41f822c2 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -1266,13 +1266,15 @@ void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center) PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt,bool rgbaOnly) { + PC_TexFormat retval = PC_TEX_FMT_NONE; + #if defined(HAVE_OPENCL) && HAVE_OPENCL - PC_TexFormat retval = TexDecoder_Decode_OpenCL(dst, src, width, height, texformat, tlutaddr, tlutfmt); - if(retval == PC_TEX_FMT_NONE) - retval = TexDecoder_Decode_real(dst,src,width,height,texformat,tlutaddr,tlutfmt); -#else - PC_TexFormat retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst,src,width,height,texformat,tlutaddr,tlutfmt) : TexDecoder_Decode_real(dst,src,width,height,texformat,tlutaddr,tlutfmt); + retval = TexDecoder_Decode_OpenCL(dst, src, width, height, texformat, tlutaddr, tlutfmt, rgbaOnly); #endif + + if(retval == PC_TEX_FMT_NONE) + retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst,src,width,height,texformat,tlutaddr,tlutfmt) : TexDecoder_Decode_real(dst,src,width,height,texformat,tlutaddr,tlutfmt); + if ((!TexFmt_Overlay_Enable)|| (retval == PC_TEX_FMT_NONE)) return retval; -- cgit v1.2.3