Skip to content

Commit

Permalink
Re-add native matrix multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
dpw13 authored and kblaschke committed Feb 21, 2024
1 parent 3aa48a3 commit 07c9a8a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vendor/hlslparser/src/GLSLGenerator.cpp
Expand Up @@ -430,6 +430,11 @@ bool GLSLGenerator::Generate(HLSLTree* tree, Target target, Version version, con
m_writer.WriteLine(0, "vec2 %s(vec2 x, vec2 y) { return vec2(%s(x.x, y.x), %s(x.y, y.y)); }", m_altMultFunction, m_altMultFunction, m_altMultFunction);
m_writer.WriteLine(0, "vec3 %s(vec3 x, vec3 y) { return vec3(%s(x.x, y.x), %s(x.y, y.y), %s(x.z, y.z)); }", m_altMultFunction, m_altMultFunction, m_altMultFunction, m_altMultFunction);
m_writer.WriteLine(0, "vec4 %s(vec4 x, vec4 y) { return vec4(%s(x.x, y.x), %s(x.y, y.y), %s(x.z, y.z), %s(x.w, y.w)); }", m_altMultFunction, m_altMultFunction, m_altMultFunction, m_altMultFunction, m_altMultFunction);
// For matrix multiplication just perform the multiplication
m_writer.WriteLine(0, "mat2 %s(mat2 x, mat2 y) { return x * y; }", m_altMultFunction);
m_writer.WriteLine(0, "mat3 %s(mat3 x, mat3 y) { return x * y; }", m_altMultFunction);
m_writer.WriteLine(0, "mat4 %s(mat4 x, mat4 y) { return x * y; }", m_altMultFunction);

}

m_writer.WriteLine(0, "vec2 %s(float x) { return vec2(x, x); }", m_scalarSwizzle2Function);
Expand Down

0 comments on commit 07c9a8a

Please sign in to comment.