Unofficial OpenGL Software Development Kit: Image Format Validation Rules

Unofficial OpenGL Software Development Kit 0.5.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Image Format Validation Rules

Not every combination of ImageFormat parameters is considered valid. Some are functionally meaningless or inconsistent, while others are simply not allowed.

- The ImageFormat::LineAlign field must be 1, 2, 4, or 8. This value is ignored if the glimg::PixelDataType is a compressed format; they do not use the line alignment.

- If the glimg::PixelDataType is not a compressed format, then:

  - The glimg::ComponentOrder cannot be `ORDER_COMPRESSED`.
  - The glimg::Bitdepth cannot be `BD_COMPRESSED`.

- If the glimg::PixelDataType is compressed format, then:

  - The glimg::ComponentOrder must be `ORDER_COMPRESSED`.
  - The glimg::Bitdepth must be `BD_COMPRESSED`.
  - If the glimg::PixelDataType uses BC1, then the glimg::PixelComponents must be one of the RGB or RGBA formats (not RGBX or others).
  - If the glimg::PixelDataType uses BC2, BC3, or BC7, then the glimg::PixelComponents must include an alpha channel.
  - If the glimg::PixelDataType uses BC4, signed or unsigned, then the glimg::PixelComponents must be `FMT_COLOR_RED`.
  - If the glimg::PixelDataType uses BC5, signed or unsigned, then the glimg::PixelComponents must be `FMT_COLOR_RG`.
  - If the glimg::PixelDataType uses BC5, signed or unsigned, then the glimg::PixelComponents must be `FMT_COLOR_RGB`.

- The glimg::PixelDataType `DT_SHARED_EXP_FLOAT` can only be used with The glimg::ComponentOrder of `ORDER_RGBE`, glimg::Bitdepth of `BD_PACKED_32_BIT_5999_REV`, and a glimg::PixelComponents of `FMT_COLOR_RGB`.

  - The glimg::ComponentOrder of `ORDER_RGBE` can only be used with the glimg::PixelDataType `DT_SHARED_EXP_FLOAT`, as above.
  - The glimg::Bitdepth of `BD_PACKED_32_BIT_5999_REV` can only be used as above.

- If the glimg::PixelComponents includes depth:

  - The glimg::ComponentOrder must be `ORDER_DEPTH_STENCIL`.
  - The glimg::PixelDataType is must be either `DT_NORM_UNSIGNED_INTEGER` or `DT_FLOAT`.
  - If glimg::PixelDataType is `DT_FLOAT`, then the glimg::Bitdepth must be `BD_PER_COMP_32` and glimg::PixelComponents must be `FMT_DEPTH`.
  - If glimg::PixelDataType is `DT_NORM_UNSIGNED_INTEGER`, then either of the following must be true:
    - The glimg::Bitdepth must be `BD_PER_COMP_16` and glimg::PixelComponents must be `FMT_DEPTH`.
    - the glimg::Bitdepth must be `BD_PACKED_32_BIT_248` and glimg::PixelComponents must be `FMT_DEPTH_X`.

- The glimg::Bitdepth `BD_PACKED_32_BIT_248` may only be used with a glimg::PixelComponents of `FMT_DEPTH_X`.

- Non depth glimg::PixelComponents that use a glimg::PixelDataType of `DT_FLOAT` must have a glimg::Bitdepth of 16-bit per component or greater, or must use `BD_PACKED_32_BIT_101111_REV`.

- glimg::PixelComponents that use the sRGB colorspace may only be used with a glimg::PixelDataType of `DT_NORM_UNSIGNED_INTEGER`.

- The glimg::Bitdepth `BD_PACKED_32_BIT_101111_REV` can only be used with a glimg::PixelDataType of `DT_FLOAT`, a glimg::ComponentOrder of `ORDER_RGBA`, and a glimg::PixelComponents of `FMT_COLOR_RGB`.

- If the glimg::Bitdepth is packed, and the glimg::PixelComponents does not include depth, and the glimg::PixelDataType is not `DT_SHARED_EXP_FLOAT`:

  - The glimg::PixelDataType must be either signed normalized, unsigned normalized, or floating point.
  - glimg::PixelComponents with 3 live components (the `X`s don't count) can only be used with glimg::Bitdepth's of `BD_PACKED_16_BIT_565`, `BD_PACKED_16_BIT_565_REV` or `BD_PACKED_32_BIT_101111_REV`.
  - glimg::PixelComponents with 4 live components can only be used with glimg::Bitdepth's that have 4 components.

- If the glimg::Bitdepth is `BD_PER_COMP_32`, then the glimg::PixelDataType must not be a normalized integer.

- The glimg::ComponentOrder `ORDER_BGRA` may only be used on glimg::PixelComponents with 3 or more components.