Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergcpp committed Dec 26, 2024
1 parent 3ded534 commit bec4948
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
18 changes: 9 additions & 9 deletions internal/TextureCompare.inl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DECORATE(None, VK_COMPARE_OP_NEVER, D3D12_COMPARISON_FUNC_NEVER)
DECORATE(LEqual, VK_COMPARE_OP_LESS_OR_EQUAL, D3D12_COMPARISON_FUNC_LESS_EQUAL)
DECORATE(GEqual, VK_COMPARE_OP_GREATER_OR_EQUAL, D3D12_COMPARISON_FUNC_GREATER_EQUAL)
DECORATE(Less, VK_COMPARE_OP_LESS, D3D12_COMPARISON_FUNC_LESS)
DECORATE(Greater, VK_COMPARE_OP_GREATER, D3D12_COMPARISON_FUNC_GREATER)
DECORATE(Equal, VK_COMPARE_OP_EQUAL, D3D12_COMPARISON_FUNC_EQUAL)
DECORATE(NotEqual, VK_COMPARE_OP_NOT_EQUAL, D3D12_COMPARISON_FUNC_NOT_EQUAL)
DECORATE(Always, VK_COMPARE_OP_ALWAYS, D3D12_COMPARISON_FUNC_ALWAYS)
DECORATE(Never, VK_COMPARE_OP_NEVER, D3D12_COMPARISON_FUNC_NEVER)
DECORATE(None, VK_COMPARE_OP_NEVER, D3D12_COMPARISON_FUNC_NEVER)
DECORATE(LEqual, VK_COMPARE_OP_LESS_OR_EQUAL, D3D12_COMPARISON_FUNC_LESS_EQUAL)
DECORATE(GEqual, VK_COMPARE_OP_GREATER_OR_EQUAL, D3D12_COMPARISON_FUNC_GREATER_EQUAL)
DECORATE(Less, VK_COMPARE_OP_LESS, D3D12_COMPARISON_FUNC_LESS)
DECORATE(Greater, VK_COMPARE_OP_GREATER, D3D12_COMPARISON_FUNC_GREATER)
DECORATE(Equal, VK_COMPARE_OP_EQUAL, D3D12_COMPARISON_FUNC_EQUAL)
DECORATE(NotEqual, VK_COMPARE_OP_NOT_EQUAL, D3D12_COMPARISON_FUNC_NOT_EQUAL)
DECORATE(Always, VK_COMPARE_OP_ALWAYS, D3D12_COMPARISON_FUNC_ALWAYS)
DECORATE(Never, VK_COMPARE_OP_NEVER, D3D12_COMPARISON_FUNC_NEVER)
6 changes: 3 additions & 3 deletions internal/TextureFilter.inl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DECORATE(Nearest, VK_FILTER_NEAREST, VK_SAMPLER_MIPMAP_MODE_NEAREST, D3D12_FILTER_MIN_MAG_MIP_POINT)
DECORATE(Bilinear, VK_FILTER_LINEAR, VK_SAMPLER_MIPMAP_MODE_NEAREST, D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT)
DECORATE(Trilinear, VK_FILTER_LINEAR, VK_SAMPLER_MIPMAP_MODE_LINEAR, D3D12_FILTER_MIN_MAG_MIP_LINEAR)
DECORATE(Nearest, VK_FILTER_NEAREST, VK_SAMPLER_MIPMAP_MODE_NEAREST, D3D12_FILTER_MIN_MAG_MIP_POINT)
DECORATE(Bilinear, VK_FILTER_LINEAR, VK_SAMPLER_MIPMAP_MODE_NEAREST, D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT)
DECORATE(Trilinear, VK_FILTER_LINEAR, VK_SAMPLER_MIPMAP_MODE_LINEAR, D3D12_FILTER_MIN_MAG_MIP_LINEAR)
3 changes: 1 addition & 2 deletions internal/TextureFormat.inl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ DECORATE(R32UI, 1, 4, VK_FORMAT_R32_UINT, DXGI_FORMAT_
DECORATE(RG8, 2, 2, VK_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM)
DECORATE(RGB32F, 3, 12, VK_FORMAT_R32G32B32_SFLOAT, DXGI_FORMAT_R32G32B32_FLOAT)
DECORATE(RGBA32F, 4, 16, VK_FORMAT_R32G32B32A32_SFLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT)
DECORATE(RGBE8, 4, 4, VK_FORMAT_UNDEFINED, DXGI_FORMAT_UNKNOWN)
DECORATE(RGB16F, 3, 6, VK_FORMAT_R16G16B16_SFLOAT, DXGI_FORMAT_UNKNOWN)
DECORATE(RGBA16F, 4, 8, VK_FORMAT_R16G16B16A16_SFLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT)
DECORATE(RG16_snorm, 2, 4, VK_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_SNORM)
DECORATE(RG16, 2, 4, VK_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM)
DECORATE(RG16F, 2, 4, VK_FORMAT_R16G16_SFLOAT, DXGI_FORMAT_R16G16_FLOAT)
DECORATE(RG32F, 2, 8, VK_FORMAT_R32G32_SFLOAT, DXGI_FORMAT_R32G32_FLOAT)
DECORATE(RG32UI, 2, 8, VK_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT)
DECORATE(RGB10_A2, 3, 4, VK_FORMAT_A2B10G10R10_UNORM_PACK32, DXGI_FORMAT_R10G10B10A2_UNORM)
DECORATE(RGB10_A2, 4, 4, VK_FORMAT_A2B10G10R10_UNORM_PACK32, DXGI_FORMAT_R10G10B10A2_UNORM)
DECORATE(RG11F_B10F, 3, 4, VK_FORMAT_B10G11R11_UFLOAT_PACK32, DXGI_FORMAT_R11G11B10_FLOAT)
DECORATE(D16, 1, 2, VK_FORMAT_D16_UNORM, DXGI_FORMAT_D16_UNORM)
DECORATE(D24_S8, 2, 4, VK_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_D24_UNORM_S8_UINT)
Expand Down
2 changes: 1 addition & 1 deletion internal/TextureParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int Ray::GetChannelCount(const eTexFormat format) {
int Ray::GetPerPixelDataLen(const eTexFormat format) { return g_tex_format_info[int(format)].pp_data_len; }

int Ray::GetBlockLenBytes(const eTexFormat format, const eTexBlock block) {
static_assert(int(eTexFormat::_Count) == 32, "Update the list below!");
static_assert(int(eTexFormat::_Count) == 31, "Update the list below!");
switch (format) {
case eTexFormat::BC1:
assert(block == eTexBlock::_4x4);
Expand Down
8 changes: 4 additions & 4 deletions internal/TextureParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ enum class eTexFormat : uint8_t {
#undef DECORATE

inline bool IsDepthFormat(const eTexFormat format) {
static_assert(int(eTexFormat::_Count) == 32, "Update the list below!");
static_assert(int(eTexFormat::_Count) == 31, "Update the list below!");
return format == eTexFormat::D16 || format == eTexFormat::D24_S8 || format == eTexFormat::D32_S8 ||
format == eTexFormat::D32;
}

inline bool IsDepthStencilFormat(const eTexFormat format) {
static_assert(int(eTexFormat::_Count) == 32, "Update the list below!");
static_assert(int(eTexFormat::_Count) == 31, "Update the list below!");
return format == eTexFormat::D24_S8 || format == eTexFormat::D32_S8;
}

inline bool IsCompressedFormat(const eTexFormat format) {
static_assert(int(eTexFormat::_Count) == 32, "Update the list below!");
static_assert(int(eTexFormat::_Count) == 31, "Update the list below!");
switch (format) {
case eTexFormat::BC1:
case eTexFormat::BC2:
Expand All @@ -39,7 +39,7 @@ inline bool IsCompressedFormat(const eTexFormat format) {
}

inline bool IsUintFormat(const eTexFormat format) {
static_assert(int(eTexFormat::_Count) == 32, "Update the list below!");
static_assert(int(eTexFormat::_Count) == 31, "Update the list below!");
if (format == eTexFormat::R16UI || format == eTexFormat::R32UI || format == eTexFormat::RG32UI) {
return true;
}
Expand Down

0 comments on commit bec4948

Please sign in to comment.