mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-29 14:38:25 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
1 changed files with 768360 additions and 0 deletions
18
brutal.ktx/Brutal.Ktx/Abstractions/GpuUploadUtils.cs
Normal file
18
brutal.ktx/Brutal.Ktx/Abstractions/GpuUploadUtils.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue