OpenCL-Docs icon indicating copy to clipboard operation
OpenCL-Docs copied to clipboard

Contradictory wording of cl_image_desc specification

Open shajder opened this issue 10 months ago • 1 comments

Description of image_row_pitch (the same refers to image_slice_pitch) seems mutually contradictory. First spec says:

The image_row_pitch must be zero if ... . If image_row_pitch is zero and the image is created from an external memory handle, then the image row pitch is implementation-defined.

which implies that in some circumstances image_row_pitch may be zero, in others it must be zero. In the same paragraph spec says:

The image row pitch must be ≥ image_width × the size of an image element in bytes, and must be a multiple of the size of an image element in bytes.

Shouldn't this sentence begin with: "Otherwise, the image pitch must ..." ?

shajder avatar Mar 05 '25 07:03 shajder

Good point. The intent as I understand it is that if row pitch is 0, and the image is an imported handle, then it is implementation defined. If it is imported and non-zero, then it is interpreted as a linear row-major order image.

joshqti avatar Mar 12 '25 22:03 joshqti