|
Hello! I've been trying to add OpenCL to my application, and I can't get cl.CreateImage to work. public int PrepareOutputImageArr(int width, int height, int num_imgs)
{
ImageFormat imageFormat = new(ChannelOrder.Rgb, ChannelType.UnsignedInt8);
ImageDesc imageDesc = new()
{
ImageType = MemObjectType.Image2DArray,
ImageWidth = (nuint)width,
ImageHeight = (nuint)height,
ImageDepth = 0,
ImageArraySize = (nuint)num_imgs,
ImageRowPitch = 0,
ImageSlicePitch = 0,
NumMipLevels = 0,
NumSamples = 0,
};
out_img_arr = cl.CreateImage(context, MemFlags.HostReadOnly | MemFlags.WriteOnly, imageFormat, imageDesc, null, out int err);
if (CheckErr(err, "cl.CreateImage") != 0)
return 1;
return 0;
}This isn't my exact code, but it's pretty much this with different variable names. I also tried creating a 2D image to get the hang of it, but I couldn't even get that to work. I'm using a GeForce 1660 SUPER, and the platform version returns OpenCL 3.0 CUDA 12.2.146. I know that this isn't stack overflow and maybe not the right place for questions like this, but I'd rather not risk having my honest question marked as duplicate. |
Replies: 3 comments 7 replies
|
What is the return value of err? |
|
I wonder if this could be because the Silk.NET I have no clue how My only full theory is that |
|
I see that the latest release addresses this. I will try it when I have time. |
Ah so it turns out we did do that already, but it's not working because Khronos made no attempt to be consistent with Vulkan here:
Will manually hack this in.