aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_resolve.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2019-08-21 15:23:24 -0700
committerNanley Chery <[email protected]>2019-10-28 10:47:06 -0700
commit7a619b5c759e9d1a9795d4d79c7746ec47a00431 (patch)
treedede6520987c694084d78788dba5414ca3c1f0f9 /src/gallium/drivers/iris/iris_resolve.c
parent8e7644e48f8122409faf558ad3252a515576d2f0 (diff)
iris: Enable HIZ_CCS sampling
Reviewed-by: Sagar Ghuge <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_resolve.c')
-rw-r--r--src/gallium/drivers/iris/iris_resolve.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index 973aeb1152d..f4b5002bd5b 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -558,14 +558,22 @@ format_ccs_e_compat_with_resource(const struct gen_device_info *devinfo,
}
static bool
-sample_with_hiz(const struct gen_device_info *devinfo,
- const struct iris_resource *res)
+sample_with_depth_aux(const struct gen_device_info *devinfo,
+ const struct iris_resource *res)
{
- if (!devinfo->has_sample_with_hiz)
+ switch (res->aux.usage) {
+ case ISL_AUX_USAGE_HIZ:
+ if (devinfo->has_sample_with_hiz)
+ break;
return false;
-
- if (res->aux.usage != ISL_AUX_USAGE_HIZ)
+ case ISL_AUX_USAGE_HIZ_CCS:
+ /* Write through mode must have been enabled for prior writes. */
+ if (isl_surf_supports_hiz_ccs_wt(devinfo, &res->surf, res->aux.usage))
+ break;
return false;
+ default:
+ return false;
+ }
/* It seems the hardware won't fallback to the depth buffer if some of the
* mipmap levels aren't available in the HiZ buffer. So we need all levels
@@ -1342,10 +1350,15 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
switch (res->aux.usage) {
case ISL_AUX_USAGE_HIZ:
- if (sample_with_hiz(devinfo, res))
+ if (sample_with_depth_aux(devinfo, res))
return ISL_AUX_USAGE_HIZ;
break;
+ case ISL_AUX_USAGE_HIZ_CCS:
+ if (sample_with_depth_aux(devinfo, res))
+ return ISL_AUX_USAGE_CCS_E;
+ break;
+
case ISL_AUX_USAGE_MCS:
return ISL_AUX_USAGE_MCS;