From df803d825fe273247d8f6723d94334591b00b471 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 8 Mar 2024 10:02:51 -0500 Subject: [PATCH] mesa/fbobject: tweak attachment validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit now that st is available in this part of mesa, the texture's binds can be checked directly in order to provide more detailed info about why an attachment was marked invalid Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/fbobject.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6c78dd69039..55f68748a38 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1195,7 +1195,15 @@ do_validate_attachment(struct gl_context *ctx, stObj->pt->nr_storage_samples, bindings); if (!valid) { - fbo_invalid("Invalid format"); + /* this is the actual texture, so check the bind flags for more info */ + if (stObj->pt->bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL)) { + if (_mesa_is_format_srgb(texFormat)) + fbo_invalid("Invalid format: linear format supported for rendering but not sRGB"); + else + fbo_invalid("Invalid format"); + } else { + fbo_invalid("Format unsupported for rendering: RENDER_TARGET bind not applied"); + } } return valid;