summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2016-01-20 15:53:54 -0800
committerChad Versace <[email protected]>2016-01-22 17:19:57 -0800
commit14b753f666eed3933ba155fb493e6142c33cb96e (patch)
tree163ec24597bba4599e08ed1c83bcbba1f5b15150
parentd4de918ad086683c4df4b7d861c27bbce61d6c92 (diff)
isl: Add func isl_device_get_sample_counts()
-rw-r--r--src/isl/isl.c32
-rw-r--r--src/isl/isl.h15
2 files changed, 47 insertions, 0 deletions
diff --git a/src/isl/isl.c b/src/isl/isl.c
index 40663ca18af..acc80eae59c 100644
--- a/src/isl/isl.c
+++ b/src/isl/isl.c
@@ -68,6 +68,38 @@ isl_device_init(struct isl_device *dev,
}
/**
+ * @brief Query the set of multisamples supported by the device.
+ *
+ * This function always returns non-zero, as ISL_SAMPLE_COUNT_1_BIT is always
+ * supported.
+ */
+isl_sample_count_mask_t ATTRIBUTE_CONST
+isl_device_get_sample_counts(struct isl_device *dev)
+{
+ if (ISL_DEV_GEN(dev) >= 9) {
+ return ISL_SAMPLE_COUNT_1_BIT |
+ ISL_SAMPLE_COUNT_2_BIT |
+ ISL_SAMPLE_COUNT_4_BIT |
+ ISL_SAMPLE_COUNT_8_BIT |
+ ISL_SAMPLE_COUNT_16_BIT;
+ } else if (ISL_DEV_GEN(dev) >= 8) {
+ return ISL_SAMPLE_COUNT_1_BIT |
+ ISL_SAMPLE_COUNT_2_BIT |
+ ISL_SAMPLE_COUNT_4_BIT |
+ ISL_SAMPLE_COUNT_8_BIT;
+ } else if (ISL_DEV_GEN(dev) >= 7) {
+ return ISL_SAMPLE_COUNT_1_BIT |
+ ISL_SAMPLE_COUNT_4_BIT |
+ ISL_SAMPLE_COUNT_8_BIT;
+ } else if (ISL_DEV_GEN(dev) >= 6) {
+ return ISL_SAMPLE_COUNT_1_BIT |
+ ISL_SAMPLE_COUNT_4_BIT;
+ } else {
+ return ISL_SAMPLE_COUNT_1_BIT;
+ }
+}
+
+/**
* @param[out] info is written only on success
*/
bool
diff --git a/src/isl/isl.h b/src/isl/isl.h
index 9b99e00ec1c..85e43b8b35b 100644
--- a/src/isl/isl.h
+++ b/src/isl/isl.h
@@ -458,6 +458,18 @@ typedef uint64_t isl_surf_usage_flags_t;
/** @} */
/**
+ * Identical to VkSampleCountFlagBits.
+ */
+enum isl_sample_count {
+ ISL_SAMPLE_COUNT_1_BIT = 1u,
+ ISL_SAMPLE_COUNT_2_BIT = 2u,
+ ISL_SAMPLE_COUNT_4_BIT = 4u,
+ ISL_SAMPLE_COUNT_8_BIT = 8u,
+ ISL_SAMPLE_COUNT_16_BIT = 16u,
+};
+typedef uint32_t isl_sample_count_mask_t;
+
+/**
* @brief Multisample Format
*/
enum isl_msaa_layout {
@@ -690,6 +702,9 @@ isl_device_init(struct isl_device *dev,
const struct brw_device_info *info,
bool has_bit6_swizzling);
+isl_sample_count_mask_t ATTRIBUTE_CONST
+isl_device_get_sample_counts(struct isl_device *dev);
+
static inline const struct isl_format_layout * ATTRIBUTE_CONST
isl_format_get_layout(enum isl_format fmt)
{