aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-03-07 10:53:03 -0700
committerBrian Paul <[email protected]>2014-03-07 15:43:36 -0700
commit9b322d540ae3f6b569465a22bef8b93c49b365d4 (patch)
treef2519036b34645146048789a2283daf4f6342a88
parent6974eb907600b9d0176d3158ff0fd30ac3e56a55 (diff)
st/mesa: only mark framebuffer as sRGB capable if Mesa supports the format
Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_manager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 68cb5dee693..314d34232ca 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -421,8 +421,8 @@ st_framebuffer_create(struct st_context *st,
/*
* For desktop GL, sRGB framebuffer write is controlled by both the
* capability of the framebuffer and GL_FRAMEBUFFER_SRGB. We should
- * advertise the capability when the pipe driver supports it so that
- * applications can enable sRGB write when they want to.
+ * advertise the capability when the pipe driver (and core Mesa) supports
+ * it so that applications can enable sRGB write when they want to.
*
* This is not to be confused with GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB. When
* the attribute is GLX_TRUE, it tells the st manager to pick a color
@@ -442,6 +442,7 @@ st_framebuffer_create(struct st_context *st,
util_format_srgb(stfbi->visual->color_format);
if (srgb_format != PIPE_FORMAT_NONE &&
+ st_pipe_format_to_mesa_format(srgb_format) != MESA_FORMAT_NONE &&
screen->is_format_supported(screen, srgb_format,
PIPE_TEXTURE_2D, stfbi->visual->samples,
PIPE_BIND_RENDER_TARGET))