Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cdfd9a3

Browse files
committedMay 20, 2024·
RD DXIL Disassembly fix getival to work with Literal
Inlined getival to get around template instantiation outside of the compilation unit
1 parent 6f81484 commit cdfd9a3

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed
 

‎renderdoc/driver/shaders/dxil/dxil_bytecode.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,21 @@ rdcstr escapeString(const rdcstr &str);
16371637
rdcstr escapeStringIfNeeded(const rdcstr &name);
16381638

16391639
template <typename T>
1640-
bool getival(const Value *v, T &out);
1640+
bool getival(const Value *v, T &out)
1641+
{
1642+
if(const Constant *c = cast<Constant>(v))
1643+
{
1644+
out = T(c->getU64());
1645+
return true;
1646+
}
1647+
else if(const Literal *lit = cast<Literal>(v))
1648+
{
1649+
out = T(lit->literal);
1650+
return true;
1651+
}
1652+
out = T();
1653+
return false;
1654+
}
16411655

16421656
}; // namespace DXIL
16431657

‎renderdoc/driver/shaders/dxil/dxil_disassemble.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,6 @@ bool isUndef(const Value *v)
8282
return false;
8383
}
8484

85-
template <typename T>
86-
bool getival(const Value *v, T &out)
87-
{
88-
if(const Constant *c = cast<Constant>(v))
89-
{
90-
out = T(c->getU64());
91-
return true;
92-
}
93-
else if(const Literal *lit = cast<Literal>(v))
94-
{
95-
out = T(c->getU64());
96-
return true;
97-
}
98-
out = T();
99-
return false;
100-
}
101-
10285
static const char *shaderNames[] = {
10386
"Pixel", "Vertex", "Geometry", "Hull", "Domain",
10487
"Compute", "Library", "RayGeneration", "Intersection", "AnyHit",

0 commit comments

Comments
 (0)
Please sign in to comment.