From 16c6ec6e7e8a7aca58b1d1811729c33a9d0081ea Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Wed, 7 Oct 2009 07:44:35 +0000 Subject: [PATCH] Woops, that is why getting work group size failed git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4372 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../VideoCommon/Src/OpenCL/TextureDecoder.cpp | 26 +++++++------------ Source/Core/VideoCommon/Src/XFBConvert.cpp | 6 ++--- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder.cpp index e463d9d1f0..e58f8e7326 100644 --- a/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder.cpp @@ -114,27 +114,21 @@ PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int hei #endif } - /*switch(texformat) + switch(texformat) { case GX_TF_I8: { - int srcOffset = 0; - for (int y = 0; y < height; y ++) - for (int x = 0; x < width; x ++) - { - //printf("X: %d Y: %d, copying 32 bytes from %d to %d\n", x, y, srcOffset,(y)*width+x); - memcpy(dst + (y + 0)*width+x, src + srcOffset + 0, 8); - memcpy(dst + (y + 1)*width+x, src + srcOffset + 8, 8); - memcpy(dst + (y + 2)*width+x, src + srcOffset + 16, 8); - memcpy(dst + (y + 3)*width+x, src + srcOffset + 24, 8); - srcOffset += 4; - } - return PC_TEX_FMT_I8; + for (int y = 0; y < height; y += 4) + for (int x = 0; x < width; x += 8) + for (int iy = 0; iy < 4; iy++, src += 8) + memcpy(dst + (y + iy)*width+x, src, 8); + return PC_TEX_FMT_I8; } + break; default: return PC_TEX_FMT_NONE; - }*/ - return PC_TEX_FMT_NONE; + } + //return PC_TEX_FMT_NONE; switch(texformat) { case GX_TF_I8: @@ -171,7 +165,7 @@ PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int hei // Get the maximum work group size for executing the kernel on the device // - err = clGetKernelWorkGroupInfo(Decoders[0].kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(int), &local, NULL); + err = clGetKernelWorkGroupInfo(Decoders[0].kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &local, NULL); if (err != CL_SUCCESS) { printf("Error: Failed to retrieve kernel work group info! %d\n", err); diff --git a/Source/Core/VideoCommon/Src/XFBConvert.cpp b/Source/Core/VideoCommon/Src/XFBConvert.cpp index b5cb4f5ab8..72b0286b7d 100644 --- a/Source/Core/VideoCommon/Src/XFBConvert.cpp +++ b/Source/Core/VideoCommon/Src/XFBConvert.cpp @@ -173,11 +173,11 @@ void ConvertFromXFB(u32 *dst, const u8* _pXFB, int width, int height) // Get the maximum work group size for executing the kernel on the device // - err = clGetKernelWorkGroupInfo(From_kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(int), &local, NULL); + err = clGetKernelWorkGroupInfo(From_kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &local, NULL); if (err != CL_SUCCESS) { printf("Error: Failed to retrieve kernel work group info! %d\n", err); - local = 32; + local = 64; } // Execute the kernel over the entire range of our 1d input data set @@ -279,7 +279,7 @@ void ConvertToXFB(u32 *dst, const u8* _pEFB, int width, int height) // Get the maximum work group size for executing the kernel on the device // - err = clGetKernelWorkGroupInfo(To_kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(int), &local, NULL); + err = clGetKernelWorkGroupInfo(To_kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &local, NULL); if (err != CL_SUCCESS) { printf("Error: Failed to retrieve kernel work group info! %d\n", err);