mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add SPIRVIterator comparisons and SPIRVId stringification
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
#include "spirv_editor.h"
|
||||
#include <utility>
|
||||
#include "common/common.h"
|
||||
#include "serialise/serialiser.h"
|
||||
|
||||
template <>
|
||||
std::string DoStringise(const SPIRVId &el)
|
||||
{
|
||||
return StringFormat::Fmt("%u", el.id);
|
||||
}
|
||||
|
||||
SPIRVScalar::SPIRVScalar(SPIRVIterator it)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "3rdparty/glslang/SPIRV/spirv.hpp"
|
||||
#include "api/replay/renderdoc_replay.h"
|
||||
|
||||
class SPIRVOperation;
|
||||
class SPIRVEditor;
|
||||
@@ -44,6 +45,8 @@ struct SPIRVId
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
DECLARE_STRINGISE_TYPE(SPIRVId);
|
||||
|
||||
// length of 1 word in the top 16-bits, OpNop = 0 in the lower 16-bits
|
||||
#define SPV_NOP (0x00010000)
|
||||
|
||||
@@ -70,6 +73,11 @@ public:
|
||||
|
||||
return *this;
|
||||
}
|
||||
bool operator==(const SPIRVIterator &it) const
|
||||
{
|
||||
return words == it.words && offset == it.offset;
|
||||
}
|
||||
bool operator!=(const SPIRVIterator &it) const { return !(*this == it); }
|
||||
// utility functions
|
||||
explicit operator bool() const { return words != NULL && offset < words->size(); }
|
||||
uint32_t &operator*() { return cur(); }
|
||||
|
||||
Reference in New Issue
Block a user