Results 1 to 2 of 2

Thread: empty texture object

  1. #1

    empty texture object

    Hi ,

    I thought that the following snippet will create an empty texture object of certain width and height. But the application terminates

    Code :
    cl_mem initTexture(int width,int height)
       cl_int ciErrNum;
       cl_image_format image_format;
       image_format.image_channel_order = CL_RGBA;
       image_format.image_channel_data_type = CL_UNSIGNED_INT8;
       //create an empty image 
       cl_mem imageTexture = clCreateImage2D(cxGPUContext,CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR,
       oclCheckErrorEX(ciErrNum, CL_SUCCESS, pCleanup);
       return imageTexture;

    Any idea folks ?


  2. #2
    Senior Member
    Join Date
    Oct 2012

    Re: empty texture object

    The description of the flag CL_MEM_COPY_HOST_PTR states that "this flag is valid only if host_ptr is not NULL".

    So you must either use a valid host_ptr, or create your image without CL_MEM_COPY_HOST_PTR and use clEnqueueFillImage.

Similar Threads

  1. Change texture on an object
    By bzhou in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 05-08-2009, 12:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean