KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.91k stars 817 forks source link

Support constant expression calculated by matrixCompMult. #3465

Closed jimihem closed 1 day ago

jimihem commented 6 months ago

glslang report error for "const mat2 cval = matrixCompMult(mat2(1.0), mat2(1.0));". Spec says: The value returned by certain built-in function calls whose arguments are all constant expressions is also constant expressions.

jimihem commented 5 months ago

@ncesario-lunarg Please review this PR.

jimihem commented 2 months ago

@arcady-lunarg Please help review this PR.

arcady-lunarg commented 3 weeks ago

Actually, have you seen the discussion in #925? From reading it, it sounds like matrixCompMult is not supposed to be constant-folded.

jimihem commented 2 days ago

@arcady-lunarg glslcompiler in mesa support matrixCompMult constant fold. I have made some modifications based on your feedback.

arcady-lunarg commented 1 day ago

I've rebased your branch, as soon as it clears CI I will do a squash and merge.