[SM6.10][Exec][Bugfix] Add matrix layout conversion helpers, post-execute command list callback, and re-enable OuterProduct test#8606
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
| Args.c_str()); | ||
| addUAVBuffer(Op.get(), "Input", InBuffSize, false, "byname"); | ||
| addUAVBuffer(Op.get(), "Output", OutBufferSize, true); | ||
| addUAVBuffer(Op.get(), "Output", OutBufferSize, /*ReadBack=*/false); |
There was a problem hiding this comment.
Maybe I'm wrong, but I see you using GetResource on the "Output" buffer, in the code below. Doesn't that mean that this ReadBack bool should remain true?
There was a problem hiding this comment.
The "Output" buffer is not being read by the CPU, so the ReadBack bool is false. The "Output" buffer is also in the opaque outer-product-optimal layout, so we shouldn't even try to interpret it without first converting it to a layout we do know how to read.
The GetResource just obtains a handle to be able to refer to the "Output" buffer so that we can record a ConvertLinearAlgebraMatrix command into the command list to tell the GPU to convert it into row-major order and store it into "OutputRowMajor", which the CPU does read back.
Addresses the matrix layout conversion requirement of issue #8386
This PR re-enables the OuterProduct smoke test and adds support for matrix layout conversions via new dedicated helper functions in
HLSLExecTestUtils.h/.cppand a new post-execute command list callback inShaderOpTest.h/.cpp.getLinAlgMatrixByteSize,recordLinAlgMatrixConversion, andtoLinAlgDataTypefor querying matrix byte sizes, recording a matrix layout conversion operation to a command list, and converting DXIL component type enums into D3D12 LinAlg datatype enumsConvertLinearAlgebraMatrixcommand. Instead of converting the COMPUTE command list into a DIRECT command list, I opted to create a separate DIRECT command list that runs after the COMPUTE command list to perform the matrix layout conversion. If it is preferrable to simply change the COMPUTE command list into a DIRECT command list and append theConvertLinearAlgebraMatrixafter the dispatch, I am not opposed to it and can change it per reviewers' requests. I am not sure which is the better solution hereAssisted by: Claude Opus 4.8