[virglrenderer-devel] [PATCH] vrend: Enable sRGB if any attachment is sRGB
Stéphane Marchesin
marcheu at chromium.org
Thu Feb 15 23:30:32 UTC 2018
... previously we were only looking at the last attachment.
Fixes dEQP-GLES3.functional.fragment_out.random.86 and probably others
Signed-off-by: Stéphane Marchesin <marcheu at chromium.org>
---
src/vrend_renderer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index a620ea3..935721e 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -1505,13 +1505,17 @@ static void vrend_hw_emit_framebuffer_state(struct vrend_context *ctx)
}
} else {
struct vrend_surface *surf = NULL;
+ bool use_srgb = false;
int i;
for (i = 0; i < ctx->sub->nr_cbufs; i++) {
if (ctx->sub->surf[i]) {
surf = ctx->sub->surf[i];
+ if (util_format_is_srgb(surf->format)) {
+ use_srgb = true;
+ }
}
}
- if (util_format_is_srgb(surf->format)) {
+ if (use_srgb) {
if (!vrend_state.use_gles) {
glEnable(GL_FRAMEBUFFER_SRGB_EXT);
} else {
--
2.16.1.291.g4437f3f132-goog
More information about the virglrenderer-devel
mailing list