aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-12-25 23:43:01 -0800
committerKenneth Graunke <[email protected]>2020-01-04 12:25:55 -0800
commitc0c899cf7892bd2326e6d21a920c7be42de06731 (patch)
tree828645f61d7aeec69cb64c3c877138123ec0b7b6 /src/gallium/drivers/iris
parent7d75bf4f3fc6a048fed05de301590c3a2b73c268 (diff)
iris: Allow HiZ for copy_region sources
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r--src/gallium/drivers/iris/iris_blit.c9
-rw-r--r--src/gallium/drivers/iris/iris_resolve.c10
-rw-r--r--src/gallium/drivers/iris/iris_resource.h4
3 files changed, 18 insertions, 5 deletions
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index e803950a560..f58bf343892 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -573,6 +573,15 @@ get_copy_region_aux_settings(const struct gen_device_info *devinfo,
bool is_render_target)
{
switch (res->aux.usage) {
+ case ISL_AUX_USAGE_HIZ:
+ if (!is_render_target && iris_sample_with_depth_aux(devinfo, res)) {
+ *out_aux_usage = ISL_AUX_USAGE_HIZ;
+ *out_clear_supported = true;
+ } else {
+ *out_aux_usage = ISL_AUX_USAGE_NONE;
+ *out_clear_supported = false;
+ }
+ break;
case ISL_AUX_USAGE_MCS:
case ISL_AUX_USAGE_MCS_CCS:
case ISL_AUX_USAGE_CCS_E:
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index ddd86ea2385..eb9c0f0cfd9 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -559,9 +559,9 @@ format_ccs_e_compat_with_resource(const struct gen_device_info *devinfo,
return isl_formats_are_ccs_e_compatible(devinfo, isl_format, access_format);
}
-static bool
-sample_with_depth_aux(const struct gen_device_info *devinfo,
- const struct iris_resource *res)
+bool
+iris_sample_with_depth_aux(const struct gen_device_info *devinfo,
+ const struct iris_resource *res)
{
switch (res->aux.usage) {
case ISL_AUX_USAGE_HIZ:
@@ -1339,12 +1339,12 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
switch (res->aux.usage) {
case ISL_AUX_USAGE_HIZ:
- if (sample_with_depth_aux(devinfo, res))
+ if (iris_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))
+ if (iris_sample_with_depth_aux(devinfo, res))
return ISL_AUX_USAGE_CCS_E;
break;
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index ab09279d02b..52f8396bd77 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -475,6 +475,10 @@ void iris_resource_check_level_layer(const struct iris_resource *res,
bool iris_resource_level_has_hiz(const struct iris_resource *res,
uint32_t level);
+
+bool iris_sample_with_depth_aux(const struct gen_device_info *devinfo,
+ const struct iris_resource *res);
+
bool iris_has_color_unresolved(const struct iris_resource *res,
unsigned start_level, unsigned num_levels,
unsigned start_layer, unsigned num_layers);