mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Added R11G11B10F format.
This commit is contained in:
parent
3b73fb2063
commit
4fb802e405
9 changed files with 199 additions and 146 deletions
|
@ -112,6 +112,7 @@ typedef enum bgfx_texture_format
|
|||
BGFX_TEXTURE_FORMAT_RGBA4,
|
||||
BGFX_TEXTURE_FORMAT_RGB5A1,
|
||||
BGFX_TEXTURE_FORMAT_RGB10A2,
|
||||
BGFX_TEXTURE_FORMAT_R11G11B10F,
|
||||
|
||||
BGFX_TEXTURE_FORMAT_UNKNOWN_DEPTH,
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ namespace bgfx
|
|||
RGBA4,
|
||||
RGB5A1,
|
||||
RGB10A2,
|
||||
R11G11B10F,
|
||||
|
||||
UnknownDepth, // depth formats below
|
||||
|
||||
|
|
24
src/bgfx_p.h
24
src/bgfx_p.h
|
@ -140,8 +140,28 @@ namespace stl
|
|||
#define BGFX_RENDERER_NULL_NAME "NULL"
|
||||
|
||||
#if BGFX_CONFIG_RENDERER_OPENGL
|
||||
# if BGFX_CONFIG_RENDERER_OPENGL >= 31
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 3.1"
|
||||
# if BGFX_CONFIG_RENDERER_OPENGL >= 31 && BGFX_CONFIG_RENDERER_OPENGL <= 33
|
||||
# if BGFX_CONFIG_RENDERER_OPENGL == 31
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 3.1"
|
||||
# elif BGFX_CONFIG_RENDERER_OPENGL == 32
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 3.2"
|
||||
# else
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 3.3"
|
||||
# endif // 31+
|
||||
# elif BGFX_CONFIG_RENDERER_OPENGL >= 40 && BGFX_CONFIG_RENDERER_OPENGL <= 45
|
||||
# if BGFX_CONFIG_RENDERER_OPENGL == 40
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 4.0"
|
||||
# elif BGFX_CONFIG_RENDERER_OPENGL == 41
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 4.1"
|
||||
# elif BGFX_CONFIG_RENDERER_OPENGL == 42
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 4.2"
|
||||
# elif BGFX_CONFIG_RENDERER_OPENGL == 43
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 4.3"
|
||||
# elif BGFX_CONFIG_RENDERER_OPENGL == 44
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 4.4"
|
||||
# else
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 4.5"
|
||||
# endif // 40+
|
||||
# else
|
||||
# define BGFX_RENDERER_OPENGL_NAME "OpenGL 2.1"
|
||||
# endif // BGFX_CONFIG_RENDERER_OPENGL
|
||||
|
|
|
@ -192,8 +192,8 @@ namespace bgfx
|
|||
int32_t contextAttrs[9] =
|
||||
{
|
||||
#if BGFX_CONFIG_RENDERER_OPENGL >= 31
|
||||
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
|
||||
WGL_CONTEXT_MAJOR_VERSION_ARB, BGFX_CONFIG_RENDERER_OPENGL / 10,
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB, BGFX_CONFIG_RENDERER_OPENGL % 10,
|
||||
WGL_CONTEXT_FLAGS_ARB, flags,
|
||||
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
|
||||
#else
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace bgfx
|
|||
{ 16, 1, 1, 2 }, // RGBA4
|
||||
{ 16, 1, 1, 2 }, // RGB5A1
|
||||
{ 32, 1, 1, 4 }, // RGB10A2
|
||||
{ 32, 1, 1, 4 }, // R11G11B10F
|
||||
{ 0, 0, 0, 0 }, // UnknownDepth
|
||||
{ 16, 1, 1, 2 }, // D16
|
||||
{ 24, 1, 1, 3 }, // D24
|
||||
|
@ -64,53 +65,54 @@ namespace bgfx
|
|||
|
||||
static const char* s_textureFormatName[] =
|
||||
{
|
||||
"BC1", // BC1
|
||||
"BC2", // BC2
|
||||
"BC3", // BC3
|
||||
"BC4", // BC4
|
||||
"BC5", // BC5
|
||||
"BC6H", // BC6H
|
||||
"BC7", // BC7
|
||||
"ETC1", // ETC1
|
||||
"ETC2", // ETC2
|
||||
"ETC2A", // ETC2A
|
||||
"ETC2A1", // ETC2A1
|
||||
"PTC12", // PTC12
|
||||
"PTC14", // PTC14
|
||||
"PTC12A", // PTC12A
|
||||
"PTC14A", // PTC14A
|
||||
"PTC22", // PTC22
|
||||
"PTC24", // PTC24
|
||||
"<unknown>", // Unknown
|
||||
"R1", // R1
|
||||
"R8", // R8
|
||||
"R16", // R16
|
||||
"R16F", // R16F
|
||||
"R32", // R32
|
||||
"R32F", // R32F
|
||||
"RG8", // RG8
|
||||
"RG16", // RG16
|
||||
"RG16F", // RG16F
|
||||
"RG32", // RG32
|
||||
"RG32F", // RG32F
|
||||
"BGRA8", // BGRA8
|
||||
"RGBA16", // RGBA16
|
||||
"RGBA16F", // RGBA16F
|
||||
"RGBA32", // RGBA32
|
||||
"RGBA32F", // RGBA32F
|
||||
"R5G6B5", // R5G6B5
|
||||
"RGBA4", // RGBA4
|
||||
"RGB5A1", // RGB5A1
|
||||
"RGB10A2", // RGB10A2
|
||||
"<unknown>", // UnknownDepth
|
||||
"D16", // D16
|
||||
"D24", // D24
|
||||
"D24S8", // D24S8
|
||||
"D32", // D32
|
||||
"D16F", // D16F
|
||||
"D24F", // D24F
|
||||
"D32F", // D32F
|
||||
"D0S8", // D0S8
|
||||
"BC1", // BC1
|
||||
"BC2", // BC2
|
||||
"BC3", // BC3
|
||||
"BC4", // BC4
|
||||
"BC5", // BC5
|
||||
"BC6H", // BC6H
|
||||
"BC7", // BC7
|
||||
"ETC1", // ETC1
|
||||
"ETC2", // ETC2
|
||||
"ETC2A", // ETC2A
|
||||
"ETC2A1", // ETC2A1
|
||||
"PTC12", // PTC12
|
||||
"PTC14", // PTC14
|
||||
"PTC12A", // PTC12A
|
||||
"PTC14A", // PTC14A
|
||||
"PTC22", // PTC22
|
||||
"PTC24", // PTC24
|
||||
"<unknown>", // Unknown
|
||||
"R1", // R1
|
||||
"R8", // R8
|
||||
"R16", // R16
|
||||
"R16F", // R16F
|
||||
"R32", // R32
|
||||
"R32F", // R32F
|
||||
"RG8", // RG8
|
||||
"RG16", // RG16
|
||||
"RG16F", // RG16F
|
||||
"RG32", // RG32
|
||||
"RG32F", // RG32F
|
||||
"BGRA8", // BGRA8
|
||||
"RGBA16", // RGBA16
|
||||
"RGBA16F", // RGBA16F
|
||||
"RGBA32", // RGBA32
|
||||
"RGBA32F", // RGBA32F
|
||||
"R5G6B5", // R5G6B5
|
||||
"RGBA4", // RGBA4
|
||||
"RGB5A1", // RGB5A1
|
||||
"RGB10A2", // RGB10A2
|
||||
"R11G11B10F", // R11G11B10F
|
||||
"<unknown>", // UnknownDepth
|
||||
"D16", // D16
|
||||
"D24", // D24
|
||||
"D24S8", // D24S8
|
||||
"D32", // D32
|
||||
"D16F", // D16F
|
||||
"D24F", // D24F
|
||||
"D32F", // D32F
|
||||
"D0S8", // D0S8
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormatName) );
|
||||
|
||||
|
|
|
@ -237,6 +237,7 @@ namespace bgfx
|
|||
{ DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN }, // RGBA4
|
||||
{ DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN }, // RGB5A1
|
||||
{ DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN }, // RGB10A2
|
||||
{ DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN }, // R11G11B10F
|
||||
{ DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // UnknownDepth
|
||||
{ DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM }, // D16
|
||||
{ DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT }, // D24
|
||||
|
|
|
@ -223,6 +223,7 @@ namespace bgfx
|
|||
{ D3DFMT_A4R4G4B4 }, // RGBA4
|
||||
{ D3DFMT_A1R5G5B5 }, // RGB5A1
|
||||
{ D3DFMT_A2B10G10R10 }, // RGB10A2
|
||||
{ D3DFMT_UNKNOWN }, // R11G11B10F
|
||||
{ D3DFMT_UNKNOWN }, // UnknownDepth
|
||||
{ D3DFMT_D16 }, // D16
|
||||
{ D3DFMT_D24X8 }, // D24
|
||||
|
|
|
@ -180,105 +180,107 @@ namespace bgfx
|
|||
|
||||
static TextureFormatInfo s_textureFormat[] =
|
||||
{
|
||||
{ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_ZERO, false }, // BC1
|
||||
{ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_ZERO, false }, // BC2
|
||||
{ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_ZERO, false }, // BC3
|
||||
{ GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, false }, // BC4
|
||||
{ GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, false }, // BC5
|
||||
{ GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, false }, // BC6H
|
||||
{ GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, false }, // BC7
|
||||
{ GL_ETC1_RGB8_OES, GL_ETC1_RGB8_OES, GL_ZERO, false }, // ETC1
|
||||
{ GL_COMPRESSED_RGB8_ETC2, GL_COMPRESSED_RGB8_ETC2, GL_ZERO, false }, // ETC2
|
||||
{ GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_ZERO, false }, // ETC2A
|
||||
{ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_ZERO, false }, // ETC2A1
|
||||
{ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12
|
||||
{ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12A
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14A
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, false }, // PTC22
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24
|
||||
{ GL_ZERO, GL_ZERO, GL_ZERO, true }, // Unknown
|
||||
{ GL_ZERO, GL_ZERO, GL_ZERO, true }, // R1
|
||||
{ GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, true }, // R8
|
||||
{ GL_R16, GL_RED, GL_UNSIGNED_SHORT, true }, // R16
|
||||
{ GL_R16F, GL_RED, GL_HALF_FLOAT, true }, // R16F
|
||||
{ GL_R32UI, GL_RED, GL_UNSIGNED_INT, true }, // R32
|
||||
{ GL_R32F, GL_RED, GL_FLOAT, true }, // R32F
|
||||
{ GL_RG8, GL_RG, GL_UNSIGNED_BYTE, true }, // RG8
|
||||
{ GL_RG16, GL_RG, GL_UNSIGNED_SHORT, true }, // RG16
|
||||
{ GL_RG16F, GL_RG, GL_FLOAT, true }, // RG16F
|
||||
{ GL_RG32UI, GL_RG, GL_UNSIGNED_INT, true }, // RG32
|
||||
{ GL_RG32F, GL_RG, GL_FLOAT, true }, // RG32F
|
||||
{ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, true }, // BGRA8
|
||||
{ GL_RGBA16, GL_RGBA, GL_UNSIGNED_BYTE, true }, // RGBA16
|
||||
{ GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, true }, // RGBA16F
|
||||
{ GL_RGBA32UI, GL_RGBA, GL_UNSIGNED_INT, true }, // RGBA32
|
||||
{ GL_RGBA32F, GL_RGBA, GL_FLOAT, true }, // RGBA32F
|
||||
{ GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, true }, // R5G6B5
|
||||
{ GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, true }, // RGBA4
|
||||
{ GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, true }, // RGB5A1
|
||||
{ GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, true }, // RGB10A2
|
||||
{ GL_ZERO, GL_ZERO, GL_ZERO, true }, // UnknownDepth
|
||||
{ GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false }, // D16
|
||||
{ GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D24
|
||||
{ GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false }, // D24S8
|
||||
{ GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D32
|
||||
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D16F
|
||||
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D24F
|
||||
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D32F
|
||||
{ GL_STENCIL_INDEX8, GL_DEPTH_STENCIL, GL_UNSIGNED_BYTE, false }, // D0S8
|
||||
{ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_ZERO, false }, // BC1
|
||||
{ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_ZERO, false }, // BC2
|
||||
{ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_ZERO, false }, // BC3
|
||||
{ GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, false }, // BC4
|
||||
{ GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, false }, // BC5
|
||||
{ GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, false }, // BC6H
|
||||
{ GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, false }, // BC7
|
||||
{ GL_ETC1_RGB8_OES, GL_ETC1_RGB8_OES, GL_ZERO, false }, // ETC1
|
||||
{ GL_COMPRESSED_RGB8_ETC2, GL_COMPRESSED_RGB8_ETC2, GL_ZERO, false }, // ETC2
|
||||
{ GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_ZERO, false }, // ETC2A
|
||||
{ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_ZERO, false }, // ETC2A1
|
||||
{ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12
|
||||
{ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12A
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14A
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, false }, // PTC22
|
||||
{ GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24
|
||||
{ GL_ZERO, GL_ZERO, GL_ZERO, true }, // Unknown
|
||||
{ GL_ZERO, GL_ZERO, GL_ZERO, true }, // R1
|
||||
{ GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, true }, // R8
|
||||
{ GL_R16, GL_RED, GL_UNSIGNED_SHORT, true }, // R16
|
||||
{ GL_R16F, GL_RED, GL_HALF_FLOAT, true }, // R16F
|
||||
{ GL_R32UI, GL_RED, GL_UNSIGNED_INT, true }, // R32
|
||||
{ GL_R32F, GL_RED, GL_FLOAT, true }, // R32F
|
||||
{ GL_RG8, GL_RG, GL_UNSIGNED_BYTE, true }, // RG8
|
||||
{ GL_RG16, GL_RG, GL_UNSIGNED_SHORT, true }, // RG16
|
||||
{ GL_RG16F, GL_RG, GL_FLOAT, true }, // RG16F
|
||||
{ GL_RG32UI, GL_RG, GL_UNSIGNED_INT, true }, // RG32
|
||||
{ GL_RG32F, GL_RG, GL_FLOAT, true }, // RG32F
|
||||
{ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, true }, // BGRA8
|
||||
{ GL_RGBA16, GL_RGBA, GL_UNSIGNED_BYTE, true }, // RGBA16
|
||||
{ GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, true }, // RGBA16F
|
||||
{ GL_RGBA32UI, GL_RGBA, GL_UNSIGNED_INT, true }, // RGBA32
|
||||
{ GL_RGBA32F, GL_RGBA, GL_FLOAT, true }, // RGBA32F
|
||||
{ GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, true }, // R5G6B5
|
||||
{ GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, true }, // RGBA4
|
||||
{ GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, true }, // RGB5A1
|
||||
{ GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, true }, // RGB10A2
|
||||
{ GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, true }, // R11G11B10F
|
||||
{ GL_ZERO, GL_ZERO, GL_ZERO, true }, // UnknownDepth
|
||||
{ GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false }, // D16
|
||||
{ GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D24
|
||||
{ GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false }, // D24S8
|
||||
{ GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D32
|
||||
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D16F
|
||||
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D24F
|
||||
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D32F
|
||||
{ GL_STENCIL_INDEX8, GL_DEPTH_STENCIL, GL_UNSIGNED_BYTE, false }, // D0S8
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
|
||||
static GLenum s_imageFormat[] =
|
||||
{
|
||||
GL_ZERO, // BC1
|
||||
GL_ZERO, // BC2
|
||||
GL_ZERO, // BC3
|
||||
GL_ZERO, // BC4
|
||||
GL_ZERO, // BC5
|
||||
GL_ZERO, // BC6H
|
||||
GL_ZERO, // BC7
|
||||
GL_ZERO, // ETC1
|
||||
GL_ZERO, // ETC2
|
||||
GL_ZERO, // ETC2A
|
||||
GL_ZERO, // ETC2A1
|
||||
GL_ZERO, // PTC12
|
||||
GL_ZERO, // PTC14
|
||||
GL_ZERO, // PTC12A
|
||||
GL_ZERO, // PTC14A
|
||||
GL_ZERO, // PTC22
|
||||
GL_ZERO, // PTC24
|
||||
GL_ZERO, // Unknown
|
||||
GL_ZERO, // R1
|
||||
GL_R8, // R8
|
||||
GL_R16, // R16
|
||||
GL_R16F, // R16F
|
||||
GL_R32UI, // R32
|
||||
GL_R32F, // R32F
|
||||
GL_RG8, // RG8
|
||||
GL_RG16, // RG16
|
||||
GL_RG16F, // RG16F
|
||||
GL_RG32UI, // RG32
|
||||
GL_RG32F, // RG32F
|
||||
GL_RGBA8, // BGRA8
|
||||
GL_RGBA16, // RGBA16
|
||||
GL_RGBA16F, // RGBA16F
|
||||
GL_RGBA32UI, // RGBA32
|
||||
GL_RGBA32F, // RGBA32F
|
||||
GL_RGB565, // R5G6B5
|
||||
GL_RGBA4, // RGBA4
|
||||
GL_RGB5_A1, // RGB5A1
|
||||
GL_RGB10_A2, // RGB10A2
|
||||
GL_ZERO, // UnknownDepth
|
||||
GL_ZERO, // D16
|
||||
GL_ZERO, // D24
|
||||
GL_ZERO, // D24S8
|
||||
GL_ZERO, // D32
|
||||
GL_ZERO, // D16F
|
||||
GL_ZERO, // D24F
|
||||
GL_ZERO, // D32F
|
||||
GL_ZERO, // D0S8
|
||||
GL_ZERO, // BC1
|
||||
GL_ZERO, // BC2
|
||||
GL_ZERO, // BC3
|
||||
GL_ZERO, // BC4
|
||||
GL_ZERO, // BC5
|
||||
GL_ZERO, // BC6H
|
||||
GL_ZERO, // BC7
|
||||
GL_ZERO, // ETC1
|
||||
GL_ZERO, // ETC2
|
||||
GL_ZERO, // ETC2A
|
||||
GL_ZERO, // ETC2A1
|
||||
GL_ZERO, // PTC12
|
||||
GL_ZERO, // PTC14
|
||||
GL_ZERO, // PTC12A
|
||||
GL_ZERO, // PTC14A
|
||||
GL_ZERO, // PTC22
|
||||
GL_ZERO, // PTC24
|
||||
GL_ZERO, // Unknown
|
||||
GL_ZERO, // R1
|
||||
GL_R8, // R8
|
||||
GL_R16, // R16
|
||||
GL_R16F, // R16F
|
||||
GL_R32UI, // R32
|
||||
GL_R32F, // R32F
|
||||
GL_RG8, // RG8
|
||||
GL_RG16, // RG16
|
||||
GL_RG16F, // RG16F
|
||||
GL_RG32UI, // RG32
|
||||
GL_RG32F, // RG32F
|
||||
GL_RGBA8, // BGRA8
|
||||
GL_RGBA16, // RGBA16
|
||||
GL_RGBA16F, // RGBA16F
|
||||
GL_RGBA32UI, // RGBA32
|
||||
GL_RGBA32F, // RGBA32F
|
||||
GL_RGB565, // R5G6B5
|
||||
GL_RGBA4, // RGBA4
|
||||
GL_RGB5_A1, // RGB5A1
|
||||
GL_RGB10_A2, // RGB10A2
|
||||
GL_R11F_G11F_B10F, // R11G11B10F
|
||||
GL_ZERO, // UnknownDepth
|
||||
GL_ZERO, // D16
|
||||
GL_ZERO, // D24
|
||||
GL_ZERO, // D24S8
|
||||
GL_ZERO, // D32
|
||||
GL_ZERO, // D16F
|
||||
GL_ZERO, // D24F
|
||||
GL_ZERO, // D32F
|
||||
GL_ZERO, // D0S8
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageFormat) );
|
||||
|
||||
|
@ -286,6 +288,8 @@ namespace bgfx
|
|||
{
|
||||
enum Enum
|
||||
{
|
||||
AMD_conservative_depth,
|
||||
|
||||
ANGLE_depth_texture,
|
||||
ANGLE_framebuffer_blit,
|
||||
ANGLE_framebuffer_multisample,
|
||||
|
@ -299,10 +303,13 @@ namespace bgfx
|
|||
APPLE_texture_max_level,
|
||||
|
||||
ARB_compute_shader,
|
||||
ARB_conservative_depth,
|
||||
ARB_debug_label,
|
||||
ARB_debug_output,
|
||||
ARB_depth_buffer_float,
|
||||
ARB_depth_clamp,
|
||||
ARB_draw_buffers_blend,
|
||||
ARB_draw_instanced,
|
||||
ARB_ES3_compatibility,
|
||||
ARB_framebuffer_object,
|
||||
ARB_framebuffer_sRGB,
|
||||
|
@ -312,9 +319,12 @@ namespace bgfx
|
|||
ARB_instanced_arrays,
|
||||
ARB_map_buffer_range,
|
||||
ARB_multisample,
|
||||
ARB_occlusion_query,
|
||||
ARB_occlusion_query2,
|
||||
ARB_program_interface_query,
|
||||
ARB_sampler_objects,
|
||||
ARB_seamless_cube_map,
|
||||
ARB_shader_bit_encoding,
|
||||
ARB_shader_image_load_store,
|
||||
ARB_shader_storage_buffer_object,
|
||||
ARB_shader_texture_lod,
|
||||
|
@ -351,6 +361,7 @@ namespace bgfx
|
|||
EXT_framebuffer_object,
|
||||
EXT_framebuffer_sRGB,
|
||||
EXT_occlusion_query_boolean,
|
||||
EXT_packed_float,
|
||||
EXT_read_format_bgra,
|
||||
EXT_shader_image_load_store,
|
||||
EXT_shader_texture_lod,
|
||||
|
@ -432,6 +443,8 @@ namespace bgfx
|
|||
|
||||
static Extension s_extension[Extension::Count] =
|
||||
{
|
||||
{ "AMD_conservative_depth", false, true },
|
||||
|
||||
{ "ANGLE_depth_texture", false, true },
|
||||
{ "ANGLE_framebuffer_blit", false, true },
|
||||
{ "ANGLE_framebuffer_multisample", false, false },
|
||||
|
@ -445,10 +458,13 @@ namespace bgfx
|
|||
{ "APPLE_texture_max_level", false, true },
|
||||
|
||||
{ "ARB_compute_shader", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
||||
{ "ARB_conservative_depth", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
||||
{ "ARB_debug_label", false, true },
|
||||
{ "ARB_debug_output", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
||||
{ "ARB_depth_buffer_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_depth_clamp", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
||||
{ "ARB_draw_buffers_blend", BGFX_CONFIG_RENDERER_OPENGL >= 40, true },
|
||||
{ "ARB_draw_instanced", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_ES3_compatibility", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
||||
{ "ARB_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
||||
{ "ARB_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
||||
|
@ -458,9 +474,12 @@ namespace bgfx
|
|||
{ "ARB_instanced_arrays", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_map_buffer_range", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
||||
{ "ARB_multisample", false, true },
|
||||
{ "ARB_occlusion_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_occlusion_query2", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_program_interface_query", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
||||
{ "ARB_sampler_objects", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_seamless_cube_map", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
||||
{ "ARB_shader_bit_encoding", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_shader_image_load_store", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
||||
{ "ARB_shader_storage_buffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
||||
{ "ARB_shader_texture_lod", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
||||
|
@ -497,6 +516,7 @@ namespace bgfx
|
|||
{ "EXT_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
||||
{ "EXT_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
||||
{ "EXT_occlusion_query_boolean", false, true },
|
||||
{ "EXT_packed_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "EXT_read_format_bgra", false, true },
|
||||
{ "EXT_shader_image_load_store", false, true },
|
||||
{ "EXT_shader_texture_lod", false, true }, // GLES2 extension.
|
||||
|
@ -4812,7 +4832,6 @@ namespace bgfx
|
|||
|
||||
GLint totalAvail;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &totalAvail) );
|
||||
|
||||
GLint currAvail;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &currAvail) );
|
||||
|
||||
|
|
|
@ -191,6 +191,14 @@ typedef uint64_t GLuint64;
|
|||
# define GL_RGBA16UI 0x8D76
|
||||
#endif // GL_RGBA16UI
|
||||
|
||||
#ifndef GL_R11F_G11F_B10F
|
||||
# define GL_R11F_G11F_B10F 0x8C3A
|
||||
#endif // GL_R11F_G11F_B10F
|
||||
|
||||
#ifndef GL_UNSIGNED_INT_10F_11F_11F_REV
|
||||
# define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
|
||||
#endif // GL_UNSIGNED_INT_10F_11F_11F_REV
|
||||
|
||||
#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
|
||||
# define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#endif // GL_COMPRESSED_RGB_S3TC_DXT1_EXT
|
||||
|
|
Loading…
Reference in a new issue