Helpers for Texture byte size and ResourceFormat

public Methods

MakeResourceFormat(MTL::PixelFormat format);
GetByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat format, uint32_t mip);

private helper Methods

IsOneComponent(MTL::PixelFormat mtlFormat);
IsTwoComponent(MTL::PixelFormat mtlFormat);
IsThreeComponent(MTL::PixelFormat mtlFormat);
IsFourComponent(MTL::PixelFormat mtlFormat);
IsBlockFormat(MTL::PixelFormat mtlFormat);
IsDepthOrStencilFormat(MTL::PixelFormat mtlFormat);
IsUNormFormat(MTL::PixelFormat mtlFormat);
IsSNormFormat(MTL::PixelFormat mtlFormat);
IsFloatFormat(MTL::PixelFormat mtlFormat);
IsUIntFormat(MTL::PixelFormat mtlFormat);
IsSIntFormat(MTL::PixelFormat mtlFormat);
IsSRGBFormat(MTL::PixelFormat mtlFormat);
IsYUVFormat(MTL::PixelFormat format);
GetBlockShape(MTL::PixelFormat format, uint32_t plane);
GetPlaneByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat format, uint32_t mip, uint32_t plane);
This commit is contained in:
Jake Turner
2022-06-24 06:29:17 +01:00
committed by Baldur Karlsson
parent 5096d0244d
commit b6787686d3
2 changed files with 1090 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+3
View File
@@ -303,3 +303,6 @@ DECLARE_REFLECTION_ENUM(MetalChunk);
BlendMultiplier MakeBlendMultiplier(MTL::BlendFactor blend);
BlendOperation MakeBlendOp(MTL::BlendOperation op);
byte MakeWriteMask(MTL::ColorWriteMask mask);
ResourceFormat MakeResourceFormat(MTL::PixelFormat mtlFormat);
uint32_t GetByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat mtlFormat,
uint32_t mip);