OpenGL and OpenCL are NOT related! (Committed here are some scons fixes)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4349 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-09-30 12:58:02 +00:00
parent ffe12ec752
commit 4499444a86
3 changed files with 26 additions and 20 deletions

View File

@ -110,6 +110,7 @@ vars.AddVariables(
BoolVariable('noao', 'Build without AO', False), BoolVariable('noao', 'Build without AO', False),
BoolVariable('wxgl', 'Set For Building with WX GL libs (WIP)', False), BoolVariable('wxgl', 'Set For Building with WX GL libs (WIP)', False),
BoolVariable('jittest', 'temp don\'t use (WIP)', False), BoolVariable('jittest', 'temp don\'t use (WIP)', False),
BoolVariable('opencl', 'Build with OpenCL', False),
BoolVariable('nojit', 'Remove entire jit cores', False), BoolVariable('nojit', 'Remove entire jit cores', False),
EnumVariable('flavor', 'Choose a build flavor', 'release', EnumVariable('flavor', 'Choose a build flavor', 'release',
allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'), allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'),
@ -240,9 +241,6 @@ if sys.platform == 'darwin':
env['HAVE_SDL'] = conf.CheckSDL('1.0.0') env['HAVE_SDL'] = conf.CheckSDL('1.0.0')
# OpenCL
env['HAVE_OPENCL'] = conf.CheckPKG('opencl')
# Bluetooth for wii support # Bluetooth for wii support
env['HAVE_BLUEZ'] = conf.CheckPKG('bluez') env['HAVE_BLUEZ'] = conf.CheckPKG('bluez')
@ -257,6 +255,11 @@ else:
env['HAVE_OPENAL'] = conf.CheckPKG('openal') env['HAVE_OPENAL'] = conf.CheckPKG('openal')
env['HAVE_ALSA'] = conf.CheckPKG('alsa') env['HAVE_ALSA'] = conf.CheckPKG('alsa')
# OpenCL
if env['opencl']:
env['HAVE_OPENCL'] = conf.CheckPKG('opencl')
else:
env['HAVE_OPENCL'] = 0
if sys.platform != 'darwin': if sys.platform != 'darwin':
# needed for mic # needed for mic

View File

@ -46,21 +46,24 @@ struct sDecoders
cl_kernel kernel; // compute kernel cl_kernel kernel; // compute kernel
const char **cKernel; const char **cKernel;
}; };
const char *Kernel = "\n" \ const char *Kernel = " \
"__kernel void Decode( __local unsigned char *dst, __local const unsigned char *src, \n" \ __kernel void Decode(__local unsigned char *dst, \
" int width, int height) \n" \ __local const unsigned char *src, \
" int id = get_global_id(0); \n" \ int width, int height) \
" for (int xy = 0; xy < height*width; xy += 4)" { \
" for (int iy = 0; iy < 4; iy++, src += 8)" int id = get_global_id(0); \
" {" for (int xy = 0; xy < height*width; xy += 4) \
" u16 *ptr = (u16 *)dst + ((xy / width) + iy) * width + (xy % width);" for (int iy = 0; iy < 4; iy++, src += 8) { \
" u16 *s = (u16 *)src;" u16 *ptr = (u16 *)dst + ((xy / width) + iy) * \
" for(int j = 0; j < 4; j++)" width + (xy % width); \
" *ptr++ = Common::swap16(*s++);" u16 *s = (u16 *)src; \
" }" \ for(int j = 0; j < 4; j++) \
*ptr++ = Common::swap16(*s++); \
}
}";
sDecoders Decoders[] = { {NULL, NULL, &Kernel}, sDecoders Decoders[] = { {NULL, NULL, &Kernel},
};
bool Inited = false; bool Inited = false;
// TODO: Deinit (clRelease...) // TODO: Deinit (clRelease...)

View File

@ -21,7 +21,7 @@
#include "CPUDetect.h" #include "CPUDetect.h"
#include "TextureDecoder.h" #include "TextureDecoder.h"
#ifdef HAVE_OPENCL #if defined(HAVE_OPENCL) && HAVE_OPENCL
#include "OpenCL/TextureDecoder.h" #include "OpenCL/TextureDecoder.h"
#endif #endif
@ -581,11 +581,11 @@ 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) PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
{ {
#ifdef HAVE_OPENCL #if defined(HAVE_OPENCL) && HAVE_OPENCL
PC_TexFormat retval = TexDecoder_Decode_OpenCL(dst, src, width, height, texformat, tlutaddr, tlutfmt); PC_TexFormat retval = TexDecoder_Decode_OpenCL(dst, src, width, height, texformat, tlutaddr, tlutfmt);
#else #else
PC_TexFormat retval = TexDecoder_Decode_real(dst,src,width,height,texformat,tlutaddr,tlutfmt); PC_TexFormat retval = TexDecoder_Decode_real(dst,src,width,height,texformat,tlutaddr,tlutfmt);
#endif #endif
if ((!TexFmt_Overlay_Enable)|| (retval == PC_TEX_FMT_NONE)) if ((!TexFmt_Overlay_Enable)|| (retval == PC_TEX_FMT_NONE))
return retval; return retval;