@Override public Buffer createBufferFromHost(ByteBuffer data, MemoryAccess access) { long flags = Utils.getMemoryAccessFlags(access); flags |= CL10.CL_MEM_USE_HOST_PTR; long mem = CL10.clCreateBuffer(context, flags, data, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer createBuffer(long size, MemoryAccess access) { long flags = Utils.getMemoryAccessFlags(access); CLMem mem = CL10.clCreateBuffer(context, flags, size, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer createBufferFromHost(ByteBuffer data, MemoryAccess access) { long flags = Utils.getMemoryAccessFlags(access); flags |= CL10.CL_MEM_USE_HOST_PTR; CLMem mem = CL10.clCreateBuffer(context, flags, data, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer createBuffer(long size, MemoryAccess access) { long flags = Utils.getMemoryAccessFlags(access); long mem = CL10.clCreateBuffer(context, flags, size, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer bindVertexBuffer(VertexBuffer vb, MemoryAccess access) { int id = vb.getId(); if (id == -1) { throw new IllegalArgumentException("vertex buffer was not yet uploaded to the GPU or is CPU only"); } long flags = Utils.getMemoryAccessFlags(access); Utils.errorBuffer.rewind(); CLMem mem = CL10GL.clCreateFromGLBuffer(context, flags, id, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateFromGLBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer bindVertexBuffer(VertexBuffer vb, MemoryAccess access) { Utils.assertSharingPossible(); int id = vb.getId(); if (id == -1) { throw new IllegalArgumentException("vertex buffer was not yet uploaded to the GPU or is CPU only"); } long flags = Utils.getMemoryAccessFlags(access); Utils.errorBuffer.rewind(); long mem = CL10GL.clCreateFromGLBuffer(context, flags, id, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateFromGLBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer createBufferFromHost(ByteBuffer data, MemoryAccess access) { long flags = Utils.getMemoryAccessFlags(access); flags |= CL10.CL_MEM_USE_HOST_PTR; long mem = CL10.clCreateBuffer(context, flags, data, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer createBuffer(long size, MemoryAccess access) { long flags = Utils.getMemoryAccessFlags(access); long mem = CL10.clCreateBuffer(context, flags, size, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); return new LwjglBuffer(mem); }
@Override public Buffer bindVertexBuffer(VertexBuffer vb, MemoryAccess access) { Utils.assertSharingPossible(); int id = vb.getId(); if (id == -1) { throw new IllegalArgumentException("vertex buffer was not yet uploaded to the GPU or is CPU only"); } long flags = Utils.getMemoryAccessFlags(access); Utils.errorBuffer.rewind(); long mem = CL10GL.clCreateFromGLBuffer(context, flags, id, Utils.errorBuffer); Utils.checkError(Utils.errorBuffer, "clCreateFromGLBuffer"); return new LwjglBuffer(mem); }