Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrdb <git@rdb.name>2020-11-05 19:09:33 +0300
committerrdb <git@rdb.name>2020-11-07 00:27:54 +0300
commitbf71994daec81acc111d2939ddf32ab564568e47 (patch)
tree20f78bb38585767cd78e49e4b448cb78463a2d54 /shaders
parenta20c768698836d93a86d0fe742081012b66c6afd (diff)
GLSL: implement transpose() in GLSL 1.10 / ES 1.00
Diffstat (limited to 'shaders')
-rw-r--r--shaders/legacy/vert/transpose.legacy.vert14
1 files changed, 13 insertions, 1 deletions
diff --git a/shaders/legacy/vert/transpose.legacy.vert b/shaders/legacy/vert/transpose.legacy.vert
index 84f61826..588c28d5 100644
--- a/shaders/legacy/vert/transpose.legacy.vert
+++ b/shaders/legacy/vert/transpose.legacy.vert
@@ -15,6 +15,18 @@ void main()
vec4 c1 = M * (MVPColMajor * Position);
vec4 c2 = M * (Position * MVPRowMajor);
vec4 c3 = M * (Position * MVPColMajor);
- gl_Position = c0 + c1 + c2 + c3;
+
+ vec4 c4 = transpose(MVPRowMajor) * Position;
+ vec4 c5 = transpose(MVPColMajor) * Position;
+ vec4 c6 = Position * transpose(MVPRowMajor);
+ vec4 c7 = Position * transpose(MVPColMajor);
+
+ // Multiplying by scalar forces resolution of the transposition
+ vec4 c8 = (MVPRowMajor * 2.0) * Position;
+ vec4 c9 = (transpose(MVPColMajor) * 2.0) * Position;
+ vec4 c10 = Position * (MVPRowMajor * 2.0);
+ vec4 c11 = Position * (transpose(MVPColMajor) * 2.0);
+
+ gl_Position = c0 + c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9 + c10 + c11;
}