Improve getEyeFromViewMatrix() (#9184)

Make the size of PerViewUib 2KiB again.

Add overloading functions for getEyeFromViewMatrix() and
getClipFromWorldMatrix().

BUGS=[441127971]
This commit is contained in:
Sungun Park
2025-09-04 12:02:22 -07:00
parent edbaa30ad8
commit 2bb9d13797
2 changed files with 13 additions and 3 deletions
@@ -209,12 +209,12 @@ struct PerViewUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
float es2Reserved2;
// bring PerViewUib to 2 KiB
math::float4 reserved[38];
math::float4 reserved[22];
};
// 2 KiB == 128 float4s
static_assert(sizeof(PerViewUib) == sizeof(math::float4) * 144,
"PerViewUib should be 16 x 144 bytes");
static_assert(sizeof(PerViewUib) == sizeof(math::float4) * 128,
"PerViewUib should be exactly 2KiB");
// ------------------------------------------------------------------------------------------------
// MARK: -
+10
View File
@@ -51,11 +51,21 @@ highp mat4 getEyeFromViewMatrix() {
return frameUniforms.eyeFromViewMatrix[getEyeIndex()];
}
/** @public-api */
highp mat4 getEyeFromViewMatrix(int eyeIndex) {
return frameUniforms.eyeFromViewMatrix[eyeIndex];
}
/** @public-api */
highp mat4 getClipFromWorldMatrix() {
return frameUniforms.clipFromWorldMatrix[getEyeIndex()];
}
/** @public-api */
highp mat4 getClipFromWorldMatrix(int eyeIndex) {
return frameUniforms.clipFromWorldMatrix[eyeIndex];
}
/** @public-api */
highp mat4 getWorldFromClipMatrix() {
return frameUniforms.worldFromClipMatrix;