Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Bitmask.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ template <class enum_type, typename = typename std::enable_if<std::is_enum<enum_
return 1 << static_cast<underlying_type>(e);
}

explicit Bitmask(const underlying_type mask) : mask_(mask) {}

public:
Bitmask() : mask_(0) {}
Bitmask(const enum_type e) : mask_(to_mask(e)) {}
explicit Bitmask(const underlying_type mask) : mask_(mask) {}

Bitmask(const Bitmask &rhs) = default;
Bitmask(Bitmask &&rhs) = default;
Expand Down
7 changes: 1 addition & 6 deletions internal/Dx/RenderPassDX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ static_assert((sizeof(vk_store_ops) / sizeof(vk_store_ops[0])) == int(eStoreOp::
static_assert(VkSampleCountFlagBits::VK_SAMPLE_COUNT_1_BIT == 1, "!");
static_assert(VkSampleCountFlagBits::VK_SAMPLE_COUNT_2_BIT == 2, "!");
static_assert(VkSampleCountFlagBits::VK_SAMPLE_COUNT_4_BIT == 4, "!");
static_assert(VkSampleCountFlagBits::VK_SAMPLE_COUNT_8_BIT == 8, "!");

VkFormat ToSRGBFormat(VkFormat format);*/
static_assert(VkSampleCountFlagBits::VK_SAMPLE_COUNT_8_BIT == 8, "!");*/
} // namespace Vk
} // namespace Ray

