Skip to content

Commit

Permalink
[OpenGL] Tweak FORMAT_RGB8_ETC2 detection / use
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 28, 2023
1 parent fc01de1 commit fef226b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/ivis_opengl/gfx_api_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3737,12 +3737,14 @@ void gl_context::initPixelFormatsSupport()
// GL_ARB_ES3_compatibility makes no claims about support in glCompressedTex*Image3D?
bool canSupport2DTextureArrays = (gles && GLAD_GL_ES_VERSION_3_0);

PIXEL_2D_FORMAT_SUPPORT_SET(gfx_api::pixel_format::FORMAT_RGB8_ETC2)
if (canSupport2DTextureArrays)
if (gles || !textureFormatIsSupported(gfx_api::pixel_format_target::texture_2d, gfx_api::pixel_format::FORMAT_RGB_BC1_UNORM, gfx_api::pixel_format_usage::sampled_image))
{
PIXEL_2D_TEXTURE_ARRAY_FORMAT_SUPPORT_SET(gfx_api::pixel_format::FORMAT_RGB8_ETC2)
PIXEL_2D_FORMAT_SUPPORT_SET(gfx_api::pixel_format::FORMAT_RGB8_ETC2)
if (canSupport2DTextureArrays)
{
PIXEL_2D_TEXTURE_ARRAY_FORMAT_SUPPORT_SET(gfx_api::pixel_format::FORMAT_RGB8_ETC2)
}
}

if (gles || !textureFormatIsSupported(gfx_api::pixel_format_target::texture_2d, gfx_api::pixel_format::FORMAT_RGBA_BC3_UNORM, gfx_api::pixel_format_usage::sampled_image))
{
PIXEL_2D_FORMAT_SUPPORT_SET(gfx_api::pixel_format::FORMAT_RGBA8_ETC2_EAC)
Expand Down

0 comments on commit fef226b

Please sign in to comment.