summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_meta_fast_clear.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
index 1b2ea425002..f1920b2edce 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
@@ -41,6 +41,8 @@
#include "main/api_validate.h"
#include "main/state.h"
+#include "util/format_srgb.h"
+
#include "vbo/vbo_context.h"
#include "drivers/common/meta.h"
@@ -424,6 +426,15 @@ set_fast_clear_color(struct brw_context *brw,
override_color.f[3] = 1.0f;
}
+ /* Handle linear→SRGB conversion */
+ if (brw->ctx.Color.sRGBEnabled &&
+ _mesa_get_srgb_format_linear(mt->format) != mt->format) {
+ for (int i = 0; i < 3; i++) {
+ override_color.f[i] =
+ util_format_linear_to_srgb_float(override_color.f[i]);
+ }
+ }
+
if (brw->gen >= 9) {
mt->gen9_fast_clear_color = override_color;
} else {