diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2020-09-14 11:42:31 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2020-09-14 12:45:59 +0300 |
commit | 66afe8c4991f23f791b07339262f085d0a41a55d (patch) | |
tree | b74e73ead65df0386f1be0c6b334bf3ca62be03e /spirv_cross.hpp | |
parent | bdbef7b1f3982fe99a62d076043036abe6dd6d80 (diff) |
Implement a simple evaluator of specialization constants.
In some cases, we need to get a literal value from a spec constant op.
Mostly relevant when emitting buffers, so implement a 32-bit integer
scalar subset of the evaluator. Can be extended as needed to support
evaluating any specialization constant operation.
Diffstat (limited to 'spirv_cross.hpp')
-rw-r--r-- | spirv_cross.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spirv_cross.hpp b/spirv_cross.hpp index 17c08188..a502da11 100644 --- a/spirv_cross.hpp +++ b/spirv_cross.hpp @@ -1060,6 +1060,9 @@ protected: bool flush_phi_required(BlockID from, BlockID to) const; + uint32_t evaluate_spec_constant_u32(const SPIRConstantOp &spec) const; + uint32_t evaluate_constant_u32(uint32_t id) const; + private: // Used only to implement the old deprecated get_entry_point() interface. const SPIREntryPoint &get_first_entry_point(const std::string &name) const; |