summaryrefslogtreecommitdiffstats
path: root/src/intel/isl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-02-01 11:41:51 -0800
committerJason Ekstrand <[email protected]>2017-02-02 13:33:43 -0800
commit6142e3c07c051371de27a1b41f6986e03ad30c0d (patch)
tree129bf3a7e7389a692320736bdabcf49a7fa65521 /src/intel/isl
parentab06fc668453359a9b58b29a1160cb66bde0a920 (diff)
intel/isl: Add a format_supports_ccs_d helper
Nothing uses this yet but it serves as a nice bit of documentation that's relatively easy to find. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/intel/isl')
-rw-r--r--src/intel/isl/isl.h2
-rw-r--r--src/intel/isl/isl_format.c22
2 files changed, 24 insertions, 0 deletions
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index bdc5ebf5c12..47e4a1eb4ee 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -1040,6 +1040,8 @@ bool isl_format_supports_filtering(const struct gen_device_info *devinfo,
enum isl_format format);
bool isl_format_supports_vertex_fetch(const struct gen_device_info *devinfo,
enum isl_format format);
+bool isl_format_supports_ccs_d(const struct gen_device_info *devinfo,
+ enum isl_format format);
bool isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format);
bool isl_format_supports_multisampling(const struct gen_device_info *devinfo,
diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c
index ebc8ec9e708..ed5a0636eb4 100644
--- a/src/intel/isl/isl_format.c
+++ b/src/intel/isl/isl_format.c
@@ -437,6 +437,28 @@ isl_format_supports_vertex_fetch(const struct gen_device_info *devinfo,
return format_gen(devinfo) >= format_info[format].input_vb;
}
+/**
+ * Returns true if the given format can support single-sample fast clears.
+ * This function only checks the format. In order to determine if a surface
+ * supports CCS_E, several other factors need to be considered such as tiling
+ * and sample count. See isl_surf_get_ccs_surf for details.
+ */
+bool
+isl_format_supports_ccs_d(const struct gen_device_info *devinfo,
+ enum isl_format format)
+{
+ /* Fast clears were first added on Ivy Bridge */
+ if (devinfo->gen < 7)
+ return false;
+
+ if (!isl_format_supports_rendering(devinfo, format))
+ return false;
+
+ const struct isl_format_layout *fmtl = isl_format_get_layout(format);
+
+ return fmtl->bpb == 32 || fmtl->bpb == 64 || fmtl->bpb == 128;
+}
+
bool
isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format)