Skip to content

Commit

Permalink
bugfix: incorrect alignment for "LightColor" in global UBOs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Aug 9, 2023
1 parent f0ab144 commit 978034e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static int numBytes() {
result += 3 * Float.BYTES;

// vec3 LightColor
result = Utils.align(result, 16);
result += 3 * Float.BYTES;

// mat4 viewMatrix
Expand Down Expand Up @@ -144,6 +145,7 @@ void writeTo(ByteBuffer target) {
byteOffset += 3 * Float.BYTES;

// vec3 LightColor
byteOffset = Utils.align(byteOffset, 16);
lightColor.get(byteOffset, target);
byteOffset += 3 * Float.BYTES;

Expand Down

0 comments on commit 978034e

Please sign in to comment.