Skip to content

Commit a5b1aa0

Browse files
McNoppercsyonghe
andauthored
Added const version for the operator[] in Matrix (shader-slang#6186)
Co-authored-by: Yong He <yonghe@outlook.com>
1 parent 92a48f6 commit a5b1aa0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

prelude/slang-cpp-types-core.h

+1
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ template<typename T, int ROWS, int COLS>
392392
struct Matrix
393393
{
394394
Vector<T, COLS> rows[ROWS];
395+
const Vector<T, COLS>& operator[](size_t index) const { return rows[index]; }
395396
Vector<T, COLS>& operator[](size_t index) { return rows[index]; }
396397
Matrix() = default;
397398
Matrix(T scalar)

0 commit comments

Comments
 (0)