mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 18:00:54 +00:00
RD DXIL Disassembly fix getival to work with Literal
Inlined getival to get around template instantiation outside of the compilation unit
This commit is contained in:
1 parent
a6b018b44b
commit
701220cc63
2 files changed
+15
-18
No files matched your search
@@ -1649,7 +1649,21 @@ rdcstr escapeString(const rdcstr &str);
|
||||
rdcstr escapeStringIfNeeded(const rdcstr &name);
|
||||
|
||||
template <typename T>
|
||||
bool getival(const Value *v, T &out);
|
||||
bool getival(const Value *v, T &out)
|
||||
{
|
||||
if(const Constant *c = cast<Constant>(v))
|
||||
{
|
||||
out = T(c->getU64());
|
||||
return true;
|
||||
}
|
||||
else if(const Literal *lit = cast<Literal>(v))
|
||||
{
|
||||
out = T(lit->literal);
|
||||
return true;
|
||||
}
|
||||
out = T();
|
||||
return false;
|
||||
}
|
||||
|
||||
}; // namespace DXIL
|
||||
|
||||
|
||||
@@ -82,23 +82,6 @@ bool isUndef(const Value *v)
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool getival(const Value *v, T &out)
|
||||
{
|
||||
if(const Constant *c = cast<Constant>(v))
|
||||
{
|
||||
out = T(c->getU64());
|
||||
return true;
|
||||
}
|
||||
else if(const Literal *lit = cast<Literal>(v))
|
||||
{
|
||||
out = T(c->getU64());
|
||||
return true;
|
||||
}
|
||||
out = T();
|
||||
return false;
|
||||
}
|
||||
|
||||
static const char *shaderNames[] = {
|
||||
"Pixel", "Vertex", "Geometry", "Hull", "Domain",
|
||||
"Compute", "Library", "RayGeneration", "Intersection", "AnyHit",
|
||||
|
||||
Reference in new issue
Block a user