Merge changes I3e59c425,I46075a36,I73cd3e57,Ic09c196b * changes: Update Marl to c51271125 Squashed 'third_party/marl/' changes from 38c0c7a0f..c51271125 Repoint marl branch from master to main SubzeroReactor: Use new marl::Scheduler::Config API.
diff --git a/src/Pipeline/SpirvShaderDebugger.cpp b/src/Pipeline/SpirvShaderDebugger.cpp index a93a1a3..795fd78 100644 --- a/src/Pipeline/SpirvShaderDebugger.cpp +++ b/src/Pipeline/SpirvShaderDebugger.cpp
@@ -150,6 +150,8 @@ // kindof() returns true iff kind is of this type, or any type deriving from // this type. static constexpr bool kindof(Object::Kind kind) { return true; } + + virtual ~Object() = default; }; // cstr() returns the c-string name of the given Object::Kind. @@ -437,7 +439,7 @@ { auto offset = elSize * i * (interleaved ? sw::SIMD::Width : 1); auto elPtr = static_cast<uint8_t *>(ptr) + offset; - auto elKey = tostring(i); + auto elKey = (components > 4) ? tostring(i) : &"x\0y\0z\0w\0"[i * 2]; # if DEBUG_ANNOTATE_VARIABLE_KEYS elKey += " (" + tostring(elPtr) + " +" + tostring(offset) + ")" + (interleaved ? "I" : "F"); # endif @@ -704,8 +706,8 @@ private: // add() registers the debug object with the given id. - template<typename ID, typename T> - void add(ID id, T *); + template<typename ID> + void add(ID id, std::unique_ptr<debug::Object> &&); // addNone() registers given id as a None value or type. void addNone(debug::Object::ID id); @@ -1143,7 +1145,7 @@ switch(pass) { case Pass::Define: - add(id, new T()); + add(id, std::unique_ptr<debug::Object>(new T())); break; case Pass::Emit: emit(get<T>(id)); @@ -1437,11 +1439,11 @@ } } -template<typename ID, typename T> -void SpirvShader::Impl::Debugger::add(ID id, T *obj) +template<typename ID> +void SpirvShader::Impl::Debugger::add(ID id, std::unique_ptr<debug::Object> &&obj) { ASSERT_MSG(obj != nullptr, "add() called with nullptr obj"); - bool added = objects.emplace(debug::Object::ID(id.value()), obj).second; + bool added = objects.emplace(debug::Object::ID(id.value()), std::move(obj)).second; ASSERT_MSG(added, "Debug object with %d already exists", id.value()); }