diff --git a/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp b/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp index 08abe107a..a496a5207 100644 --- a/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp +++ b/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp @@ -217,13 +217,9 @@ static bool AnnotateDXILShader(const DXBC::DXBCContainer *dxbc, uint32_t space, const DXIL::Type *funcType = editor.AddType(atomicType); - DXIL::Type funcPtrType; - funcPtrType.type = DXIL::Type::Pointer; - funcPtrType.inner = funcType; - DXIL::Function atomicFunc; atomicFunc.name = "dx.op.atomicBinOp.i32"; - atomicFunc.funcType = editor.AddType(funcPtrType); + atomicFunc.funcType = funcType; atomicFunc.external = true; for(const DXIL::AttributeSet &attrs : editor.GetAttributeSets()) diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp index c7e7c9bd5..f11bf98ed 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp @@ -483,13 +483,6 @@ Program::Program(const byte *bytes, size_t length) for(size_t p = 6; p < rootchild.ops.size(); p++) RDCASSERT(rootchild.ops[p] == 0, p, rootchild.ops[p]); - const Type *ptrType = GetPointerType(f.funcType, Type::PointerAddrSpace::Default); - - if(ptrType == f.funcType) - RDCERR("Expected to find pointer type for function"); - - f.funcType = ptrType; - if(!f.external) functionDecls.push_back(m_Functions.size()); @@ -981,11 +974,11 @@ Program::Program(const byte *bytes, size_t length) size_t prevNumSymbols = m_Values.size(); size_t instrSymbolStart = 0; - f.args.reserve(f.funcType->inner->members.size()); - for(size_t i = 0; i < f.funcType->inner->members.size(); i++) + f.args.reserve(f.funcType->members.size()); + for(size_t i = 0; i < f.funcType->members.size(); i++) { Instruction arg; - arg.type = f.funcType->inner->members[i]; + arg.type = f.funcType->members[i]; arg.name = StringFormat::Fmt("arg%zu", i); f.args.push_back(arg); m_Values.push_back(Value(&f.args.back())); @@ -1276,16 +1269,16 @@ Program::Program(const byte *bytes, size_t length) } inst.funcCall = v.function; - inst.type = inst.funcCall->funcType->inner->inner; + inst.type = inst.funcCall->funcType->inner; if(funcCallType) { - RDCASSERT(funcCallType == inst.funcCall->funcType->inner); + RDCASSERT(funcCallType == inst.funcCall->funcType); } for(size_t i = 0; op.remaining() > 0; i++) { - if(inst.funcCall->funcType->inner->members[i]->type == Type::Metadata) + if(inst.funcCall->funcType->members[i]->type == Type::Metadata) { int32_t offs = (int32_t)op.get(); size_t idx = m_Values.size() - offs; @@ -1301,7 +1294,7 @@ Program::Program(const byte *bytes, size_t length) inst.args.push_back(v); } - RDCASSERTEQUAL(inst.args.size(), inst.funcCall->funcType->inner->members.size()); + RDCASSERTEQUAL(inst.args.size(), inst.funcCall->funcType->members.size()); f.instructions.push_back(inst); diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp index 95ad0fb94..2ca517a21 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp @@ -1135,7 +1135,7 @@ bytebuf ProgramEditor::EncodeProgram() const for(size_t i = 0; i < m_Functions.size(); i++) { const Function &f = m_Functions[i]; - uint64_t typeIndex = getTypeID(f.funcType->inner); + uint64_t typeIndex = getTypeID(f.funcType); RDCASSERT((size_t)typeIndex < m_Types.size()); @@ -1357,7 +1357,7 @@ bytebuf ProgramEditor::EncodeProgram() const vals.push_back(flags); if(inst.opFlags != InstructionFlags::NoFlags) vals.push_back((uint64_t)inst.opFlags); - vals.push_back(getTypeID(inst.funcCall->funcType->inner)); + vals.push_back(getTypeID(inst.funcCall->funcType)); encodeRelativeValueID(Value(inst.funcCall)); for(size_t a = 0; a < inst.args.size(); a++) { diff --git a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp index 25e6c03b0..d3d5a37c9 100644 --- a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp @@ -628,8 +628,8 @@ void Program::MakeDisassemblyString() } m_Disassembly += (func.external ? "declare " : "define "); - m_Disassembly += func.funcType->inner->declFunction("@" + escapeStringIfNeeded(func.name), - func.args, func.attrs); + m_Disassembly += + func.funcType->declFunction("@" + escapeStringIfNeeded(func.name), func.args, func.attrs); if(func.attrs && func.attrs->functionSlot) m_Disassembly += StringFormat::Fmt(" #%u", funcAttrGroups.indexOf(func.attrs->functionSlot));