summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/dri_drawable.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-06-10 01:49:36 +0200
committerMarek Olšák <[email protected]>2015-07-22 23:56:00 +0200
commit956ebf41aca6b74052cf6876cc479b404777700c (patch)
tree95a454c3e88b7021576d30e9879dc3863908cfd0 /src/gallium/state_trackers/dri/dri_drawable.c
parentb06a6852ff782bb20d9e91a3a67eccb92e856ed3 (diff)
st/dri: expose sRGB visuals (v2)
v2: The fix for the darkness in Ubuntu Unity is in the hunk with the 4-line comment. Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/dri_drawable.c')
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index b8afe6c4d23..0d2929aaaa1 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -279,7 +279,12 @@ dri_drawable_get_format(struct dri_drawable *drawable,
case ST_ATTACHMENT_BACK_LEFT:
case ST_ATTACHMENT_FRONT_RIGHT:
case ST_ATTACHMENT_BACK_RIGHT:
- *format = drawable->stvis.color_format;
+ /* Other pieces of the driver stack get confused and behave incorrectly
+ * when they get an sRGB drawable. st/mesa receives "drawable->stvis"
+ * though other means and handles it correctly, so we don't really need
+ * to use an sRGB format here.
+ */
+ *format = util_format_linear(drawable->stvis.color_format);
*bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
break;
case ST_ATTACHMENT_DEPTH_STENCIL: