mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
Added RG8 texture format.
This commit is contained in:
parent
c2c1f42ecc
commit
ac49c6f129
8 changed files with 16 additions and 2 deletions
|
@ -94,6 +94,7 @@ typedef enum bgfx_texture_format
|
|||
BGFX_TEXTURE_FORMAT_R16F,
|
||||
BGFX_TEXTURE_FORMAT_R32,
|
||||
BGFX_TEXTURE_FORMAT_R32F,
|
||||
BGFX_TEXTURE_FORMAT_RG8,
|
||||
BGFX_TEXTURE_FORMAT_RG16,
|
||||
BGFX_TEXTURE_FORMAT_RG16F,
|
||||
BGFX_TEXTURE_FORMAT_RG32,
|
||||
|
|
|
@ -126,6 +126,7 @@ namespace bgfx
|
|||
R16F,
|
||||
R32,
|
||||
R32F,
|
||||
RG8,
|
||||
RG16,
|
||||
RG16F,
|
||||
RG32,
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace bgfx
|
|||
{ 16, 1, 1, 2 }, // R16F
|
||||
{ 32, 1, 1, 4 }, // R32
|
||||
{ 32, 1, 1, 4 }, // R32F
|
||||
{ 16, 1, 1, 2 }, // RG8
|
||||
{ 32, 1, 1, 4 }, // RG16
|
||||
{ 32, 1, 1, 4 }, // RG16F
|
||||
{ 64, 1, 1, 8 }, // RG32
|
||||
|
@ -81,6 +82,7 @@ namespace bgfx
|
|||
"R16F", // R16F
|
||||
"R32", // R32
|
||||
"R32F", // R32F
|
||||
"RG8", // RG8
|
||||
"RG16", // RG16
|
||||
"RG16F", // RG16F
|
||||
"RG32", // RG32
|
||||
|
|
|
@ -220,6 +220,7 @@ namespace bgfx
|
|||
{ DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN }, // R16F
|
||||
{ DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN }, // R32
|
||||
{ DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN }, // R32F
|
||||
{ DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_UNKNOWN }, // RG8
|
||||
{ DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_UNKNOWN }, // RG16
|
||||
{ DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_UNKNOWN }, // RG16F
|
||||
{ DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN }, // RG32
|
||||
|
|
|
@ -206,6 +206,7 @@ namespace bgfx
|
|||
{ D3DFMT_R16F }, // R16F
|
||||
{ D3DFMT_UNKNOWN }, // R32
|
||||
{ D3DFMT_R32F }, // R32F
|
||||
{ D3DFMT_A8L8 }, // RG8
|
||||
{ D3DFMT_G16R16 }, // RG16
|
||||
{ D3DFMT_G16R16F }, // RG16F
|
||||
{ D3DFMT_UNKNOWN }, // RG32
|
||||
|
|
|
@ -199,6 +199,7 @@ namespace bgfx
|
|||
{ 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
|
||||
|
@ -247,6 +248,7 @@ namespace bgfx
|
|||
GL_R16F, // R16F
|
||||
GL_R32UI, // R32
|
||||
GL_R32F, // R32F
|
||||
GL_RG8, // RG8
|
||||
GL_RG16, // RG16
|
||||
GL_RG16F, // RG16F
|
||||
GL_RG32UI, // RG32
|
||||
|
@ -347,6 +349,7 @@ namespace bgfx
|
|||
EXT_texture_compression_s3tc,
|
||||
EXT_texture_filter_anisotropic,
|
||||
EXT_texture_format_BGRA8888,
|
||||
EXT_texture_rg,
|
||||
EXT_texture_sRGB,
|
||||
EXT_texture_storage,
|
||||
EXT_texture_swizzle,
|
||||
|
@ -487,6 +490,7 @@ namespace bgfx
|
|||
{ "EXT_texture_compression_s3tc", false, true },
|
||||
{ "EXT_texture_filter_anisotropic", false, true },
|
||||
{ "EXT_texture_format_BGRA8888", false, true },
|
||||
{ "EXT_texture_rg", false, true }, // GLES2 extension.
|
||||
{ "EXT_texture_sRGB", false, true },
|
||||
{ "EXT_texture_storage", false, true },
|
||||
{ "EXT_texture_swizzle", false, true },
|
||||
|
|
|
@ -115,6 +115,10 @@ typedef uint64_t GLuint64;
|
|||
# define GL_R32F 0x822E
|
||||
#endif // GL_R32F
|
||||
|
||||
#ifndef GL_RG8
|
||||
# define GL_RG8 0x822B
|
||||
#endif // GL_RG8
|
||||
|
||||
#ifndef GL_RG16
|
||||
# define GL_RG16 0x822C
|
||||
#endif // GL_RG16
|
||||
|
|
|
@ -558,7 +558,7 @@ void strreplace(char* _str, const char* _find, const char* _replace)
|
|||
|
||||
char* replace = (char*)alloca(len+1);
|
||||
bx::strlcpy(replace, _replace, len+1);
|
||||
for (uint32_t ii = strlen(replace); ii < len; ++ii)
|
||||
for (size_t ii = strlen(replace); ii < len; ++ii)
|
||||
{
|
||||
replace[ii] = ' ';
|
||||
}
|
||||
|
@ -2052,7 +2052,7 @@ int main(int _argc, const char* _argv[])
|
|||
preprocessor.run(input);
|
||||
delete [] data;
|
||||
|
||||
size = preprocessor.m_preprocessed.size();
|
||||
size = (uint32_t)preprocessor.m_preprocessed.size();
|
||||
data = new char[size+padding+1];
|
||||
memcpy(data, preprocessor.m_preprocessed.c_str(), size);
|
||||
memset(&data[size], 0, padding+1);
|
||||
|
|
Loading…
Reference in a new issue