Kill HAVE_OPENCL.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6756 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-06 01:11:32 +00:00
parent 5ca3adde3c
commit 95b6d3f445
13 changed files with 16 additions and 133 deletions

View File

@ -43,10 +43,8 @@
#include "DataReader.h"
#include "OpenCL.h"
#if defined(HAVE_OPENCL) && HAVE_OPENCL
#include "OpenCL/OCLTextureDecoder.h"
#include "VideoConfig.h"
#endif
u8* g_pVideoData = 0;
DataReadU32xNfunc DataReadU32xFuncs[16] = {
@ -403,25 +401,21 @@ void OpcodeDecoder_Init()
{
g_pVideoData = FAKE_GetFifoStartPtr();
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if (g_Config.bEnableOpenCL)
{
OpenCL::Initialize();
TexDecoder_OpenCL_Initialize();
}
#endif
}
void OpcodeDecoder_Shutdown()
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if (g_Config.bEnableOpenCL)
{
TexDecoder_OpenCL_Shutdown();
OpenCL::Destroy();
}
#endif
}
void OpcodeDecoder_Run(bool skipped_frame)

View File

@ -86,7 +86,6 @@ cl_mem g_clsrc, g_cldst; // texture buffer memory objects
void TexDecoder_OpenCL_Initialize()
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if(!g_Inited)
{
if(!OpenCL::Initialize())
@ -240,12 +239,10 @@ void TexDecoder_OpenCL_Initialize()
g_Inited = true;
}
#endif
}
void TexDecoder_OpenCL_Shutdown()
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL && !defined(DEBUG_OPENCL)
if (g_program)
clReleaseProgram(g_program);
@ -264,12 +261,10 @@ void TexDecoder_OpenCL_Shutdown()
clReleaseMemObject(g_cldst);
g_Inited = false;
#endif
}
PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt, bool rgba)
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL
cl_int err;
sDecoderParameter& decoder = rgba ? g_DecodeParametersRGBA[texformat] : g_DecodeParametersNative[texformat];
if(!g_Inited || !decoder.name || !decoder.kernel || decoder.format == PC_TEX_FMT_NONE)
@ -310,7 +305,4 @@ PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int hei
#endif
return decoder.format;
#else
return PC_TEX_FMT_NONE;
#endif
}

View File

@ -21,10 +21,8 @@
#include "CPUDetect.h"
#include "TextureDecoder.h"
#include "OpenCL.h"
#if defined(HAVE_OPENCL) && HAVE_OPENCL
#include "OpenCL/OCLTextureDecoder.h"
#include "VideoConfig.h"
#endif
#include "LookUpTables.h"
@ -1733,7 +1731,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
const __m128i dxt = _mm_loadu_si128((__m128i *)(src + sizeof(struct DXTBlock) * 0));
__m128i argb888x4;
const __m128i allFF = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0xFFFFFFFFL, 0xFFFFFFFFL);
const __m128i lowMask = _mm_srli_si128( allFF, 8 );
__m128i c1 = _mm_unpackhi_epi16(dxt, dxt);
c1 = _mm_slli_si128(c1, 8);
const __m128i c0 = _mm_or_si128(c1, _mm_srli_si128(_mm_slli_si128(_mm_unpacklo_epi16(dxt, dxt), 8), 8));
@ -2039,10 +2036,8 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
{
PC_TexFormat retval = PC_TEX_FMT_NONE;
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if (g_Config.bEnableOpenCL)
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);

View File

