Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1629,14 +1629,15 @@ std::shared_ptr<st::ShaderOpTestResult>
runShaderOp(ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport,
std::unique_ptr<st::ShaderOp> Op,
st::ShaderOpTest::TInitCallbackFn InitCallback,
st::ShaderOpTest::TCommandCallbackFn PostDispatchCallback) {
st::ShaderOpTest::TCommandCallbackFn PostDispatchCallback,
st::ShaderOpTest::TCommandCallbackFn PreDispatchCallback) {
auto OpSet = std::make_shared<st::ShaderOpSet>();
OpSet->ShaderOps.push_back(std::move(Op));

return st::RunShaderOpTestAfterParse(
Device, DxcSupport, nullptr, std::move(InitCallback),
/*pShaderCallback=*/nullptr, std::move(PostDispatchCallback),
std::move(OpSet));
std::move(OpSet), std::move(PreDispatchCallback));
}

void compileShader(dxc::SpecificDllLoader &DxcSupport, const char *Source,
Expand Down Expand Up @@ -1720,6 +1721,9 @@ UINT getLinAlgMatrixByteSize(ID3D12Device *Device, UINT NumRows,
Info.NumColumns = NumColumns;
Info.DestDataType = DataType;
DevicePreview->GetLinearAlgebraMatrixConversionDestinationInfo(&Info);
VERIFY_IS_TRUE(Info.DestSize != 0,
"Device reported no destination size for the requested "
"linear algebra matrix layout");
return Info.DestSize;
}

Expand Down
14 changes: 8 additions & 6 deletions tools/clang/unittests/HLSLExec/HlslExecTestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,12 @@ void addHeapRawUAV(st::ShaderOp *Op, const char *HeapName, const char *ResName,
void addRootTable(st::ShaderOp *Op, UINT Index, const char *HeapName);

/// Run a programmatically-built ShaderOp and return the result.
std::shared_ptr<st::ShaderOpTestResult> runShaderOp(
ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport,
std::unique_ptr<st::ShaderOp> Op,
st::ShaderOpTest::TInitCallbackFn InitCallback = nullptr,
st::ShaderOpTest::TCommandCallbackFn PostDispatchCallback = nullptr);
std::shared_ptr<st::ShaderOpTestResult>
runShaderOp(ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport,
std::unique_ptr<st::ShaderOp> Op,
st::ShaderOpTest::TInitCallbackFn InitCallback = nullptr,
st::ShaderOpTest::TCommandCallbackFn PostDispatchCallback = nullptr,
st::ShaderOpTest::TCommandCallbackFn PreDispatchCallback = nullptr);

/// Compiles an HLSL shader using the DXC API to verify it is well-formed.
/// Fails the test on compile error.
Expand All @@ -618,7 +619,8 @@ void compileShader(dxc::SpecificDllLoader &DxcSupport, const char *Source,
// runtime).
#if defined(DIRECT3D_LINEAR_ALGEBRA)
/// Query the number of bytes required to store an NumRows x NumColumns matrix
/// of the given datatype in the specified device layout.
/// of the given datatype in the specified device layout. Fails the test if the
/// device cannot serve the request, which it reports as a zero size.
UINT getLinAlgMatrixByteSize(ID3D12Device *Device, UINT NumRows,
UINT NumColumns,
D3D12_LINEAR_ALGEBRA_DATATYPE DataType,
Expand Down
Loading
Loading