1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Implement support for array textures in GL driver

note: feature detection was not implemented in the legacy driver, but the code itself probably works.
This commit is contained in:
sfan5 2025-04-06 22:16:17 +02:00
parent d5bf094f9a
commit 46db688cc8
14 changed files with 111 additions and 72 deletions

View file

@ -124,6 +124,7 @@ void COpenGLES2Driver::initFeatures()
AnisotropicFilterSupported = queryExtension("GL_EXT_texture_filter_anisotropic");
BlendMinMaxSupported = (Version.Major >= 3) || FeatureAvailable[IRR_GL_EXT_blend_minmax];
TextureMultisampleSupported = isVersionAtLeast(3, 1);
Texture2DArraySupported = Version.Major >= 3 || queryExtension("GL_EXT_texture_array");
KHRDebugSupported = queryExtension("GL_KHR_debug");
if (KHRDebugSupported)
MaxLabelLength = GetInteger(GL.MAX_LABEL_LENGTH);
@ -145,6 +146,8 @@ void COpenGLES2Driver::initFeatures()
if (Version.Major >= 3 || queryExtension("GL_EXT_draw_range_elements"))
MaxIndices = GetInteger(GL_MAX_ELEMENTS_INDICES);
MaxTextureSize = GetInteger(GL_MAX_TEXTURE_SIZE);
if (Texture2DArraySupported)
MaxArrayTextureLayers = GetInteger(GL_MAX_ARRAY_TEXTURE_LAYERS);
if (LODBiasSupported)
GL.GetFloatv(GL_MAX_TEXTURE_LOD_BIAS, &MaxTextureLODBias);
GL.GetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, DimAliasedLine);