From 6788194c3944797c12f4e4f561769ab0d259d1ef Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 28 Jun 2023 15:41:28 -0400 Subject: [PATCH] asahi: Make clear the non-sRGBness of EOT images For sRGB render targets, we encode sRGB when writing pixels into the tilebuffer (in the fragment shader), not when writing out the image. When we actually write out the tilebuffer to the image, we don't use the PBE's sRGB conversion, we just bind it as a UNORM 8 image and blit the pre-transformed pixels. We're about to add real sRGB support for the PBE, so make this linearization explicit. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 84e4315c199..dc494420342 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -2178,6 +2178,9 @@ agx_build_meta(struct agx_batch *batch, bool store, bool partial_render) struct agx_ptr pbe = agx_pool_alloc_aligned(&batch->pool, AGX_PBE_LENGTH, 256); + /* The tilebuffer is already in sRGB space if needed. Do not convert */ + view.format = util_format_linear(view.format); + agx_batch_upload_pbe(pbe.cpu, &view); agx_usc_pack(&b, TEXTURE, cfg) {