Skip to content

Commit 806e937

Browse files
Address failures reported by CI
1 parent e177945 commit 806e937

6 files changed

Lines changed: 32 additions & 22 deletions

File tree

deps/glslang/.gitattributes

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
*.txt text
99

1010
# source code can be native and normalized, but simpler if lf everywhere; will try that way
11-
*.h text eof=lf
12-
*.c text eof=lf
13-
*.cpp text eof=lf
14-
*.y text eof=lf
15-
*.out text eof=lf
16-
*.conf text eof=lf
17-
*.err text eof=lf
11+
*.h text eol=lf
12+
*.c text eol=lf
13+
*.cpp text eol=lf
14+
*.y text eol=lf
15+
*.out text eol=lf
16+
*.conf text eol=lf
17+
*.err text eol=lf

include/misc/descriptor_pool_create_info.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ namespace Anvil
133133
DescriptorPoolCreateInfo& operator=(const DescriptorPoolCreateInfo&);
134134

135135
/* Private variables */
136-
Anvil::DescriptorPoolCreateFlags m_create_flags;
137-
const Anvil::BaseDevice* m_device_ptr;
138-
std::unordered_map<Anvil::DescriptorType, uint32_t> m_descriptor_count;
139-
Anvil::MTSafety m_mt_safety;
140-
uint32_t m_n_max_inline_uniform_block_bindings;
141-
uint32_t m_n_max_sets;
136+
Anvil::DescriptorPoolCreateFlags m_create_flags;
137+
const Anvil::BaseDevice* m_device_ptr;
138+
std::unordered_map<Anvil::DescriptorType, uint32_t, EnumClassHasher<Anvil::DescriptorType> > m_descriptor_count;
139+
Anvil::MTSafety m_mt_safety;
140+
uint32_t m_n_max_inline_uniform_block_bindings;
141+
uint32_t m_n_max_sets;
142142
};
143143

144144
}; /* namespace Anvil */

include/misc/types_struct.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232

3333
namespace Anvil
3434
{
35+
template<typename EnumClass>
36+
struct EnumClassHasher
37+
{
38+
std::size_t operator()(const EnumClass& in_value) const
39+
{
40+
return static_cast<std::size_t>(static_cast<uint32_t>(in_value) );
41+
}
42+
};
43+
3544
/* Note: Matches VkSampleLocationEXT in terms of the layout and size.
3645
*/
3746
typedef struct SampleLocation

include/wrappers/descriptor_set_group.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ namespace Anvil
346346
const Anvil::BaseDevice* m_device_ptr;
347347
std::vector<const Anvil::DescriptorSetCreateInfo*> m_ds_create_info_ptrs;
348348

349-
std::unordered_map<Anvil::DescriptorType, DescriptorTypeProperties> m_descriptor_type_properties;
349+
std::unordered_map<Anvil::DescriptorType, DescriptorTypeProperties, EnumClassHasher<Anvil::DescriptorType> > m_descriptor_type_properties;
350350

351351
uint32_t m_n_unique_dses;
352352
const Anvil::DescriptorSetGroup* m_parent_dsg_ptr;

src/misc/formats.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "misc/debug.h"
2424
#include "misc/formats.h"
25+
#include "misc/types.h"
2526
#include <algorithm>
2627
#include <unordered_map>
2728

@@ -345,7 +346,7 @@ struct YUVFormatInfo
345346
};
346347

347348
/* 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 =
349350
{
350351
/* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */
351352
{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
431432
uint32_t plane2_b0_last_bit_index;
432433
} YUVFormatBitLayoutInfo;
433434

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 =
435436
{
436437
/* Single-planar non-packed YUV formats ==> */
437438

@@ -480,7 +481,7 @@ static const std::unordered_map<Anvil::Format, YUVFormatBitLayoutInfo> g_yuv_for
480481
{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} },
481482
};
482483

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 =
484485
{
485486
/* 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 */
486487
{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} },

src/wrappers/descriptor_set_group.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup()
185185
/** Re-creates internally-maintained descriptor pool. **/
186186
bool Anvil::DescriptorSetGroup::bake_descriptor_pool()
187187
{
188-
Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE);
189-
std::unique_lock<std::recursive_mutex> mutex_lock;
190-
auto mutex_ptr = get_mutex();
191-
std::unordered_map<Anvil::DescriptorType, uint32_t> n_descriptors_needed_map;
192-
bool result = false;
188+
Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE);
189+
std::unique_lock<std::recursive_mutex> mutex_lock;
190+
auto mutex_ptr = get_mutex();
191+
std::unordered_map<Anvil::DescriptorType, uint32_t, Anvil::EnumClassHasher<Anvil::DescriptorType> > n_descriptors_needed_map;
192+
bool result = false;
193193

194194
if (mutex_ptr != nullptr)
195195
{

0 commit comments

Comments
 (0)