diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp index dd4c2c096..da3ac380c 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp @@ -2513,6 +2513,7 @@ void LLVMOrderAccumulator::processGlobals(Program *prog) { assignTypeId(inst->args[a]->type); accumulate(cast(inst->args[a])); + assignTypeId(cast(inst->args[a])); } assignTypeId(inst->type); for(size_t m = 0; m < inst->getAttachedMeta().size(); m++) @@ -2716,6 +2717,19 @@ void LLVMOrderAccumulator::assignTypeId(const Type *t) types.push_back(t); } +void LLVMOrderAccumulator::assignTypeId(const Constant *c) +{ + if(!c) + return; + + assignTypeId(c->type); + if(c->isCast()) + assignTypeId(cast(c->getInner())); + else if(c->isCompound()) + for(Value *v : c->getMembers()) + assignTypeId(cast(v)); +} + void LLVMOrderAccumulator::accumulate(const Value *v) { Value *value = (Value *)v; diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.h b/renderdoc/driver/shaders/dxil/dxil_bytecode.h index 1767b3c75..cd66631bd 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.h +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.h @@ -1172,6 +1172,7 @@ private: void accumulateTypePrintOrder(const Type *t); void accumulateTypePrintOrder(rdcarray &visited, const Metadata *m); void assignTypeId(const Type *t); + void assignTypeId(const Constant *c); }; }; // namespace DXIL