summaryrefslogtreecommitdiff
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2017-07-17 17:42:46 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2017-07-22 20:59:22 -0700
commitb26b2490e523443b4c967980bcc963ef9783333d (patch)
tree4421f74646a7301a47459b27116677f79623495d /src/intel
parent6c2842f95be7823346032668abf8afce4d602bbd (diff)
intel/blorp: Allow blorp_copy on sRGB formats
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/blorp/blorp_blit.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 973e3ef4309..91d2a227949 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -2459,16 +2459,30 @@ blorp_copy(struct blorp_batch *batch,
}
if (params.src.aux_usage == ISL_AUX_USAGE_CCS_E) {
+ /* It's safe to do a blorp_copy between things which are sRGB with CCS_E
+ * enabled even though CCS_E doesn't technically do sRGB on SKL because
+ * we stomp everything to UINT anyway. The one thing we have to be
+ * careful of is clear colors. Because fast clear colors for sRGB on
+ * gen9 are encoded as the float values between format conversion and
+ * sRGB curve application, a given clear color float will convert to the
+ * same bits regardless of whether the format is UNORM or sRGB.
+ * Therefore, we can handle sRGB without any special cases.
+ */
+ UNUSED enum isl_format linear_src_format =
+ isl_format_srgb_to_linear(src_surf->surf->format);
assert(isl_formats_are_ccs_e_compatible(batch->blorp->isl_dev->info,
- src_surf->surf->format,
+ linear_src_format,
params.src.view.format));
params.src.clear_color =
bitcast_color_value_to_uint(params.src.clear_color, src_fmtl);
}
if (params.dst.aux_usage == ISL_AUX_USAGE_CCS_E) {
+ /* See above where we handle linear_src_format */
+ UNUSED enum isl_format linear_dst_format =
+ isl_format_srgb_to_linear(dst_surf->surf->format);
assert(isl_formats_are_ccs_e_compatible(batch->blorp->isl_dev->info,
- dst_surf->surf->format,
+ linear_dst_format,
params.dst.view.format));
params.dst.clear_color =
bitcast_color_value_to_uint(params.dst.clear_color, dst_fmtl);