KhronosGroup / OpenGL-API

OpenGL and OpenGL ES API Issue Tracker
34 stars 5 forks source link

Are there restrictions of 24-bit unused field usage of pixels of FLOAT_32_UNSIGNED_INT_24_8_REV texture? #48

Closed asimiklit closed 5 years ago

asimiklit commented 5 years ago

I am working on mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=110305

There is an issue with a FLOAT_32_UNSIGNED_INT_24_8_REV. OpenGL spec "8.4.4.2 Special Interpretations" is saying: the second word contains a packed 24-bit unused field, followed by an 8-bit index

for example:

  1. Test writes stencil value 0x00000088 to each pixel of a texture
  2. Test uploads it to opengl using glTexImage2D
  3. Test immediately reads an uploaded texture back
  4. Test detects an error because there in 24-bit unused field of the texture pixels is a trash for example: 0xfbac1488. (just for case in this example was used a little endian machine)

Could you please clarify the following questions: Could I write something except zeros into this field using glTexImage2D? What values of this unused field I should expect using glGetTexImage: unspecified, unchanged, zeroes, ...?

Note: I guess that any usage of this bit field is a unspecified behavior but maybe I missed something.

pdaniell-nv commented 5 years ago

This sounds like a test bug if it expects zeros in the unused portion of the bitfield. The value of those unused bits is undefined and they should be ignored.

Could I write something except zeros into this field using glTexImage2D?

Yes, they should be ignored by the implementation.

What values of this unused field I should expect using glGetTexImage: unspecified, unchanged, zeroes, ...?

Unspecified, the app should ignore them.

asimiklit commented 5 years ago

Thanks a lot for clarification.

oddhack commented 5 years ago

@asimiklit can we close the issue, or are there additional questions? Thanks.

asimiklit commented 5 years ago

Think yes, I don't have additional questions, everything is clear for me now) Thanks.