[Fix] (MG_Impl, MG_State, MG_Backend, MG_Util): Do source audit by Codex.

This commit is contained in:
BZLZHH
2026-06-09 15:34:19 +08:00
parent be3c3eb9bb
commit 727939af5b
93 changed files with 6019 additions and 731 deletions
@@ -72,6 +72,10 @@ namespace MobileGL {
}
String ConvertBufferMappingAccessToString(Flags<BufferMappingAccessBit> access) {
if (access == BufferMappingAccessBit::Null) {
return "[]";
}
String result = "[";
if (access & BufferMappingAccessBit::Read) result += "Read, ";
if (access & BufferMappingAccessBit::Write) result += "Write, ";
@@ -84,7 +88,7 @@ namespace MobileGL {
result.pop_back();
result.pop_back();
result += "]";
return result.empty() ? "[]" : result;
return result;
}
} // namespace MG_Util
} // namespace MobileGL
} // namespace MobileGL
@@ -29,6 +29,16 @@ namespace MobileGL {
}
switch (attachment) {
case FramebufferAttachmentType::None:
return "None";
case FramebufferAttachmentType::FrontLeft:
return "FrontLeft";
case FramebufferAttachmentType::FrontRight:
return "FrontRight";
case FramebufferAttachmentType::BackLeft:
return "BackLeft";
case FramebufferAttachmentType::BackRight:
return "BackRight";
case FramebufferAttachmentType::Depth:
return "Depth";
case FramebufferAttachmentType::Stencil:
@@ -49,4 +59,4 @@ namespace MobileGL {
}
}
} // namespace MG_Util
} // namespace MobileGL
} // namespace MobileGL
@@ -45,6 +45,45 @@ namespace MobileGL {
}
}
String ConvertLogicOperationToString(LogicOperation v) {
switch (v) {
case LogicOperation::Clear:
return "Clear";
case LogicOperation::And:
return "And";
case LogicOperation::AndReverse:
return "AndReverse";
case LogicOperation::Copy:
return "Copy";
case LogicOperation::AndInverted:
return "AndInverted";
case LogicOperation::Noop:
return "Noop";
case LogicOperation::Xor:
return "Xor";
case LogicOperation::Or:
return "Or";
case LogicOperation::Nor:
return "Nor";
case LogicOperation::Equiv:
return "Equiv";
case LogicOperation::Invert:
return "Invert";
case LogicOperation::OrReverse:
return "OrReverse";
case LogicOperation::CopyInverted:
return "CopyInverted";
case LogicOperation::OrInverted:
return "OrInverted";
case LogicOperation::Nand:
return "Nand";
case LogicOperation::Set:
return "Set";
default:
return "Unknown";
}
}
String ConvertDepthTestFuncToString(DepthTestFunc v) {
switch (v) {
case DepthTestFunc::Never:
@@ -68,6 +107,29 @@ namespace MobileGL {
}
}
String ConvertStencilOperationToString(StencilOperation v) {
switch (v) {
case StencilOperation::Keep:
return "Keep";
case StencilOperation::Zero:
return "Zero";
case StencilOperation::Replace:
return "Replace";
case StencilOperation::IncrementClamp:
return "IncrementClamp";
case StencilOperation::DecrementClamp:
return "DecrementClamp";
case StencilOperation::Invert:
return "Invert";
case StencilOperation::IncrementWrap:
return "IncrementWrap";
case StencilOperation::DecrementWrap:
return "DecrementWrap";
default:
return "Unknown";
}
}
String ConvertPixelStoreParamToString(PixelStoreParam v) {
switch (v) {
case PixelStoreParam::PackAlignment:
@@ -13,7 +13,9 @@
namespace MobileGL {
namespace MG_Util {
String ConvertBlendFactorToString(BlendFactor value);
String ConvertLogicOperationToString(LogicOperation value);
String ConvertDepthTestFuncToString(DepthTestFunc value);
String ConvertStencilOperationToString(StencilOperation value);
String ConvertPixelStoreParamToString(PixelStoreParam value);
String ConvertCullFaceModeToString(CullFaceMode value);
String ConvertFrontFaceModeToString(FrontFaceMode value);
@@ -110,6 +110,8 @@ namespace MobileGL {
return "RGB10";
case TextureInternalFormat::RGB12:
return "RGB12";
case TextureInternalFormat::RGB16:
return "RGB16";
case TextureInternalFormat::RGB16Snorm:
return "RGB16Snorm";
case TextureInternalFormat::RGBA2: