5package com.jogamp.opencl.llb.impl;
8import java.nio.charset.Charset;
9import java.nio.charset.StandardCharsets;
11import com.jogamp.gluegen.runtime.*;
12import com.jogamp.common.os.*;
13import com.jogamp.common.nio.*;
14import jogamp.common.os.MachineDataInfoRuntime;
16import com.jogamp.opencl.llb.impl.CLImageFormatImpl;
17import com.jogamp.opencl.llb.impl.CLImageDescImpl;
18import com.jogamp.opencl.llb.CL20;
19import java.security.AccessController;
20import java.security.PrivilegedAction;
21import com.jogamp.common.nio.PointerBuffer;
22import com.jogamp.common.util.LongLongHashMap;
23import com.jogamp.opencl.CLErrorHandler;
24import com.jogamp.opencl.CLException;
25import java.nio.ByteBuffer;
26import java.nio.IntBuffer;
27import com.jogamp.common.nio.Buffers;
35 StructAccessor accessor;
37 private static final int mdIdx = MachineDataInfoRuntime.getStatic().ordinal();
38 private final MachineDataInfo md;
40 private static final int[] CLImageDescImpl_size =
new int[] { 40 , 40 , 40 , 40 , 40 , 40 , 40 , 72 , 72 , 72 };
41 private static final int[] imageType_offset =
new int[] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
43 private static final int[] imageWidth_offset =
new int[] { 4 , 4 , 4 , 4 , 4 , 4 , 4 , 8 , 8 , 8 };
45 private static final int[] imageHeight_offset =
new int[] { 8 , 8 , 8 , 8 , 8 , 8 , 8 , 16 , 16 , 16 };
47 private static final int[] imageDepth_offset =
new int[] { 12 , 12 , 12 , 12 , 12 , 12 , 12 , 24 , 24 , 24 };
49 private static final int[] imageArraySize_offset =
new int[] { 16 , 16 , 16 , 16 , 16 , 16 , 16 , 32 , 32 , 32 };
51 private static final int[] imageRowPitch_offset =
new int[] { 20 , 20 , 20 , 20 , 20 , 20 , 20 , 40 , 40 , 40 };
53 private static final int[] imageSlicePitch_offset =
new int[] { 24 , 24 , 24 , 24 , 24 , 24 , 24 , 48 , 48 , 48 };
55 private static final int[] numMipLevels_offset =
new int[] { 28 , 28 , 28 , 28 , 28 , 28 , 28 , 56 , 56 , 56 };
57 private static final int[] numSamples_offset =
new int[] { 32 , 32 , 32 , 32 , 32 , 32 , 32 , 60 , 60 , 60 };
67 return CLImageDescImpl_size[mdIdx];
72 return create(Buffers.newDirectByteBuffer(
size()));
82 return create( ElementBuffer.derefPointer(
size(), addr, 1).getByteBuffer() );
86 md = MachineDataInfo.StaticConfig.values()[mdIdx].md;
87 accessor =
new StructAccessor(buf);
92 return accessor.getBuffer();
97 return accessor.getDirectBufferAddress();
107 accessor.setIntAt(imageType_offset[mdIdx], src);
118 return accessor.getIntAt(imageType_offset[mdIdx]);
128 accessor.setLongAt(imageWidth_offset[mdIdx], src, md.longSizeInBytes());
139 return accessor.getLongAt(imageWidth_offset[mdIdx], md.longSizeInBytes());
149 accessor.setLongAt(imageHeight_offset[mdIdx], src, md.longSizeInBytes());
160 return accessor.getLongAt(imageHeight_offset[mdIdx], md.longSizeInBytes());
170 accessor.setLongAt(imageDepth_offset[mdIdx], src, md.longSizeInBytes());
181 return accessor.getLongAt(imageDepth_offset[mdIdx], md.longSizeInBytes());
191 accessor.setLongAt(imageArraySize_offset[mdIdx], src, md.longSizeInBytes());
202 return accessor.getLongAt(imageArraySize_offset[mdIdx], md.longSizeInBytes());
212 accessor.setLongAt(imageRowPitch_offset[mdIdx], src, md.longSizeInBytes());
223 return accessor.getLongAt(imageRowPitch_offset[mdIdx], md.longSizeInBytes());
233 accessor.setLongAt(imageSlicePitch_offset[mdIdx], src, md.longSizeInBytes());
244 return accessor.getLongAt(imageSlicePitch_offset[mdIdx], md.longSizeInBytes());
254 accessor.setIntAt(numMipLevels_offset[mdIdx], src);
265 return accessor.getIntAt(numMipLevels_offset[mdIdx]);
275 accessor.setIntAt(numSamples_offset[mdIdx], src);
286 return accessor.getIntAt(numSamples_offset[mdIdx]);
Struct accessor for cl_image_desc.
final CLImageDescImpl setNumMipLevels(int src)
Setter for native field numMipLevels, being a struct owned IntType.
final CLImageDescImpl setImageRowPitch(long src)
Setter for native field imageRowPitch, being a struct owned IntType.
final CLImageDescImpl setImageHeight(long src)
Setter for native field imageHeight, being a struct owned IntType.
final CLImageDescImpl setImageType(int src)
Setter for native field imageType, being a struct owned IntType.
static CLImageDescImpl create(java.nio.ByteBuffer buf)
Returns a new instance using the given ByteBuffer having at least {#link size()} bytes capacity.
final long getImageSlicePitch()
Getter for native field imageSlicePitch, being a struct owned IntType.
static int size()
Returns the aligned total size of a native instance.
final CLImageDescImpl setImageSlicePitch(long src)
Setter for native field imageSlicePitch, being a struct owned IntType.
final CLImageDescImpl setImageDepth(long src)
Setter for native field imageDepth, being a struct owned IntType.
final long getImageHeight()
Getter for native field imageHeight, being a struct owned IntType.
final CLImageDescImpl setNumSamples(int src)
Setter for native field numSamples, being a struct owned IntType.
final long getImageWidth()
Getter for native field imageWidth, being a struct owned IntType.
final long getImageDepth()
Getter for native field imageDepth, being a struct owned IntType.
static boolean usesNativeCode()
Returns true if this generated implementation uses native code, otherwise false.
final java.nio.ByteBuffer getBuffer()
Return the underlying native direct ByteBuffer.
static CLImageDescImpl derefPointer(final long addr)
Returns new instance dereferencing ByteBuffer at given native address addr with size size().
final CLImageDescImpl setImageWidth(long src)
Setter for native field imageWidth, being a struct owned IntType.
static CLImageDescImpl create()
Returns a new instance with all bytes set to zero.
final long getImageArraySize()
Getter for native field imageArraySize, being a struct owned IntType.
final CLImageDescImpl setImageArraySize(long src)
Setter for native field imageArraySize, being a struct owned IntType.
final long getImageRowPitch()
Getter for native field imageRowPitch, being a struct owned IntType.
final int getImageType()
Getter for native field imageType, being a struct owned IntType.
final int getNumMipLevels()
Getter for native field numMipLevels, being a struct owned IntType.
final long getDirectBufferAddress()
Returns the native address of the underlying native ByteBuffer getBuffer().
final int getNumSamples()
Getter for native field numSamples, being a struct owned IntType.