Skip to content

Commit

Permalink
Integrating matrix multiplication fix from OSL
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Feb 21, 2025
1 parent d807b38 commit b909967
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/OpenColorIO/GpuShaderClassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ std::string OSLShaderClassWrapper::getClassWrapperHeader(const std::string& orig
st.newLine() << "vector4 __operator__mul__(matrix m, vector4 v)";
st.newLine() << "{";
st.indent();
st.newLine() << "return vector4(v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], ";
st.newLine() << " v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], ";
st.newLine() << " v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3], ";
st.newLine() << " v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2] + v.w * m[3][3]);";
st.newLine() << "return transform(m, v);";
st.dedent();
st.newLine() << "}";

Expand Down
4 changes: 2 additions & 2 deletions src/OpenColorIO/GpuShaderUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ std::string matrix3Mul(const T * m3x3, const std::string & vecName, GpuLanguage
}
case LANGUAGE_OSL_1:
{
kw << "matrix(" << getMatrixValues<T, 3>(m3x3, lang, false) << ") * " << vecName;
kw << "matrix(" << getMatrixValues<T, 3>(m3x3, lang, true) << ") * " << vecName;
break;
}
case GPU_LANGUAGE_MSL_2_0:
Expand Down Expand Up @@ -1021,7 +1021,7 @@ std::string matrix4Mul(const T * m4x4, const std::string & vecName, GpuLanguage
}
case LANGUAGE_OSL_1:
{
kw << "matrix(" << getMatrixValues<T, 4>(m4x4, lang, false) << ") * " << vecName;
kw << "matrix(" << getMatrixValues<T, 4>(m4x4, lang, true) << ") * " << vecName;
break;
}
case GPU_LANGUAGE_MSL_2_0:
Expand Down

0 comments on commit b909967

Please sign in to comment.