vkd3d/tests
Francisco Casas f5bfa728eb vkd3d-shader/hlsl: Reorder default values for matrices for SM4.
Default value initializers behave differently than regular initializers
for matrices on SM4 profiles.

While regular initializers assign the rhs elements in reading-order
(completing one row at the time), default initializers assing the rhs
elements in Chinese reading-order (completing one column at the time).

So after lowering a default value to a constant, the index of the
component to which this default value is stored is computed to meet
this expectation. This can be done because the default values.

For reference, compiling this shader:

    row_major int2x3 m = {1, 2, 3, 4, 5, 6};

    float4 main() : sv_target
    {
        return float4(m[0][0], 99, 99, 99);
    }

gives the following buffer definition:

    // cbuffer $Globals
    // {
    //
    //   row_major int2x3 m;                // Offset:    0 Size:    28
    //      = 0x00000001 0x00000003 0x00000005 0x00000000
    //        0x00000002 0x00000004 0x00000006
    //
    // }

Given that the matrix is column-major, m's default value is actually
{{1, 3, 5}, {2, 4, 6}}, unlike the {{1, 2, 3}, {4, 5, 6}} one would
expect in a regular initializer.

SM1 profiles assign the elements in regular reading order.
2024-06-11 15:46:40 +02:00
..
hlsl tests: Test matrix default value initializers. 2024-06-11 15:46:40 +02:00
.gitignore tests: Add some C HLSL preprocessor tests. 2020-11-24 22:28:11 +01:00
d3d12_crosstest.h tests: Add llvmpipe among the Mesa drivers. 2024-04-10 08:54:50 -05:00
d3d12_invalid_usage.c tests/shader_runner: Use the global test_options structure. 2023-03-10 21:13:05 +01:00
d3d12_test_utils.h tests/d3d12: Test format D32_FLOAT_S8X24_UINT in test_get_copyable_footprints(). 2024-05-22 22:15:07 +02:00
d3d12.c tests: Skip a test that freezes the GPU on NVIDIA. 2024-05-27 21:07:43 +02:00
driver.c ci: Delimit building each commit with a collapsible section. 2024-04-09 12:28:10 -05:00
dxcompiler.idl tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
hlsl_d3d12.c vkd3d-shader/hlsl: Reorder default values for matrices for SM4. 2024-06-11 15:46:40 +02:00
preproc-if-expr.shader_test vkd3d-shader/preproc: Allow capital U and L after integer constants as well. 2022-02-02 21:06:21 +01:00
preproc-if.shader_test tests: Add some basic tests for #if and related preprocessor directives. 2020-11-23 22:07:44 +01:00
preproc-ifdef.shader_test tests: Add some tests for #ifdef and defined(). 2020-11-23 22:07:47 +01:00
preproc-invalid.shader_test tests: Add some tests for shaders which fail to preprocess. 2020-11-24 22:27:59 +01:00
preproc-macro.shader_test vkd3d-shader/preproc: Append spaces between tokens in macro invocations. 2023-08-02 20:19:21 +09:00
preproc-misc.shader_test tests: Add some more miscellaneous preprocessor tests. 2020-11-24 22:28:05 +01:00
shader_runner_d3d9.c tests/hlsl: Add an SV_InstanceId test. 2024-04-30 16:32:10 +02:00
shader_runner_d3d11.c tests/hlsl: Add a geometry shader test. 2024-05-08 21:08:13 +02:00
shader_runner_d3d12.c tests/hlsl: Add a geometry shader test. 2024-05-08 21:08:13 +02:00
shader_runner_gl.c Release 1.12. 2024-05-29 22:05:28 +02:00
shader_runner_vulkan.c Release 1.12. 2024-05-29 22:05:28 +02:00
shader_runner.c tests: Rename VKD3D_TESTS_SKIP_DXC to VKD3D_TEST_SKIP_DXC. 2024-05-27 21:08:14 +02:00
shader_runner.h tests/hlsl: Add a geometry shader test. 2024-05-08 21:08:13 +02:00
test-driver.sh tests/test-driver: Avoid "head" with negative line count. 2024-04-09 12:28:51 -05:00
utils.h tests: Include vkd3d_d3d12.h in utils.h. 2024-04-02 23:09:53 +02:00
vkd3d_api.c vkd3d-common: Get rid of InterlockedDecrement(). 2024-02-06 23:07:36 +01:00
vkd3d_common.c vkd3d-common: Move vkd3d_write_mask_is_contiguous() from vkd3d-shader. 2019-07-05 17:52:04 +02:00
vkd3d_shader_api.c vkd3d-shader: Add a compile option to control whether implicit truncation warnings are printed. 2024-03-27 22:37:34 +01:00
vulkan_procs.h vkd3d-shader/spirv: Implement support for rasteriser-ordered views. 2024-03-08 23:36:35 +01:00