Skip to content

Commit eaf9b3c

Browse files
committed
Added clone to DescriptorConfigurator and ArrayConfigurator. Simplified ShaderSet::GeometryHints enum
1 parent 8546514 commit eaf9b3c

4 files changed

Lines changed: 33 additions & 4 deletions

File tree

include/vsg/utils/GraphicsPipelineConfigurator.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ namespace vsg
3737
{
3838
public:
3939
explicit DescriptorConfigurator(ref_ptr<ShaderSet> in_shaderSet = {});
40+
explicit DescriptorConfigurator(const DescriptorConfigurator& rhs, const CopyOp& copyop = {});
41+
42+
ref_ptr<Object> clone(const CopyOp& copyop = {}) const override { return DescriptorConfigurator::create(*this, copyop); }
4043

4144
ref_ptr<ShaderSet> shaderSet;
4245
bool blending = false;
@@ -76,6 +79,9 @@ namespace vsg
7679
{
7780
public:
7881
explicit ArrayConfigurator(ref_ptr<ShaderSet> in_shaderSet = {});
82+
explicit ArrayConfigurator(const ArrayConfigurator& rhs, const CopyOp& copyop = {});
83+
84+
ref_ptr<Object> clone(const CopyOp& copyop = {}) const override { return ArrayConfigurator::create(*this, copyop); }
7985

8086
ref_ptr<ShaderSet> shaderSet;
8187

include/vsg/utils/ShaderSet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ namespace vsg
129129
std::vector<ref_ptr<CustomDescriptorSetBinding>> customDescriptorSetBindings;
130130

131131
/// Hints mask for scene graph builders for what ShaderSet prefers/requires.
132-
enum GeometryHints : uint32_t
132+
enum GeometryHints
133133
{
134134
NO_PREFERENCE = 0,
135135
GEOMETRY = 1 << 0,
@@ -139,7 +139,7 @@ namespace vsg
139139
MESHLETS = 1 << 4
140140
};
141141

142-
uint32_t geometryHints = GeometryHints::NO_PREFERENCE;
142+
int geometryHints = GeometryHints::NO_PREFERENCE;
143143

144144
ref_ptr<ShaderCompileSettings> defaultShaderHints;
145145
/// variants of the rootShaderModule compiled for different combinations of ShaderCompileSettings

src/vsg/utils/GraphicsPipelineConfigurator.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ DescriptorConfigurator::DescriptorConfigurator(ref_ptr<ShaderSet> in_shaderSet)
9494
{
9595
}
9696

97+
DescriptorConfigurator::DescriptorConfigurator(const DescriptorConfigurator& rhs, const CopyOp& copyop) :
98+
Inherit(rhs, copyop),
99+
shaderSet(rhs.shaderSet),
100+
blending(rhs.blending),
101+
two_sided(rhs.two_sided),
102+
assigned(rhs.assigned),
103+
defines(rhs.defines),
104+
descriptorSets(rhs.descriptorSets)
105+
{
106+
}
107+
97108
int DescriptorConfigurator::compare(const Object& rhs_object) const
98109
{
99110
int result = Object::compare(rhs_object);
@@ -339,6 +350,18 @@ ArrayConfigurator::ArrayConfigurator(ref_ptr<ShaderSet> in_shaderSet) :
339350
{
340351
}
341352

353+
ArrayConfigurator::ArrayConfigurator(const ArrayConfigurator& rhs, const CopyOp& copyop) :
354+
Inherit(rhs, copyop),
355+
shaderSet(rhs.shaderSet),
356+
baseAttributeBinding(rhs.baseAttributeBinding),
357+
assigned(rhs.assigned),
358+
defines(rhs.defines),
359+
vertexBindingDescriptions(rhs.vertexBindingDescriptions),
360+
vertexAttributeDescriptions(rhs.vertexAttributeDescriptions),
361+
arrays(rhs.arrays)
362+
{
363+
}
364+
342365
int ArrayConfigurator::compare(const Object& rhs_object) const
343366
{
344367
int result = Object::compare(rhs_object);

src/vsg/utils/ShaderSet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void ShaderSet::read(Input& input)
381381

382382
if (input.version_greater_equal(1, 1, 16))
383383
{
384-
input.readValue<uint32_t>("geometryHints", geometryHints);
384+
input.readValue<int>("geometryHints", geometryHints);
385385
}
386386
}
387387

@@ -459,7 +459,7 @@ void ShaderSet::write(Output& output) const
459459

460460
if (output.version_greater_equal(1, 1, 16))
461461
{
462-
output.writeValue<uint32_t>("geometryHints", geometryHints);
462+
output.writeValue<int>("geometryHints", geometryHints);
463463
}
464464
}
465465

0 commit comments

Comments
 (0)