diff options
Diffstat (limited to 'src/com/jogamp/opencl/CLSampler.java')
-rw-r--r-- | src/com/jogamp/opencl/CLSampler.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/jogamp/opencl/CLSampler.java b/src/com/jogamp/opencl/CLSampler.java index 8632143b..f19f58de 100644 --- a/src/com/jogamp/opencl/CLSampler.java +++ b/src/com/jogamp/opencl/CLSampler.java @@ -30,11 +30,12 @@ package com.jogamp.opencl; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.opencl.impl.CLTLInfoAccessor; +import com.jogamp.opencl.llb.CLSamplerBinding; import java.nio.Buffer; import static com.jogamp.opencl.CLException.*; -import static com.jogamp.opencl.CL.*; +import static com.jogamp.opencl.llb.CL.*; import static com.jogamp.opencl.util.CLUtil.*; /** @@ -42,19 +43,22 @@ import static com.jogamp.opencl.util.CLUtil.*; * @see CLContext#createSampler(com.jogamp.opencl.CLSampler.AddressingMode, com.jogamp.opencl.CLSampler.FilteringMode, boolean) * @author Michael Bien */ -public class CLSampler extends CLObject implements CLResource { +public class CLSampler extends CLObjectResource { private final CLSamplerInfoAccessor samplerInfo; + private final CLSamplerBinding binding; private CLSampler(CLContext context, long id, AddressingMode addrMode, FilteringMode filtMode, boolean normalizedCoords) { super(context, id); + this.binding = context.getPlatform().getSamplerBinding(); this.samplerInfo = new CLSamplerInfoAccessor(); } static CLSampler create(CLContext context, AddressingMode addrMode, FilteringMode filtMode, boolean normalizedCoords) { int[] error = new int[1]; - long id = context.cl.clCreateSampler(context.ID, clBoolean(normalizedCoords), addrMode.MODE, filtMode.MODE, error, 0); + CLSamplerBinding binding = context.getPlatform().getSamplerBinding(); + long id = binding.clCreateSampler(context.ID, clBoolean(normalizedCoords), addrMode.MODE, filtMode.MODE, error, 0); checkForError(error[0], "can not create sampler"); return new CLSampler(context, id, addrMode, filtMode, normalizedCoords); @@ -76,9 +80,10 @@ public class CLSampler extends CLObject implements CLResource { @Override public void release() { - int ret = cl.clReleaseSampler(ID); + super.release(); + int ret = binding.clReleaseSampler(ID); context.onSamplerReleased(this); - if(ret != CL.CL_SUCCESS) { + if(ret != CL_SUCCESS) { throw newException(ret, "can not release "+this); } } @@ -87,7 +92,7 @@ public class CLSampler extends CLObject implements CLResource { @Override protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) { - return cl.clGetSamplerInfo(ID, name, valueSize, value, valueSizeRet); + return binding.clGetSamplerInfo(ID, name, valueSize, value, valueSizeRet); } } |