mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
f5bfa728eb
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. |
||
---|---|---|
.. | ||
hlsl | ||
.gitignore | ||
d3d12_crosstest.h | ||
d3d12_invalid_usage.c | ||
d3d12_test_utils.h | ||
d3d12.c | ||
driver.c | ||
dxcompiler.idl | ||
hlsl_d3d12.c | ||
preproc-if-expr.shader_test | ||
preproc-if.shader_test | ||
preproc-ifdef.shader_test | ||
preproc-invalid.shader_test | ||
preproc-macro.shader_test | ||
preproc-misc.shader_test | ||
shader_runner_d3d9.c | ||
shader_runner_d3d11.c | ||
shader_runner_d3d12.c | ||
shader_runner_gl.c | ||
shader_runner_vulkan.c | ||
shader_runner.c | ||
shader_runner.h | ||
test-driver.sh | ||
utils.h | ||
vkd3d_api.c | ||
vkd3d_common.c | ||
vkd3d_shader_api.c | ||
vulkan_procs.h |