From 9fd235ddf6a36b638150788c503c95af6a3598f3 Mon Sep 17 00:00:00 2001 From: Chrobi Date: Sat, 26 Dec 2015 22:49:01 -0700 Subject: [PATCH] Update InfoUtilFactory.java Update `calculateImage2DSize` and `calculateImage3DSize` method calls per issue https://github.com/LWJGL/lwjgl/issues/74#issuecomment-167174311 --- src/java/org/lwjgl/opencl/InfoUtilFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/lwjgl/opencl/InfoUtilFactory.java b/src/java/org/lwjgl/opencl/InfoUtilFactory.java index b44fc9eb..8493d940 100644 --- a/src/java/org/lwjgl/opencl/InfoUtilFactory.java +++ b/src/java/org/lwjgl/opencl/InfoUtilFactory.java @@ -305,7 +305,7 @@ final class InfoUtilFactory { errcode_ret = APIUtil.getBufferInt(); CLMem __result = new CLMem(nclCreateImage2D(context.getPointer(), flags, MemoryUtil.getAddress(formatBuffer, 0), image_width, image_height, image_row_pitch, MemoryUtil.getAddress0Safe(host_ptr) + - (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(formatBuffer, image_width, image_height, image_row_pitch)) : 0), + (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(host_ptr, formatBuffer, image_width, image_height, image_row_pitch)) : 0), MemoryUtil.getAddressSafe(errcode_ret), function_pointer), context); if ( LWJGLUtil.DEBUG ) Util.checkCLError(errcode_ret.get(0)); @@ -325,7 +325,7 @@ final class InfoUtilFactory { errcode_ret = APIUtil.getBufferInt(); CLMem __result = new CLMem(nclCreateImage3D(context.getPointer(), flags, MemoryUtil.getAddress(formatBuffer, 0), image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, MemoryUtil.getAddress0Safe(host_ptr) + - (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0), + (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(host_ptr, formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0), MemoryUtil.getAddressSafe(errcode_ret), function_pointer), context); if ( LWJGLUtil.DEBUG ) Util.checkCLError(errcode_ret.get(0)); @@ -603,4 +603,4 @@ final class InfoUtilFactory { } }; -} \ No newline at end of file +}