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:
Jake Turner committed 2024-06-03 12:26:09 +01:00
1 parent a6b018b44b
commit 701220cc63
2 files changed
+15 -18

No files matched your search

+15 -1
View File
@@ -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",