Skip to content

Commit

Permalink
Merge pull request godotengine#89420 from RandomShaper/sort_scs
Browse files Browse the repository at this point in the history
Ensure specialization constants come sorted from reflection
  • Loading branch information
akien-mga committed Mar 12, 2024
2 parents 20373d0 + 49625be commit 6128206
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 6128206

Please sign in to comment.