Fix issues trying to patch simple/tiny DXIL shaders

This commit is contained in:
baldurk
2022-01-17 14:05:11 +00:00
parent e0b4a2771f
commit 53b09724a1
2 changed files with 8 additions and 8 deletions
@@ -191,11 +191,7 @@ static bool AnnotateDXILShader(const DXBC::DXBCContainer *dxbc, uint32_t space,
const std::map<D3D12FeedbackKey, D3D12FeedbackSlot> &slots,
bytebuf &editedBlob)
{
DXIL::ProgramEditor editor(dxbc, slots.size(), editedBlob);
const DXIL::Type *i32 = editor.GetInt32Type();
const DXIL::Type *i8 = editor.GetInt8Type();
const DXIL::Type *i1 = editor.GetBoolType();
DXIL::ProgramEditor editor(dxbc, slots.size() + 64, editedBlob);
const DXIL::Type *handleType = editor.GetTypeByName("dx.types.Handle");
const DXIL::Function *createHandle = editor.GetFunctionByName("dx.op.createHandle");
@@ -205,6 +201,10 @@ static bool AnnotateDXILShader(const DXBC::DXBCContainer *dxbc, uint32_t space,
if(!handleType || !createHandle)
return false;
const DXIL::Type *i32 = editor.GetInt32Type();
const DXIL::Type *i8 = editor.GetInt8Type();
const DXIL::Type *i1 = editor.GetBoolType();
// get the atomic function we'll need
const DXIL::Function *atomicBinOp = editor.GetFunctionByName("dx.op.atomicBinOp.i32");
if(!atomicBinOp)
@@ -2387,7 +2387,7 @@ const DXIL::Type *Program::GetBoolType()
}
if(!m_BoolType)
RDCERR("Couldn't find void type");
RDCERR("Couldn't find bool type");
return m_BoolType;
}
@@ -2408,7 +2408,7 @@ const Type *Program::GetInt32Type()
}
if(!m_Int32Type)
RDCERR("Couldn't find void type");
RDCERR("Couldn't find int32 type");
return m_Int32Type;
}
@@ -2429,7 +2429,7 @@ const Type *Program::GetInt8Type()
}
if(!m_Int8Type)
RDCERR("Couldn't find void type");
RDCERR("Couldn't find int8 type");
return m_Int8Type;
}