Add shader entry tag to common header

* We also allow GetPointerType to silently return NULL when no pointer exists,
  as this will be useful for encoding when we want to check if a pointer type
  exists.
This commit is contained in:
baldurk
2021-09-20 17:57:51 +01:00
parent 42f508df85
commit e1efc83fe3
3 changed files with 12 additions and 14 deletions
@@ -2435,9 +2435,7 @@ const Type *Program::GetPointerType(const Type *type, Type::PointerAddrSpace add
}
}
RDCERR("Couldn't find pointer type");
return type;
return NULL;
}
Metadata::~Metadata()
@@ -81,6 +81,15 @@ enum class ResourceKind
SamplerComparison,
};
enum class ShaderEntryTag
{
ShaderFlags = 0,
Geometry = 1,
Domain = 2,
Hull = 3,
Compute = 4,
};
}; // namespace DXIL
DECLARE_STRINGISE_TYPE(DXIL::ComponentType);
+2 -11
View File
@@ -28,15 +28,6 @@
namespace DXIL
{
enum class ShaderTag
{
ShaderFlags = 0,
Geometry = 1,
Domain = 2,
Hull = 3,
Compute = 4,
};
enum class ResField
{
ID = 0,
@@ -149,7 +140,7 @@ void Program::FetchComputeProperties(DXBC::Reflection *reflection)
for(size_t t = 0; t < tags.children.size(); t += 2)
{
RDCASSERT(tags.children[t]->isConstant);
if(getival<ShaderTag>(tags.children[t]) == ShaderTag::Compute)
if(getival<ShaderEntryTag>(tags.children[t]) == ShaderEntryTag::Compute)
{
Metadata &threadDim = *tags.children[t + 1];
RDCASSERTEQUAL(threadDim.children.size(), 3);
@@ -190,7 +181,7 @@ D3D_PRIMITIVE_TOPOLOGY Program::GetOutputTopology()
for(size_t t = 0; t < tags.children.size(); t += 2)
{
RDCASSERT(tags.children[t]->isConstant);
if(getival<ShaderTag>(tags.children[t]) == ShaderTag::Geometry)
if(getival<ShaderEntryTag>(tags.children[t]) == ShaderEntryTag::Geometry)
{
Metadata &geomData = *tags.children[t + 1];
RDCASSERTEQUAL(geomData.children.size(), 5);