|
22 | 22 |
|
23 | 23 | #include "misc/debug.h" |
24 | 24 | #include "misc/formats.h" |
| 25 | +#include "misc/types.h" |
25 | 26 | #include <algorithm> |
26 | 27 | #include <unordered_map> |
27 | 28 |
|
@@ -345,7 +346,7 @@ struct YUVFormatInfo |
345 | 346 | }; |
346 | 347 |
|
347 | 348 | /* TODO: Component layouts are wrong for YUV formats? */ |
348 | | -static const std::unordered_map<Anvil::Format, YUVFormatInfo> g_yuv_formats = |
| 349 | +static const std::unordered_map<Anvil::Format, YUVFormatInfo, Anvil::EnumClassHasher<Anvil::Format>> g_yuv_formats = |
349 | 350 | { |
350 | 351 | /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ |
351 | 352 | {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, |
@@ -431,7 +432,7 @@ typedef struct |
431 | 432 | uint32_t plane2_b0_last_bit_index; |
432 | 433 | } YUVFormatBitLayoutInfo; |
433 | 434 |
|
434 | | -static const std::unordered_map<Anvil::Format, YUVFormatBitLayoutInfo> g_yuv_format_bit_layout_info = |
| 435 | +static const std::unordered_map<Anvil::Format, YUVFormatBitLayoutInfo, Anvil::EnumClassHasher<Anvil::Format> > g_yuv_format_bit_layout_info = |
435 | 436 | { |
436 | 437 | /* Single-planar non-packed YUV formats ==> */ |
437 | 438 |
|
@@ -480,7 +481,7 @@ static const std::unordered_map<Anvil::Format, YUVFormatBitLayoutInfo> g_yuv_for |
480 | 481 | {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, |
481 | 482 | }; |
482 | 483 |
|
483 | | -static const std::unordered_map<Anvil::Format, NonYUVFormatBitLayoutInfo> g_nonyuv_format_bit_layout_info = |
| 484 | +static const std::unordered_map<Anvil::Format, NonYUVFormatBitLayoutInfo, Anvil::EnumClassHasher<Anvil::Format> > g_nonyuv_format_bit_layout_info = |
484 | 485 | { |
485 | 486 | /* format | red start | red end | green start | green end | blue start | blue end | alpha start | alpha end | shared_start | shared_end | depth start | depth end | stencil start | stencil end */ |
486 | 487 | {Anvil::Format::UNKNOWN, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, |
|
0 commit comments