diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2021-08-23 12:29:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 12:29:01 +0300 |
commit | fad15907867d23d5b06a8f65d4428c2885a5e8b5 (patch) | |
tree | 9dcdf4d2049f6f692a4a9d86dd640995faf58577 /shaders-msl | |
parent | 27e7abeab15e2f76dfe1bce8cef242c1fa2b110b (diff) | |
parent | 9552ca5473a12d87dfdb3e35327816d8648c7db0 (diff) |
Merge pull request #1722 from billhollings/row-maj-mtx-store-from-const
MSL: Support row-major transpose when storing matrix from constant RHS matrix.
Diffstat (limited to 'shaders-msl')
-rw-r--r-- | shaders-msl/comp/mat3-row-maj-read-write-const.comp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/shaders-msl/comp/mat3-row-maj-read-write-const.comp b/shaders-msl/comp/mat3-row-maj-read-write-const.comp new file mode 100644 index 00000000..068ad797 --- /dev/null +++ b/shaders-msl/comp/mat3-row-maj-read-write-const.comp @@ -0,0 +1,17 @@ +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(set = 0, binding = 1, std430) buffer model_t +{ + layout(row_major) mediump mat3 mtx_rm; +} model; + +void main() +{ + mat3 mtx_cm = model.mtx_rm; + mat3 mtx1 = mtx_cm * mat3(vec3(4.0, -3.0, 1.0), vec3(-7.0, 7.0, -7.0), vec3(-5.0, 6.0, -8.0)); + if (mtx1[0][0] != 0.0) + { + model.mtx_rm = mat3(vec3(-5.0, -3.0, -5.0), vec3(-2.0, 2.0, -5.0), vec3(6.0, 3.0, -8.0)); + } +} |