Remove ShaderConstantDescriptor, inline into ShaderConstantType

* This struct was redundant isnce it was only ever used in the type and not
  meaningfully accessed directly.
This commit is contained in:
baldurk
2022-05-20 14:15:31 +01:00
parent 8c6192d5bd
commit 31feedd16d
28 changed files with 1189 additions and 1264 deletions
+6 -6
View File
@@ -86,7 +86,7 @@ void PointerTypeRegistry::Init()
// type ID 0 is reserved as a NULL/empty descriptor
typeDescriptions.resize(1);
typeDescriptions[0].descriptor.name = "<Unknown>";
typeDescriptions[0].name = "<Unknown>";
}
uint32_t PointerTypeRegistry::GetTypeID(ResourceId shader, uint32_t pointerTypeId)
@@ -120,9 +120,9 @@ const ShaderConstantType &PointerTypeRegistry::GetTypeDescriptor(uint32_t typeId
void PointerTypeRegistry::CacheSubTypes(const ShaderReflection *reflection,
ShaderConstantType &structDef)
{
if((structDef.descriptor.pointerTypeID & TypeIDBit) == 0)
structDef.descriptor.pointerTypeID =
PointerTypeRegistry::GetTypeID(reflection->pointerTypes[structDef.descriptor.pointerTypeID]);
if((structDef.pointerTypeID & TypeIDBit) == 0)
structDef.pointerTypeID =
PointerTypeRegistry::GetTypeID(reflection->pointerTypes[structDef.pointerTypeID]);
for(ShaderConstant &member : structDef.members)
CacheSubTypes(reflection, member.type);
@@ -1070,8 +1070,8 @@ bool RichResourceTextMouseEvent(const QWidget *owner, const QVariant &var, QRect
if(!ptrType.members.isEmpty())
formatter = BufferFormatter::DeclareStruct(
BufferFormatter::EstimatePackingRules(ptrType.members), ptrType.descriptor.name,
ptrType.members, ptrType.descriptor.arrayByteStride);
BufferFormatter::EstimatePackingRules(ptrType.members), ptrType.name,
ptrType.members, ptrType.arrayByteStride);
IBufferViewer *view = ctx.ViewBuffer(ptr->offset, ~0ULL, ptr->base, formatter);