|
@@ -25,6 +25,7 @@
|
|
#include "dxc/DXIL/DxilUtil.h"
|
|
#include "dxc/DXIL/DxilUtil.h"
|
|
#include "dxc/DXIL/DxilFunctionProps.h"
|
|
#include "dxc/DXIL/DxilFunctionProps.h"
|
|
#include "dxc/DXIL/DxilOperations.h"
|
|
#include "dxc/DXIL/DxilOperations.h"
|
|
|
|
+#include "dxc/DXIL/DxilInstructions.h"
|
|
#include "dxc/Support/Global.h"
|
|
#include "dxc/Support/Global.h"
|
|
#include "dxc/Support/Unicode.h"
|
|
#include "dxc/Support/Unicode.h"
|
|
#include "dxc/Support/WinIncludes.h"
|
|
#include "dxc/Support/WinIncludes.h"
|
|
@@ -601,13 +602,12 @@ public:
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- case ShaderModel::Kind::Amplification:
|
|
|
|
case ShaderModel::Kind::Compute:
|
|
case ShaderModel::Kind::Compute:
|
|
case ShaderModel::Kind::Library:
|
|
case ShaderModel::Kind::Library:
|
|
case ShaderModel::Kind::Invalid:
|
|
case ShaderModel::Kind::Invalid:
|
|
- // Amplification, Compute, Library, and Invalide not relevant to PSVRuntimeInfo0
|
|
|
|
|
|
+ // Compute, Library, and Invalid not relevant to PSVRuntimeInfo0
|
|
break;
|
|
break;
|
|
- case ShaderModel::Kind::Mesh:
|
|
|
|
|
|
+ case ShaderModel::Kind::Mesh: {
|
|
pInfo->MS.MaxOutputVertices = (UINT)m_Module.GetMaxOutputVertices();
|
|
pInfo->MS.MaxOutputVertices = (UINT)m_Module.GetMaxOutputVertices();
|
|
pInfo->MS.MaxOutputPrimitives = (UINT)m_Module.GetMaxOutputPrimitives();
|
|
pInfo->MS.MaxOutputPrimitives = (UINT)m_Module.GetMaxOutputPrimitives();
|
|
pInfo1->MeshOutputTopology = (UINT)m_Module.GetMeshOutputTopology();
|
|
pInfo1->MeshOutputTopology = (UINT)m_Module.GetMeshOutputTopology();
|
|
@@ -634,18 +634,11 @@ public:
|
|
// Calls to external functions.
|
|
// Calls to external functions.
|
|
const CallInst *CI = dyn_cast<CallInst>(&I);
|
|
const CallInst *CI = dyn_cast<CallInst>(&I);
|
|
if (CI) {
|
|
if (CI) {
|
|
- Function *FCalled = CI->getCalledFunction();
|
|
|
|
- if (FCalled->isDeclaration()) {
|
|
|
|
- Value *opcodeVal = CI->getOperand(0);
|
|
|
|
- ConstantInt *OpcodeConst = dyn_cast<ConstantInt>(opcodeVal);
|
|
|
|
- unsigned opcode = OpcodeConst->getLimitedValue();
|
|
|
|
- DXIL::OpCode dxilOpcode = (DXIL::OpCode)opcode;
|
|
|
|
- if (dxilOpcode == DXIL::OpCode::GetMeshPayload) {
|
|
|
|
- PointerType *payloadPTy = cast<PointerType>(CI->getType());
|
|
|
|
- Type *payloadTy = payloadPTy->getPointerElementType();
|
|
|
|
- payloadByteSize = DL.getTypeAllocSize(payloadTy);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ if (hlsl::OP::IsDxilOpFuncCallInst(CI,DXIL::OpCode::GetMeshPayload)) {
|
|
|
|
+ PointerType *payloadPTy = cast<PointerType>(CI->getType());
|
|
|
|
+ Type *payloadTy = payloadPTy->getPointerElementType();
|
|
|
|
+ payloadByteSize = DL.getTypeAllocSize(payloadTy);
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -655,6 +648,36 @@ public:
|
|
pInfo->MS.PayloadSizeInBytes = payloadByteSize;
|
|
pInfo->MS.PayloadSizeInBytes = payloadByteSize;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ case ShaderModel::Kind::Amplification: {
|
|
|
|
+ const Function *entryFunc = m_Module.GetEntryFunction();
|
|
|
|
+ unsigned payloadByteSize = 0;
|
|
|
|
+ Module *mod = m_Module.GetModule();
|
|
|
|
+ const DataLayout &DL = mod->getDataLayout();
|
|
|
|
+ for (auto b = entryFunc->begin(), bend = entryFunc->end(); b != bend;
|
|
|
|
+ ++b) {
|
|
|
|
+ auto i = b->begin(), iend = b->end();
|
|
|
|
+ for (; i != iend; ++i) {
|
|
|
|
+ const Instruction &I = *i;
|
|
|
|
+
|
|
|
|
+ // Calls to external functions.
|
|
|
|
+ const CallInst *CI = dyn_cast<CallInst>(&I);
|
|
|
|
+ if (CI) {
|
|
|
|
+ if (hlsl::OP::IsDxilOpFuncCallInst(CI,DXIL::OpCode::DispatchMesh)) {
|
|
|
|
+ DxilInst_DispatchMesh dispatchMeshCall(const_cast<CallInst*>(CI));
|
|
|
|
+ Value *operandVal = dispatchMeshCall.get_payload();
|
|
|
|
+ Type *payloadTy = operandVal->getType();
|
|
|
|
+ payloadByteSize = DL.getTypeAllocSize(payloadTy);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (i != iend)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ pInfo->AS.PayloadSizeInBytes = payloadByteSize;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
// Set resource binding information
|
|
// Set resource binding information
|
|
UINT uResIndex = 0;
|
|
UINT uResIndex = 0;
|