mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 07:05:48 +00:00
Add a SPIR-V editor helper to register a constant with a pre-given ID
This commit is contained in:
@@ -179,9 +179,15 @@ public:
|
||||
// helper for AddConstant
|
||||
template <typename T>
|
||||
Id AddConstantImmediate(T t)
|
||||
{
|
||||
return AddConstantImmediate<T>(t, MakeId());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
Id AddConstantImmediate(T t, rdcspv::Id constantId)
|
||||
{
|
||||
Id typeId = DeclareType(scalar<T>());
|
||||
rdcarray<uint32_t> words = {typeId.value(), MakeId().value()};
|
||||
rdcarray<uint32_t> words = {typeId.value(), constantId.value()};
|
||||
|
||||
words.resize(words.size() + (sizeof(T) + 3) / 4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user