@ -43,8 +43,7 @@ __m128i _b1[256];
__m128i _b2[256];
} // namespace
#if defined(HAVE_OPENCL) && HAVE_OPENCL
bool Inited = false;
bool Inited = false;
cl_kernel To_kernel;
cl_program To_program;
@ -110,7 +109,7 @@ void InitKernels()
To_kernel = OpenCL::CompileKernel(To_program, "ConvertToXFB");
Inited = true;
}
#endif
void InitXFBConvTables()
{
for (int i = 0; i < 256; i++)
@ -138,7 +137,6 @@ void ConvertFromXFB(u32 *dst, const u8* _pXFB, int width, int height)
}
const unsigned char *src = _pXFB;
u32 numBlocks = ((width * height) / 2) / 2;
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if(!Inited)
InitKernels();
int err;
@ -209,29 +207,6 @@ void ConvertFromXFB(u32 *dst, const u8* _pXFB, int width, int height)
}
clReleaseMemObject(_dst);
clReleaseMemObject(_src);
#else
for (u32 i = 0; i < numBlocks; i++)
{
__m128i y1 = _y[src[0]];
__m128i u = _u[src[1]];
__m128i y2 = _y[src[2]];
__m128i v = _v[src[3]];
__m128i y1_2 = _y[src[4+0]];
__m128i u_2 = _u[src[4+1]];
__m128i y2_2 = _y[src[4+2]];
__m128i v_2 = _v[src[4+3]];
__m128i c1 = _mm_srai_epi32(_mm_add_epi32(y1, _mm_add_epi32(u, v)), 16);
__m128i c2 = _mm_srai_epi32(_mm_add_epi32(y2, _mm_add_epi32(u, v)), 16);
__m128i c3 = _mm_srai_epi32(_mm_add_epi32(y1_2, _mm_add_epi32(u_2, v_2)), 16);
__m128i c4 = _mm_srai_epi32(_mm_add_epi32(y2_2, _mm_add_epi32(u_2, v_2)), 16);
__m128i four_dest = _mm_packus_epi16(_mm_packs_epi32(c1, c2), _mm_packs_epi32(c3, c4));
_mm_store_si128((__m128i *)dst, four_dest);
dst += 4;
src += 8;
}
#endif
}
@ -243,7 +218,6 @@ void ConvertToXFB(u32 *dst, const u8* _pEFB, int width, int height)
if (((size_t)dst & 0xF) != 0) {
PanicAlert("ConvertToXFB - unaligned XFB");
}
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if(!Inited)
InitKernels();
@ -315,33 +289,4 @@ void ConvertToXFB(u32 *dst, const u8* _pEFB, int width, int height)
}
clReleaseMemObject(_dst);
clReleaseMemObject(_src);
#else
for (u32 i = 0; i < numBlocks; i++)
{
__m128i yuyv0 = _mm_srai_epi32(
_mm_add_epi32(
_mm_add_epi32(_r1[src[0]], _mm_add_epi32(_g1[src[1]], _b1[src[2]])),
_mm_add_epi32(_r2[src[4]], _mm_add_epi32(_g2[src[5]], _b2[src[6]]))), 16);
src += 8;
__m128i yuyv1 = _mm_srai_epi32(
_mm_add_epi32(
_mm_add_epi32(_r1[src[0]], _mm_add_epi32(_g1[src[1]], _b1[src[2]])),
_mm_add_epi32(_r2[src[4]], _mm_add_epi32(_g2[src[5]], _b2[src[6]]))), 16);
src += 8;
__m128i yuyv2 = _mm_srai_epi32(
_mm_add_epi32(
_mm_add_epi32(_r1[src[0]], _mm_add_epi32(_g1[src[1]], _b1[src[2]])),
_mm_add_epi32(_r2[src[4]], _mm_add_epi32(_g2[src[5]], _b2[src[6]]))), 16);
src += 8;
__m128i yuyv3 = _mm_srai_epi32(
_mm_add_epi32(
_mm_add_epi32(_r1[src[0]], _mm_add_epi32(_g1[src[1]], _b1[src[2]])),
_mm_add_epi32(_r2[src[4]], _mm_add_epi32(_g2[src[5]], _b2[src[6]]))), 16);
src += 8;
__m128i four_dest = _mm_packus_epi16(_mm_packs_epi32(yuyv0, yuyv1), _mm_packs_epi32(yuyv2, yuyv3));
_mm_store_si128((__m128i *)dst, four_dest);
dst += 4;
}
#endif
}