KhronosGroup / KhronosGroup/OpenCL-Docs

How to using clCreateImage to create a miapmap image?

Open
#1,182 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
420
Forks
131
Avg merge
5d 13h
Merged PRs (30d)
11

Description

I'm trying to use clCreateImage to create a mipmap image, but returns **CL_INVALID_IMAGE_DESCRIPTOR** . Here is my code:
```
cl_image_desc clImageIn;
memset(&clImageIn, 0, sizeof(cl_image_desc));
clImageIn.image_type = CL_MEM_OBJECT_IMAGE2D;
clImageIn.image_width = 1920;
clImageIn.image_height = 1080;
clImageIn.num_mip_levels = 2;

cl_image_format clImageFormat;
clImageFormat.image_channel_order = CL_R;
clImageFormat.image_channel_data_type = CL_UNORM_INT8;

int ret;
cl_mem image = clCreateImage(context, CL_READ_ONLY, &clImageFormat, &clImageIn, NULL, ret);
```

and the ret also returns -65, is there something wrong?
Btw, I find mali-G57 cannot support OPENCL EXTENSION of _cl_khr_mipmap_image_ ,is that true?

Contributor guide

Open the contributing guide

Research direction

Start with the clCreateImage API documentation and compare the shown cl_image_desc fields and return-value handling with the specification. Then check the _cl_khr_mipmap_image_ support question for Mali-G57. Done means providing a source-backed explanation of the error and the relevant mipmap support details.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.