Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix verification in ExecutionTest::ComputeSampleTest (microsoft#6405)
The `ComputeSampleTest` is verifying `Sample` and `CalculateLevelOfDetail` intrinsics calls on a texture in compute, mesh and amplification shaders. The test is set up in a way that the reported LOD values should be increasing as the X and Y coordinates increase. However, since the test results are stored in quad z-order, and it is perfectly valid for the X-derivative-LOD to decrease when going from top-right to bottom-left pixel in a quad because in this case the X coordinate decreases. Therefore, the test needs verify the LOD values are increasing everywhere except for the bottom-left quad pixel (every output with `index % 4 == 2`). Previously, the test coincidentally worked for compute shaders because it uses thread group of 336 and the 1/336 difference between 0 and pixel 1's X coordinate is not sufficient to change LODs. For mesh, however, since the limit of a thread group size is 128, the validation is done using the smaller range of 116, and 1/116 is sufficient to change LOD for pixel 1. This PR also fixes a couple of mismatched thread group dimensions in `VerifySampleResults`. The shader code for this test is at [ShaderOpArith.xml](https://github.com/microsoft/DirectXShaderCompiler/blob/130877392c263888ef06bab768856d3dab1f1c9a/tools/clang/unittests/HLSLExec/ShaderOpArith.xml#L454) line 454. Fixes microsoft#4788 Fixes microsoft#6181 --------- Co-authored-by: Greg Roth <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information