mesa: relax EXT_texture_integer validation

This updates mesa to avoid throwing an error if an attached fbo
wont actually be drawn into.

Fixes: 705978e283 ("mesa: do integer FB / shader validation check in _mesa_valid_to_render()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13144
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34949>
(cherry picked from commit 1d4ebe79b5)
This commit is contained in:
Timothy Arceri 2025-05-13 21:58:09 +10:00 committed by Eric Engestrom
parent 349353dde6
commit ab1edf76ed
2 changed files with 11 additions and 3 deletions

View file

@ -134,7 +134,7 @@
"description": "mesa: relax EXT_texture_integer validation",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "705978e2831eb8b8bb23bd11ee08ce51d9b2915c",
"notes": null

View file

@ -155,8 +155,16 @@ _mesa_update_valid_to_render_state(struct gl_context *ctx)
/* If drawing to integer-valued color buffers, there must be an
* active fragment shader (GL_EXT_texture_integer).
*/
if (ctx->DrawBuffer->_IntegerBuffers)
return;
if (ctx->DrawBuffer->_IntegerBuffers) {
for (int i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
gl_buffer_index buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[i];
if (buf < BUFFER_COLOR0)
continue;
if (ctx->DrawBuffer->_IntegerBuffers & (1 << (buf - BUFFER_COLOR0)))
return;
}
}
}
}