MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / glGetFormatSize

Function glGetFormatSize

lib/gl_format.h:1627–2436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1625}
1626
1627static inline void glGetFormatSize( const GLenum internalFormat, ktxFormatSize * pFormatSize )
1628{
1629 pFormatSize->minBlocksX = pFormatSize->minBlocksY = 1;
1630 switch ( internalFormat )
1631 {
1632 //
1633 // 8 bits per component
1634 //
1635 case GL_R8: // 1-component, 8-bit unsigned normalized
1636 case GL_R8_SNORM: // 1-component, 8-bit signed normalized
1637 case GL_R8UI: // 1-component, 8-bit unsigned integer
1638 case GL_R8I: // 1-component, 8-bit signed integer
1639 case GL_SR8: // 1-component, 8-bit sRGB
1640 pFormatSize->flags = 0;
1641 pFormatSize->paletteSizeInBits = 0;
1642 pFormatSize->blockSizeInBits = 1 * 8;
1643 pFormatSize->blockWidth = 1;
1644 pFormatSize->blockHeight = 1;
1645 pFormatSize->blockDepth = 1;
1646 break;
1647 case GL_RG8: // 2-component, 8-bit unsigned normalized
1648 case GL_RG8_SNORM: // 2-component, 8-bit signed normalized
1649 case GL_RG8UI: // 2-component, 8-bit unsigned integer
1650 case GL_RG8I: // 2-component, 8-bit signed integer
1651 case GL_SRG8: // 2-component, 8-bit sRGB
1652 pFormatSize->flags = 0;
1653 pFormatSize->paletteSizeInBits = 0;
1654 pFormatSize->blockSizeInBits = 2 * 8;
1655 pFormatSize->blockWidth = 1;
1656 pFormatSize->blockHeight = 1;
1657 pFormatSize->blockDepth = 1;
1658 break;
1659 case GL_RGB8: // 3-component, 8-bit unsigned normalized
1660 case GL_RGB8_SNORM: // 3-component, 8-bit signed normalized
1661 case GL_RGB8UI: // 3-component, 8-bit unsigned integer
1662 case GL_RGB8I: // 3-component, 8-bit signed integer
1663 case GL_SRGB8: // 3-component, 8-bit sRGB
1664 pFormatSize->flags = 0;
1665 pFormatSize->paletteSizeInBits = 0;
1666 pFormatSize->blockSizeInBits = 3 * 8;
1667 pFormatSize->blockWidth = 1;
1668 pFormatSize->blockHeight = 1;
1669 pFormatSize->blockDepth = 1;
1670 break;
1671 case GL_RGBA8: // 4-component, 8-bit unsigned normalized
1672 case GL_RGBA8_SNORM: // 4-component, 8-bit signed normalized
1673 case GL_RGBA8UI: // 4-component, 8-bit unsigned integer
1674 case GL_RGBA8I: // 4-component, 8-bit signed integer
1675 case GL_SRGB8_ALPHA8: // 4-component, 8-bit sRGB
1676 pFormatSize->flags = 0;
1677 pFormatSize->paletteSizeInBits = 0;
1678 pFormatSize->blockSizeInBits = 4 * 8;
1679 pFormatSize->blockWidth = 1;
1680 pFormatSize->blockHeight = 1;
1681 pFormatSize->blockDepth = 1;
1682 break;
1683
1684 //

Callers 2

ktxTexture1_constructFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected