mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
18 lines
629 B
C#
18 lines
629 B
C#
namespace Brutal.KtxApi.Abstractions;
|
|
|
|
public static class GpuUploadUtils
|
|
{
|
|
public static bool IsRowSize4BytePadded(KtxTextureHandle textureHandle, int level)
|
|
{
|
|
if (textureHandle.ClassId == ClassId.Texture2C)
|
|
return false;
|
|
|
|
// Catches compressed textures (All multiple of 4 in element size), and uncompressed with 4 byte elements
|
|
if (textureHandle.GetElementSize() % 4 == 0)
|
|
return false;
|
|
|
|
var levelPixelWidth = textureHandle.BaseWidth >> level;
|
|
|
|
return textureHandle.GetRowPitch((uint)level) != textureHandle.GetElementSize() * levelPixelWidth;
|
|
}
|
|
}
|