Criperum's picture

PixelInternalFormat mismatch

Hello.
I'm trying to make some sort of DXGI_FORMAT to GL formats mapper(PixelInternalFormat + PixelFormat + PixelType). I faced with a problem with SNORM formats that are not present in PixelInternalFormat enumeration. These are in original GL enum and are in All enum but i can't use it in TexImage methods. Can someone help me to figure out why is that so or I should just forget about SNORM formats?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Make sure you are using OpenTK 1.1.0 or higher.

AttachmentSize
snorm.png5.43 KB
Criperum's picture

GL_R16_SNORM
GL_RG16_SNORM
GL_RGB16_SNORM
GL_RGBA16_SNORM

that can be used with glTexImage3D according to specifications are absent.

GL_RGBA16_SNORM was removed from possible values in 4.4 but the rest are present now.

the Fiddler's picture

You are right, fixed with commit db913c.

the Fiddler's picture

Fake edit: are you sure GL_RGBA16_SNORM has been removed? It is still listed in the 4.4 spec, section 8.5, page 190* as a required texture format.

* 4.4 core specification with changes marked.

Criperum's picture

Well. I just compared format lists of TexImage3D in last docs and 3.3 docs.
3.3 Docs:
Specifies the number of color components in the texture. Must be one of the following symbolic constants: GL_RGBA32F, GL_RGBA32I, GL_RGBA32UI, GL_RGBA16, GL_RGBA16F, GL_RGBA16I, GL_RGBA16UI, GL_RGBA8, GL_RGBA8UI, GL_SRGB8_ALPHA8, GL_RGB10_A2, GL_RGB10_A2UI, GL_R11F_G11F_B10F, GL_RG32F, GL_RG32I, GL_RG32UI, GL_RG16, GL_RG16F, GL_RGB16I, GL_RGB16UI, GL_RG8, GL_RG8I, GL_RG8UI, GL_R32F, GL_R32I, GL_R32UI, GL_R16F, GL_R16I, GL_R16UI, GL_R8, GL_R8I, GL_R8UI, GL_RGBA16_SNORM, GL_RGBA8_SNORM, GL_RGB32F, GL_RGB32I, GL_RGB32UI, GL_RGB16_SNORM, GL_RGB16F, GL_RGB16I, GL_RGB16UI, GL_RGB16, GL_RGB8_SNORM, GL_RGB8, GL_RGB8I, GL_RGB8UI, GL_SRGB8, GL_RGB9_E5, GL_RG16_SNORM, GL_RG8_SNORM, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_SIGNED_RG_RGTC2, GL_R16_SNORM, GL_R8_SNORM, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_SIGNED_RED_RGTC1, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT16, GL_DEPTH32F_STENCIL8, GL_DEPTH24_STENCIL8.

Last Docs:
internalFormat may also be one of the sized internal formats shown in Table 2, below

Table 2. Sized Internal Formats
Sized Internal Format
GL_R8
GL_R8_SNORM
GL_R16
GL_R16_SNORM
GL_RG8
GL_RG8_SNORM
GL_RG16
GL_RG16_SNORM
GL_R3_G3_B2
GL_RGB4
GL_RGB5
GL_RGB8
GL_RGB8_SNORM
GL_RGB10
GL_RGB12
GL_RGB16_SNORM
GL_RGBA2
GL_RGBA4
GL_RGB5_A1
GL_RGBA8
GL_RGBA8_SNORM
GL_RGB10_A2
GL_RGB10_A2UI
GL_RGBA12
GL_RGBA16
GL_SRGB8
GL_SRGB8_ALPHA8
GL_R16F
GL_RG16F
GL_RGB16F
GL_RGBA16F
GL_R32F
GL_RG32F
GL_RGB32F
GL_RGBA32F
GL_R11F_G11F_B10F
GL_RGB9_E5
GL_R8I
GL_R8UI
GL_R16I
GL_R16UI
GL_R32I
GL_R32UI
GL_RG8I
GL_RG8UI
GL_RG16I
GL_RG16UI
GL_RG32I
GL_RG32UI
GL_RGB8I
GL_RGB8UI
GL_RGB16I
GL_RGB16UI
GL_RGB32I
GL_RGB32UI
GL_RGBA8I
GL_RGBA8UI
GL_RGBA16I
GL_RGBA16UI
GL_RGBA32I
GL_RGBA32UI

the Fiddler's picture

When the spec and the docs diverge, the spec usually trumps the docs. I'll ping Khronos for clarification.