mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07: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. |
||
---|---|---|
.. | ||
vkd3d | ||
vkd3d-common | ||
vkd3d-shader | ||
vkd3d-utils | ||
.gitignore |