From 350938462960584765f7deace3f476d6adbf5959 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Sat, 9 Mar 2013 21:41:40 +0200 Subject: [PATCH] clCreateImage fixes: - Corrected image_desc byte-size calculation on x64. - Allow null host_ptr. --- src/templates/org/lwjgl/opencl/CL12.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/templates/org/lwjgl/opencl/CL12.java b/src/templates/org/lwjgl/opencl/CL12.java index e0d5a97b..64383f93 100644 --- a/src/templates/org/lwjgl/opencl/CL12.java +++ b/src/templates/org/lwjgl/opencl/CL12.java @@ -199,8 +199,9 @@ public interface CL12 { CLMem clCreateImage(@PointerWrapper("cl_context") CLContext context, @NativeType("cl_mem_flags") long flags, @Check("2 * 4") @Const @NativeType("cl_image_format") ByteBuffer image_format, - @Check("3 * 4 + 7 * PointerBuffer.getPointerSize()") @Const @NativeType("cl_image_desc") ByteBuffer image_desc, - @Check + // On x64 there's 4 byte padding after image_type (to align image_width) + @Check("7 * PointerBuffer.getPointerSize() + 2 * 4 + PointerBuffer.getPointerSize()") @Const @NativeType("cl_image_desc") ByteBuffer image_desc, + @Check(canBeNull = true) @cl_byte @cl_short @cl_int