Skip to content

Commit

Permalink
Include the size limit in error message from mjr_addAux.
Browse files Browse the repository at this point in the history
This is to help debug #1274.

PiperOrigin-RevId: 590215990
Change-Id: I356675be84f9cb2892d31d4dc7639adf49fe4a0f
  • Loading branch information
nimrod-gileadi authored and copybara-github committed Dec 12, 2023
1 parent 35f095d commit e3df84e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/render/render_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,8 +1675,17 @@ void mjr_addAux(int index, int width, int height, int samples, mjrContext* con)
// check max size
int maxSize = 0;
glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &maxSize);
if (width > maxSize || height > maxSize) {
mju_error("Auxiliary buffer size exceeds maximum allowed by OpenGL implementation");
if (width > maxSize) {
mju_error(
"Auxiliary buffer width exceeds maximum allowed by OpenGL "
"implementation: %d > %d",
width, maxSize);
}
if (height > maxSize) {
mju_error(
"Auxiliary buffer height exceeds maximum allowed by OpenGL "
"implementation: %d > %d",
height, maxSize);
}

// clamp samples request
Expand Down

0 comments on commit e3df84e

Please sign in to comment.