GL_RGBA32F GL backend support (#1034)

* Added GL_RGBA32F_EXT for GL backend to support floating point textures.

* Committing genbindings changes

* Added fp texture constant to mtl.

Co-authored-by: solan-solan <solan-solan@users.noreply.github.com>
This commit is contained in:
solan-solan 2023-01-19 17:10:41 +03:00 committed by GitHub
parent 5857874885
commit 64034df2ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 3 deletions

View File

@ -136,6 +136,8 @@ enum class PixelFormat : uint32_t
LA8,
//!!!Please append normal pixel format
//! 32-bit texture: RGBA8888
RGBA32F,
/* below is depth compression format */
// A packed 32-bit combined depth and stencil pixel format with two nomorlized unsigned integer

View File

@ -72,6 +72,7 @@ static const PixelFormatDescriptor s_pixelFormatDescriptors[] = {
{8, 1, 1, 1, 1, 1, true, "A8"}, // A8
{8, 1, 1, 1, 1, 1, false, "L8"}, // L8
{16, 1, 1, 2, 1, 1, true, "LA8"}, // LA8
{128, 1, 1, 4, 1, 1, true, "RGBA32F"}, // RGBA32F
#if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS)
{32, 1, 1, 4, 1, 1, false, "D24S8"}, // D24S8
#else

View File

@ -107,6 +107,7 @@ static GPUTextureFormatInfo s_textureFormats[] = {
{MTLPixelFormatA8Unorm, MTLPixelFormatInvalid}, // A8
{MTLPixelFormatInvalid, MTLPixelFormatInvalid}, // L8
{MTLPixelFormatInvalid, MTLPixelFormatInvalid}, // LA8
{MTLPixelFormatRGBA32Float, MTLPixelFormatInvalid}, // RGBA32F
/* depth stencil */
{MTLPixelFormat(255 /*Depth24Unorm_Stencil8*/), MTLPixelFormatInvalid}, // D24S8

View File

@ -88,6 +88,7 @@ static GPUTextureFormatInfo s_textureFormats[] =
{ GL_ALPHA, GL_ALPHA, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, }, // A8
{ GL_LUMINANCE, GL_SLUMINANCE, GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, }, // L8
{ GL_LUMINANCE_ALPHA, GL_SLUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, }, // LA8
{ GL_RGBA32F_EXT, GL_ZERO, GL_RGBA, GL_ZERO, GL_FLOAT, }, // RGBA32F
/* depth stencil internalFormat | internalFormatSrgb | format | formatSrgb | type */
#if defined(AX_USE_GLES)

View File

@ -112,8 +112,9 @@ int lua_register_ax_backend_PixelFormat(lua_State* tolua_S)
tolua_constant(tolua_S, "A8", 26);
tolua_constant(tolua_S, "L8", 27);
tolua_constant(tolua_S, "LA8", 28);
tolua_constant(tolua_S, "D24S8", 29);
tolua_constant(tolua_S, "COUNT", 30);
tolua_constant(tolua_S, "RGBA32F", 29);
tolua_constant(tolua_S, "D24S8", 30);
tolua_constant(tolua_S, "COUNT", 31);
tolua_constant(tolua_S, "NONE", 65535);
tolua_endmodule(tolua_S);