From 02a2f4af4ae6408dfad91ff64b34b8460d1564b8 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 15 Dec 2025 12:35:24 +0800 Subject: [PATCH] [Feat] (MG_Impl/Texture): accept `GL_TEXTURE_LOD_BIAS` at frontend --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index b81b013e..35ac976f 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -8,6 +8,7 @@ #include "Validators.h" #include "ProxyTexture.h" #include "MG_State/GLState/TextureState/TextureObjectBuffer.h" +#include "MG_Util/Converters/GLToStr/GLEnumConverter.h" #include #include @@ -219,14 +220,17 @@ namespace MobileGL { textureObject->GetSamplerObject()->SetSamplerCompareFunc( MG_Util::ConvertGLEnumToSamplerCompareFunc(param)); break; + case GL_TEXTURE_LOD_BIAS: + textureObject->GetSamplerObject()->SetLodBias(param); + break; case GL_TEXTURE_SWIZZLE_RGBA: // Not supported in this function case GL_TEXTURE_BORDER_COLOR: // Not supported in this function default: MG_State::pGLContext->RecordError( - ErrorCode::InvalidEnum, MakeShared("MG_Impl/GLImpl", "TexParameteri_State", - "pname is not a valid texture parameter.")); + ErrorCode::InvalidEnum, MakeShared("MG_Impl/GLImpl", __func__, + std::format("pname {} is not a valid texture parameter.", MG_Util::ConvertGLEnumToString(pname)))); return; } } @@ -291,14 +295,17 @@ namespace MobileGL { textureObject->GetSamplerObject()->SetSamplerCompareFunc( MG_Util::ConvertGLEnumToSamplerCompareFunc(param)); break; + case GL_TEXTURE_LOD_BIAS: + textureObject->GetSamplerObject()->SetLodBias((GLfloat)param); + break; case GL_TEXTURE_SWIZZLE_RGBA: // Not supported in this function case GL_TEXTURE_BORDER_COLOR: // Not supported in this function default: MG_State::pGLContext->RecordError( - ErrorCode::InvalidEnum, MakeShared("MG_Impl/GLImpl", "TexParameteri_State", - "pname is not a valid texture parameter.")); + ErrorCode::InvalidEnum, MakeShared("MG_Impl/GLImpl", __func__, + std::format("pname {} is not a valid texture parameter.", MG_Util::ConvertGLEnumToString(pname)))); return; } }