mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-23 12:31:09 +00:00
Encode function instructions
This commit is contained in:
7 files changed
+668
-20
No files matched your search
@@ -236,18 +236,36 @@ void FreeAlignedBuffer(byte *buf)
|
||||
|
||||
uint32_t Log2Floor(uint32_t value)
|
||||
{
|
||||
RDCASSERT(value > 0);
|
||||
if(!value)
|
||||
return ~0U;
|
||||
return 31 - Bits::CountLeadingZeroes(value);
|
||||
}
|
||||
|
||||
#if ENABLED(RDOC_X64)
|
||||
uint64_t Log2Floor(uint64_t value)
|
||||
{
|
||||
RDCASSERT(value > 0);
|
||||
if(!value)
|
||||
return ~0ULL;
|
||||
return 63 - Bits::CountLeadingZeroes(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t Log2Ceil(uint32_t value)
|
||||
{
|
||||
if(!value)
|
||||
return ~0U;
|
||||
return 32 - Bits::CountLeadingZeroes(value - 1);
|
||||
}
|
||||
|
||||
#if ENABLED(RDOC_X64)
|
||||
uint64_t Log2Ceil(uint64_t value)
|
||||
{
|
||||
if(!value)
|
||||
return ~0ULL;
|
||||
return 64 - Bits::CountLeadingZeroes(value - 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
// deliberately leak so it doesn't get destroyed before our static RenderDoc destructor needs it
|
||||
static rdcstr *logfile = new rdcstr;
|
||||
static FileIO::LogFileHandle *logfileHandle = NULL;
|
||||
|
||||
Reference in new issue
Block a user