Skip to content

Commit

Permalink
Merge pull request #837 from jmiskovic/fix/graphics-parameter-checks
Browse files Browse the repository at this point in the history
Fix two graphics parameter checks
  • Loading branch information
bjornbytes authored Feb 2, 2025
2 parents bf86815 + 0e1e40f commit fab07a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/graphics/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -7593,6 +7593,7 @@ bool lovrPassCone(Pass* pass, float* transform, uint32_t segments) {
}

bool lovrPassCapsule(Pass* pass, float* transform, uint32_t segments) {
lovrCheck(segments >= 2, "Capsule segment count must be >= 2");
float sx = vec3_length(transform + 0);
float sy = vec3_length(transform + 4);
float sz = vec3_length(transform + 8);
Expand Down Expand Up @@ -8051,7 +8052,7 @@ bool lovrPassMeshIndirect(Pass* pass, Buffer* vertices, Buffer* indices, Buffer*

lovrCheck(shader, "A custom Shader must be bound to source draws from a Buffer");
lovrCheck(offset % 4 == 0, "Draw Buffer offset must be a multiple of 4");
lovrCheck(offset + count * stride < draws->info.size, "Draw buffer range exceeds the size of the buffer");
lovrCheck(offset + count * stride <= draws->info.size, "Draw buffer range exceeds the size of the buffer");
lovrCheck(!vertices || vertices->supportsMesh, "Vertex buffer has invalid format (can not contain nested structs/arrays, or matrix/index types)");

DrawInfo info = {
Expand Down

0 comments on commit fab07a8

Please sign in to comment.