From e3df84ec3fd157d6bb28a206791a4d5f3436d91c Mon Sep 17 00:00:00 2001 From: Nimrod Gileadi Date: Tue, 12 Dec 2023 08:40:20 -0800 Subject: [PATCH] Include the size limit in error message from mjr_addAux. This is to help debug #1274. PiperOrigin-RevId: 590215990 Change-Id: I356675be84f9cb2892d31d4dc7639adf49fe4a0f --- src/render/render_context.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/render/render_context.c b/src/render/render_context.c index afb1377fdf..ec349b2a13 100644 --- a/src/render/render_context.c +++ b/src/render/render_context.c @@ -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