From 5d2cfe9897b1bde88651a9ae20b7de3b8a1696f5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 1 Jun 2020 13:55:08 +0100 Subject: [PATCH] Handle stringising 64-bit enums --- renderdoc/api/replay/stringise.h | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/renderdoc/api/replay/stringise.h b/renderdoc/api/replay/stringise.h index 76297dc7d..64cde32df 100644 --- a/renderdoc/api/replay/stringise.h +++ b/renderdoc/api/replay/stringise.h @@ -87,7 +87,7 @@ rdcstr ToStr(const T &el) static const char empty_ret[] = #type "(0)"; \ static_assert(std::is_same::value, \ "Type in macro doesn't match el"); \ - uint32_t local = (uint32_t)el; \ + uint64_t local = (uint64_t)el; \ (void)(enumType) el; \ rdcstr ret; @@ -110,43 +110,43 @@ rdcstr ToStr(const T &el) #define STRINGISE_BITFIELD_BIT(b) \ if(el & b) \ { \ - local &= ~uint32_t(b); \ + local &= ~uint64_t(b); \ ret += " | " #b; \ } #define STRINGISE_BITFIELD_CLASS_BIT(b) \ if(el & enumType::b) \ { \ - local &= ~uint32_t(enumType::b); \ + local &= ~uint64_t(enumType::b); \ ret += " | " #b; \ } #define STRINGISE_BITFIELD_BIT_NAMED(b, str) \ if(el & b) \ { \ - local &= ~uint32_t(b); \ + local &= ~uint64_t(b); \ ret += " | " str; \ } #define STRINGISE_BITFIELD_CLASS_BIT_NAMED(b, str) \ if(el & enumType::b) \ { \ - local &= ~uint32_t(enumType::b); \ + local &= ~uint64_t(enumType::b); \ ret += " | " str; \ } -#define END_BITFIELD_STRINGISE() \ - if(local) \ - ret += unknown_prefix + ToStr(local) + ")"; \ - \ - if(ret.empty()) \ - { \ - ret = empty_ret; \ - } \ - else \ - { \ - ret = ret.substr(3); \ - } \ +#define END_BITFIELD_STRINGISE() \ + if(local) \ + ret += unknown_prefix + ToStr((uint32_t)local) + ")"; \ + \ + if(ret.empty()) \ + { \ + ret = empty_ret; \ + } \ + else \ + { \ + ret = ret.substr(3); \ + } \ return ret; template