DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Fix verification in ExecutionTest::ComputeSampleTest

Open hekota opened this issue 11 months ago • 0 comments

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 line 454.

Fixes #4788 Fixes #6181

hekota avatar Mar 12 '24 16:03 hekota