Expand Down Expand Up @@ -101,9 +99,6 @@ bool Ray::Dx::RenderPass::Init(Context *ctx, Span<const RenderTargetInfo> _color

auto &att_desc = pass_attachments.emplace_back();
att_desc.format = VKFormatFromTexFormat(_color_rts[i].format);
if (bool(_color_rts[i].flags & eTexFlagBits::SRGB)) {
att_desc.format = ToSRGBFormat(att_desc.format);
}
att_desc.samples = VkSampleCountFlagBits(_color_rts[i].samples);
if (VkImageLayout(_color_rts[i].layout) == VK_IMAGE_LAYOUT_UNDEFINED) {
att_desc.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
Expand Down
4 changes: 2 additions & 2 deletions internal/Dx/SamplerDX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ void Ray::Dx::Sampler::Init(Context *ctx, const SamplingParams params) {
sampler_desc.AddressV = g_wrap_mode_dx[size_t(params.wrap)];
sampler_desc.AddressW = g_wrap_mode_dx[size_t(params.wrap)];
sampler_desc.MipLODBias = params.lod_bias.to_float();
sampler_desc.MinLOD = params.min_lod.to_float();
sampler_desc.MaxLOD = params.max_lod.to_float();
sampler_desc.MinLOD = 0.0f;
sampler_desc.MaxLOD = 1000.0f;
sampler_desc.MaxAnisotropy = UINT(AnisotropyLevel);
if (params.compare != eTexCompare::None) {
sampler_desc.ComparisonFunc = g_compare_func_dx[size_t(params.compare)];
Expand Down
2 changes: 1 addition & 1 deletion internal/Dx/SamplerDX.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Context;
class Sampler {
Context *ctx_ = nullptr;
PoolRef ref_;
SamplingParams params_;
SamplingParamsPacked params_;

public:
Sampler() = default;
Expand Down
58 changes: 8 additions & 50 deletions internal/Dx/TextureDX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,6 @@ static_assert(sizeof(g_formats_dx) / sizeof(g_formats_dx[0]) == size_t(eTexForma

uint32_t TextureHandleCounter = 0;

DXGI_FORMAT ToSRGBFormat(const DXGI_FORMAT format) {
switch (format) {
case DXGI_FORMAT_R8G8B8A8_UNORM:
return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
case DXGI_FORMAT_BC1_UNORM:
return DXGI_FORMAT_BC1_UNORM_SRGB;
case DXGI_FORMAT_BC2_UNORM:
return DXGI_FORMAT_BC2_UNORM_SRGB;
case DXGI_FORMAT_BC3_UNORM:
return DXGI_FORMAT_BC3_UNORM_SRGB;
default:
return format;
}
return DXGI_FORMAT_UNKNOWN;
}

D3D12_RESOURCE_FLAGS to_dx_image_flags(const Bitmask<eTexUsage> usage, const eTexFormat format) {
D3D12_RESOURCE_FLAGS ret = D3D12_RESOURCE_FLAG_NONE;
if (usage & eTexUsage::Storage) {
Expand Down Expand Up @@ -159,7 +143,7 @@ void Ray::Dx::Texture::Init(const void *data, const uint32_t size, const TexPara
}

void Ray::Dx::Texture::Free() {
if (params.format != eTexFormat::Undefined && !bool(params.flags & eTexFlags::NoOwnership)) {
if (params.format != eTexFormat::Undefined && !bool(Bitmask<eTexFlags>{params.flags} & eTexFlags::NoOwnership)) {
ctx_->staging_descr_alloc()->Free(eDescrType::CBV_SRV_UAV, handle_.views_ref);
ctx_->resources_to_destroy[ctx_->backend_frame].push_back(handle_.img);
ctx_->staging_descr_alloc()->Free(eDescrType::Sampler, handle_.sampler_ref);
Expand All @@ -171,8 +155,7 @@ void Ray::Dx::Texture::Free() {
}

bool Ray::Dx::Texture::Realloc(const int w, const int h, int mip_count, const int samples, const eTexFormat format,
const bool is_srgb, ID3D12GraphicsCommandList *cmd_buf, MemAllocators *mem_allocs,
ILog *log) {
ID3D12GraphicsCommandList *cmd_buf, MemAllocators *mem_allocs, ILog *log) {
ID3D12Resource *new_image = nullptr;
// VkImageView new_image_view = VK_NULL_HANDLE;
MemAllocation new_alloc = {};
Expand All @@ -186,12 +169,9 @@ bool Ray::Dx::Texture::Realloc(const int w, const int h, int mip_count, const in
image_desc.DepthOrArraySize = 1;
image_desc.MipLevels = mip_count;
image_desc.Format = g_formats_dx[int(format)];
if (is_srgb) {
image_desc.Format = ToSRGBFormat(image_desc.Format);
}
image_desc.SampleDesc.Count = samples;
image_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
image_desc.Flags = to_dx_image_flags(params.usage, format);
image_desc.Flags = to_dx_image_flags(Bitmask<eTexUsage>{params.usage}, format);

(void)new_image;
#if 0
Expand Down Expand Up @@ -247,9 +227,6 @@ bool Ray::Dx::Texture::Realloc(const int w, const int h, int mip_count, const in
view_info.image = new_image;
view_info.viewType = VK_IMAGE_VIEW_TYPE_2D;
view_info.format = g_formats_vk[size_t(format)];
if (is_srgb) {
view_info.format = ToSRGBFormat(view_info.format);
}
view_info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
view_info.subresourceRange.baseMipLevel = 0;
view_info.subresourceRange.levelCount = mip_count;
Expand Down Expand Up @@ -399,11 +376,6 @@ bool Ray::Dx::Texture::Realloc(const int w, const int h, int mip_count, const in
alloc_ = std::move(new_alloc);
params.w = w;
params.h = h;
if (is_srgb) {
params.flags |= eTexFlagBits::SRGB;
} else {
params.flags &= ~eTexFlagBits::SRGB;
}
params.mip_count = mip_count;
params.samples = samples;
params.format = format;
Expand All @@ -430,12 +402,9 @@ void Ray::Dx::Texture::InitFromRAWData(Buffer *sbuf, int data_off, ID3D12Graphic
image_desc.DepthOrArraySize = (p.d ? p.d : 1);
image_desc.MipLevels = params.mip_count;
image_desc.Format = g_formats_dx[int(p.format)];
if (p.flags & eTexFlags::SRGB) {
image_desc.Format = ToSRGBFormat(image_desc.Format);
}
image_desc.SampleDesc.Count = p.samples;
image_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
image_desc.Flags = to_dx_image_flags(params.usage, p.format);
image_desc.Flags = to_dx_image_flags(Bitmask<eTexUsage>{params.usage}, p.format);

const D3D12_RESOURCE_ALLOCATION_INFO alloc_info = ctx_->device()->GetResourceAllocationInfo(0, 1, &image_desc);

Expand Down Expand Up @@ -471,9 +440,6 @@ void Ray::Dx::Texture::InitFromRAWData(Buffer *sbuf, int data_off, ID3D12Graphic
{ // create default SRV
D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc = {};
srv_desc.Format = g_formats_dx[int(p.format)];
if (p.flags & eTexFlags::SRGB) {
srv_desc.Format = ToSRGBFormat(srv_desc.Format);
}
if (p.d == 0) {
srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
srv_desc.Texture2D.MipLevels = p.mip_count;
Expand Down Expand Up @@ -617,8 +583,8 @@ void Ray::Dx::Texture::InitFromRAWData(Buffer *sbuf, int data_off, ID3D12Graphic
sampler_desc.AddressV = g_wrap_mode_dx[size_t(p.sampling.wrap)];
sampler_desc.AddressW = g_wrap_mode_dx[size_t(p.sampling.wrap)];
sampler_desc.MipLODBias = p.sampling.lod_bias.to_float();
sampler_desc.MinLOD = p.sampling.min_lod.to_float();
sampler_desc.MaxLOD = p.sampling.max_lod.to_float();
sampler_desc.MinLOD = 0.0f;
sampler_desc.MaxLOD = 1000.0f;
sampler_desc.MaxAnisotropy = UINT(AnisotropyLevel);
if (p.sampling.compare != eTexCompare::None) {
sampler_desc.ComparisonFunc = g_compare_func_dx[size_t(p.sampling.compare)];
Expand Down Expand Up @@ -679,9 +645,6 @@ void Ray::Dx::Texture::SetSubImage(const int level, const int offsetx, const int
src_loc.PlacedFootprint.Footprint.Height = sizey;
src_loc.PlacedFootprint.Footprint.Depth = sizez;
src_loc.PlacedFootprint.Footprint.Format = g_formats_dx[int(params.format)];
if (params.flags & eTexFlags::SRGB) {
src_loc.PlacedFootprint.Footprint.Format = ToSRGBFormat(src_loc.PlacedFootprint.Footprint.Format);
}
if (IsCompressedFormat(params.format)) {
src_loc.PlacedFootprint.Footprint.RowPitch = round_up(
GetBlockCount(sizex, 1, params.format) * GetBlockLenBytes(params.format), TextureDataPitchAlignment);
Expand Down Expand Up @@ -709,8 +672,8 @@ void Ray::Dx::Texture::SetSampling(const SamplingParams s) {
sampler_desc.AddressV = g_wrap_mode_dx[size_t(s.wrap)];
sampler_desc.AddressW = g_wrap_mode_dx[size_t(s.wrap)];
sampler_desc.MipLODBias = s.lod_bias.to_float();
sampler_desc.MinLOD = s.min_lod.to_float();
sampler_desc.MaxLOD = s.max_lod.to_float();
sampler_desc.MinLOD = 0.0f;
sampler_desc.MaxLOD = 1000.0f;
sampler_desc.MaxAnisotropy = UINT(AnisotropyLevel);
if (s.compare != eTexCompare::None) {
sampler_desc.ComparisonFunc = g_compare_func_dx[size_t(s.compare)];
Expand Down Expand Up @@ -884,11 +847,6 @@ void Ray::Dx::_ClearColorImage(Texture &tex, const void *rgba, ID3D12GraphicsCom

DXGI_FORMAT Ray::Dx::DXFormatFromTexFormat(const eTexFormat format) { return g_formats_dx[size_t(format)]; }

bool Ray::Dx::RequiresManualSRGBConversion(const eTexFormat format) {
const DXGI_FORMAT dxgi_format = g_formats_dx[size_t(format)];
return dxgi_format == ToSRGBFormat(dxgi_format);
}

bool Ray::Dx::CanBeBlockCompressed(int w, int h, const int mip_count) {
// NOTE: Assume only BC-formats for now
static const int block_res[2] = {4, 4};
Expand Down
10 changes: 3 additions & 7 deletions internal/Dx/TextureDX.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ class Texture {
const TexParams &p, ILog *log);

public:
TexParams params;
TexParamsPacked params;

uint32_t first_user = 0xffffffff;
mutable eResState resource_state = eResState::Undefined;

Texture() = default;
Expand Down Expand Up @@ -105,8 +104,8 @@ class Texture {
void Init(const void *data, uint32_t size, const TexParams &p, Buffer &stage_buf,
ID3D12GraphicsCommandList *cmd_buf, MemAllocators *mem_allocs, eTexLoadStatus *load_status, ILog *log);

bool Realloc(int w, int h, int mip_count, int samples, eTexFormat format, bool is_srgb,
ID3D12GraphicsCommandList *cmd_buf, MemAllocators *mem_allocs, ILog *log);
bool Realloc(int w, int h, int mip_count, int samples, eTexFormat format, ID3D12GraphicsCommandList *cmd_buf,
MemAllocators *mem_allocs, ILog *log);

Context *ctx() { return ctx_; }
const TexHandle &handle() const { return handle_; }
Expand All @@ -124,7 +123,6 @@ class Texture {
return ret;
}*/

const SamplingParams &sampling() const { return params.sampling; }
const std::string &name() const { return name_; }

void SetSampling(SamplingParams sampling);
Expand All @@ -151,9 +149,7 @@ inline void ClearColorImage(Texture &tex, const uint32_t rgba[4], ID3D12Graphics
}

DXGI_FORMAT DXFormatFromTexFormat(eTexFormat format);
DXGI_FORMAT ToSRGBFormat(DXGI_FORMAT format);

bool RequiresManualSRGBConversion(eTexFormat format);
bool CanBeBlockCompressed(int w, int h, int mip_count);

} // namespace Dx
Expand Down
48 changes: 42 additions & 6 deletions internal/SamplingParams.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <cassert>
#include <cstdint>

#include "Fixed.h"
Expand Down Expand Up @@ -30,19 +31,54 @@ struct SamplingParams {
eTexWrap wrap = eTexWrap::Repeat;
eTexCompare compare = eTexCompare::None;
Fixed8 lod_bias;
Fixed8 min_lod = Fixed8::lowest(), max_lod = Fixed8::max();

SamplingParams() = default;
SamplingParams(const eTexFilter _filter, const eTexWrap _wrap, const eTexCompare _compare, const Fixed8 _lod_bias,
const Fixed8 _min_lod, const Fixed8 _max_lod)
: filter(_filter), wrap(_wrap), compare(_compare), lod_bias(_lod_bias), min_lod(_min_lod), max_lod(_max_lod) {}
SamplingParams(const eTexFilter _filter, const eTexWrap _wrap, const eTexCompare _compare, const Fixed8 _lod_bias)
: filter(_filter), wrap(_wrap), compare(_compare), lod_bias(_lod_bias) {}
};
static_assert(sizeof(SamplingParams) == 6, "!");
static_assert(sizeof(SamplingParams) == 4, "!");

inline bool operator==(const SamplingParams lhs, const SamplingParams rhs) {
return lhs.filter == rhs.filter && lhs.wrap == rhs.wrap && lhs.compare == rhs.compare &&
lhs.lod_bias == rhs.lod_bias && lhs.min_lod == rhs.min_lod && lhs.max_lod == rhs.max_lod;
lhs.lod_bias == rhs.lod_bias;
}
inline bool operator!=(const SamplingParams lhs, const SamplingParams rhs) { return !operator==(lhs, rhs); }

struct SamplingParamsPacked {
uint8_t filter : 2;
uint8_t wrap : 2;
uint8_t compare : 4;
Fixed8 lod_bias;

SamplingParamsPacked() : SamplingParamsPacked(SamplingParams{}) {}
SamplingParamsPacked(const SamplingParams &p) {
assert(uint8_t(p.filter) < 4);
assert(uint8_t(p.wrap) < 4);
assert(uint8_t(p.compare) < 16);
filter = uint8_t(p.filter);
wrap = uint8_t(p.wrap);
compare = uint8_t(p.compare);
lod_bias = p.lod_bias;
}

operator SamplingParams() const {
return SamplingParams{eTexFilter(filter), eTexWrap(wrap), eTexCompare(compare), lod_bias};
}
};
static_assert(sizeof(SamplingParamsPacked) == 2, "!");

inline bool operator==(const SamplingParamsPacked lhs, const SamplingParamsPacked rhs) {
return lhs.filter == rhs.filter && lhs.wrap == rhs.wrap && lhs.compare == rhs.compare &&
lhs.lod_bias == rhs.lod_bias;
}
inline bool operator!=(const SamplingParamsPacked lhs, const SamplingParamsPacked rhs) {
return !operator==(lhs, rhs);
}
inline bool operator==(const SamplingParamsPacked lhs, const SamplingParams rhs) {
return lhs.filter == uint8_t(rhs.filter) && lhs.wrap == uint8_t(rhs.wrap) && lhs.compare == uint8_t(rhs.compare) &&
lhs.lod_bias == rhs.lod_bias;
}
inline bool operator!=(const SamplingParamsPacked lhs, const SamplingParams rhs) { return !operator==(lhs, rhs); }

int CalcMipCount(int w, int h, int min_res);
} // namespace Ray
10 changes: 4 additions & 6 deletions internal/SceneGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,12 @@ inline Ray::TextureHandle Ray::NS::Scene::AddBindlessTexture_nolock(const tex_de
TexParams p = {};
p.w = _t.w;
p.h = _t.h;
p.format = fmt;
if (_t.is_srgb && !is_YCoCg && !RequiresManualSRGBConversion(fmt)) {
p.flags |= eTexFlags::SRGB;
p.format = ToSRGBFormat(p.format);
}
p.mip_count = mip_count;
p.usage = Bitmask<eTexUsage>(eTexUsage::Transfer) | eTexUsage::Sampled;
p.format = fmt;
p.sampling.filter = eTexFilter::Nearest;

std::pair<uint32_t, uint32_t> ret =
Expand Down Expand Up @@ -1785,8 +1785,7 @@ Ray::NS::Scene::PrepareSkyEnvMap_nolock(const std::function<void(int, int, Paral
TexParams params;
params.w = MOON_TEX_W;
params.h = MOON_TEX_H;
params.format = eTexFormat::RGBA8;
params.flags = eTexFlags::SRGB;
params.format = eTexFormat::RGBA8_srgb;
params.usage = Bitmask<eTexUsage>(eTexUsage::Sampled) | eTexUsage::Transfer;
params.sampling.filter = eTexFilter::Bilinear;
params.sampling.wrap = eTexWrap::ClampToEdge;
Expand Down Expand Up @@ -1865,8 +1864,7 @@ Ray::NS::Scene::PrepareSkyEnvMap_nolock(const std::function<void(int, int, Paral
if (!sky_curl_tex_) {
TexParams params;
params.w = params.h = CURL_TEX_RES;
params.format = eTexFormat::RGBA8;
params.flags = eTexFlags::SRGB;
params.format = eTexFormat::RGBA8_srgb;
params.usage = Bitmask<eTexUsage>(eTexUsage::Sampled) | eTexUsage::Transfer;
params.sampling.filter = eTexFilter::Bilinear;
params.sampling.wrap = eTexWrap::Repeat;
Expand Down
6 changes: 6 additions & 0 deletions internal/TextureFormat.inl
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
X(Undefined, 0 /* channel count */, 0 /* PP data len*/, 0 /* block_x */, 0 /* block_y */, VK_FORMAT_UNDEFINED, DXGI_FORMAT_UNKNOWN)
X(RGB8, 3, 3, 0, 0, VK_FORMAT_R8G8B8_UNORM, DXGI_FORMAT_UNKNOWN)
X(RGB8_srgb, 3, 3, 0, 0, VK_FORMAT_R8G8B8_SRGB, DXGI_FORMAT_UNKNOWN)
X(RGBA8, 4, 4, 0, 0, VK_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM)
X(RGBA8_srgb, 4, 4, 0, 0, VK_FORMAT_R8G8B8A8_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB)
X(RGBA8_snorm, 4, 4, 0, 0, VK_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SNORM)
X(BGRA8, 4, 4, 0, 0, VK_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM)
X(BGRA8_srgb, 4, 4, 0, 0, VK_FORMAT_B8G8R8A8_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB)
X(R32F, 1, 4, 0, 0, VK_FORMAT_R32_SFLOAT, DXGI_FORMAT_R32_FLOAT)
X(R16F, 1, 2, 0, 0, VK_FORMAT_R16_SFLOAT, DXGI_FORMAT_R16_FLOAT)
X(R8, 1, 1, 0, 0, VK_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM)
Expand All @@ -25,7 +28,10 @@ X(D24_S8, 2, 4, 0, 0, VK_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_D
X(D32_S8, 2, 8, 0, 0, VK_FORMAT_D32_SFLOAT_S8_UINT, DXGI_FORMAT_D32_FLOAT_S8X24_UINT)
X(D32, 1, 4, 0, 0, VK_FORMAT_D32_SFLOAT, DXGI_FORMAT_D32_FLOAT)
X(BC1, 3, 0, 4, 4, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, DXGI_FORMAT_BC1_UNORM)
X(BC1_srgb, 3, 0, 4, 4, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, DXGI_FORMAT_BC1_UNORM_SRGB)
X(BC2, 4, 0, 4, 4, VK_FORMAT_BC2_UNORM_BLOCK, DXGI_FORMAT_BC2_UNORM)
X(BC2_srgb, 4, 0, 4, 4, VK_FORMAT_BC2_SRGB_BLOCK, DXGI_FORMAT_BC2_UNORM_SRGB)
X(BC3, 4, 0, 4, 4, VK_FORMAT_BC3_UNORM_BLOCK, DXGI_FORMAT_BC3_UNORM)
X(BC3_srgb, 4, 0, 4, 4, VK_FORMAT_BC3_SRGB_BLOCK, DXGI_FORMAT_BC3_UNORM_SRGB)
X(BC4, 1, 0, 4, 4, VK_FORMAT_BC4_UNORM_BLOCK, DXGI_FORMAT_BC4_UNORM)
X(BC5, 2, 0, 4, 4, VK_FORMAT_BC5_UNORM_BLOCK, DXGI_FORMAT_BC5_UNORM)
5 changes: 4 additions & 1 deletion internal/TextureParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ int Ray::GetChannelCount(const eTexFormat format) { return g_tex_format_info[int
int Ray::GetPerPixelDataLen(const eTexFormat format) { return g_tex_format_info[int(format)].pp_data_len; }

int Ray::GetBlockLenBytes(const eTexFormat format) {
static_assert(int(eTexFormat::_Count) == 31, "Update the list below!");
static_assert(int(eTexFormat::_Count) == 37, "Update the list below!");
switch (format) {
case eTexFormat::BC1:
case eTexFormat::BC1_srgb:
return 8;
case eTexFormat::BC2:
case eTexFormat::BC2_srgb:
case eTexFormat::BC3:
case eTexFormat::BC3_srgb:
case eTexFormat::BC5:
return 16;
case eTexFormat::BC4:
Expand Down
Loading