onox/orka

Mesa drivers return unexpected data type when queried

Closed this issue · 0 comments

onox commented

Mesa drivers currently return Byte or Unsigned_Byte for integer internal formats, even if the component size is 16 or 32 bits (depending on the Internal_Format (in GL.Pixels) that is used). For float internal formats, Float is returned.

Functions Read_Pixels_type, Texture_Type, and Get_Texture_type in GL.Pixels.Queries never return Short, Unsigned_Short, Int, Unsigned_Int, or Half_Float.

See https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/mesa/main/formatquery.c#L609-617

Appropriate data type is required in procedure Write_Texture in package Orka.Resources.Textures.KTX.

Compute the data type ourselves instead of calling Get_Texture_Type in procedure Write_Texture.