[Fix] (MG_Util/TextureMetrics, MG_State/Texture): reimplement TextureMetrics, attempting to fix glTexSubImage2D

This commit is contained in:
2025-10-28 10:17:56 +08:00
parent 507476d513
commit bd01e4f99d
3 changed files with 161 additions and 50 deletions
+10 -4
View File
@@ -4,9 +4,15 @@
namespace MobileGL {
namespace MG_Util {
SizeT GetTexturePixelSize(TextureInternalFormat internal);
SizeT GetTexturePixelDataTypeSize(TexturePixelDataType type);
SizeT CalculateTextureImageSize(TextureInternalFormat internalFormat, TexturePixelDataType pixelDataType,
IntVec3 size);
SizeT GetSizedInternalFormatSizeInBytes(TextureInternalFormat internal);
SizeT GetBaseInternalFormatComponentCount(TextureInternalFormat format);
SizeT GetSizedTexturePixelDataTypeSize(TexturePixelDataType type);
SizeT GetBaseTexturePixelDataTypeSize(TexturePixelDataType type);
// This should respect internal format more
SizeT GetInternalBytesPerPixel(TextureInternalFormat internalformat, TexturePixelDataType type);
// This should respect type more, representing data passed in
SizeT GetInputBytesPerPixel(TextureInternalFormat internalformat, TexturePixelDataType type);
SizeT CalculateInputTextureImageSize(TextureInternalFormat internalFormat, TexturePixelDataType pixelDataType,
IntVec3 size);
} // namespace MG_Util
} // namespace MobileGL