Skip to content

Commit

Permalink
Ensure specialization constants come sorted from reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Mar 12, 2024
1 parent b18942d commit 49625be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions servers/rendering/rendering_device_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,8 @@ class RenderingDeviceCommons : public Object {

struct ShaderSpecializationConstant : public PipelineSpecializationConstant {
BitField<ShaderStage> stages;

bool operator<(const ShaderSpecializationConstant &p_other) const { return constant_id < p_other.constant_id; }
};

struct ShaderDescription {
Expand Down
2 changes: 2 additions & 0 deletions servers/rendering/rendering_device_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ Error RenderingDeviceDriver::_reflect_spirv(VectorView<ShaderStageSPIRVData> p_s
r_reflection.specialization_constants.push_back(sconst);
}
}

r_reflection.specialization_constants.sort();
}
}

Expand Down

0 comments on commit 49625be

Please sign in to comment.