intel/common/icl: Add has_sample_with_hiz flag in gen_device_info
authorAnuj Phogat <anuj.phogat@gmail.com>
Wed, 14 Feb 2018 22:30:27 +0000 (14:30 -0800)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 16 Feb 2018 00:14:56 +0000 (16:14 -0800)
Sampling from hiz is enabled in i965 for GEN9+ but this feature has
been removed from gen11. So, this new flag will be useful to turn
the feature on/off for different gen h/w. It will be used later
in a patch adding device info for gen11.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/common/gen_device_info.c
src/intel/common/gen_device_info.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index c0eb7c3c3562a597d89042b19c47a5006d7df7ad..a08a13a32a420b4366eb2ed76294364a5b1c76d2 100644 (file)
@@ -311,12 +311,16 @@ static const struct gen_device_info gen_device_info_hsw_gt3 = {
    },
 };
 
+/* It's unclear how well supported sampling from the hiz buffer is on GEN8,
+ * so keep things conservative for now and set has_sample_with_hiz = false.
+ */
 #define GEN8_FEATURES                               \
    .gen = 8,                                        \
    .has_hiz_and_separate_stencil = true,            \
    .has_resource_streamer = true,                   \
    .must_use_separate_stencil = true,               \
    .has_llc = true,                                 \
+   .has_sample_with_hiz = false,                    \
    .has_pln = true,                                 \
    .supports_simd16_3src = true,                    \
    .has_surface_tile_offset = true,                 \
@@ -451,6 +455,7 @@ static const struct gen_device_info gen_device_info_chv = {
    GEN9_HW_INFO,                                   \
    .gt = 1,                                        \
    .has_llc = false,                               \
+   .has_sample_with_hiz = true,                    \
    .num_slices = 1,                                \
    .num_thread_per_eu = 6,                         \
    .max_vs_threads = 112,                          \
@@ -502,6 +507,7 @@ static const struct gen_device_info gen_device_info_chv = {
 #define GEN9_FEATURES                               \
    GEN8_FEATURES,                                   \
    GEN9_HW_INFO,                                    \
+   .has_sample_with_hiz = true,                     \
    .num_thread_per_eu = 7
 
 static const struct gen_device_info gen_device_info_skl_gt1 = {
@@ -695,6 +701,7 @@ static const struct gen_device_info gen_device_info_cfl_gt3 = {
 #define GEN10_FEATURES(_gt, _slices, _subslices, _l3) \
    GEN8_FEATURES,                                   \
    GEN10_HW_INFO,                                   \
+   .has_sample_with_hiz = true,                     \
    .gt = _gt,                                       \
    .num_slices = _slices,                           \
    .num_subslices = _subslices,                     \
index 30ddd905be1f3895c15aff5b0276eac5aa101a9c..fd9c17531dbf41d15b5f89bdc271667959a4a07e 100644 (file)
@@ -55,7 +55,7 @@ struct gen_device_info
 
    bool has_hiz_and_separate_stencil;
    bool must_use_separate_stencil;
-
+   bool has_sample_with_hiz;
    bool has_llc;
 
    bool has_pln;
index da5e3b0989d2d15ddf3fec1ae938814185c5651a..6d35c9d3928ead2ad5cc82bb00c2d79db63e7a50 100644 (file)
@@ -1911,10 +1911,7 @@ intel_miptree_sample_with_hiz(struct brw_context *brw,
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
 
-   /* It's unclear how well supported sampling from the hiz buffer is on GEN8,
-    * so keep things conservative for now and never enable it unless we're SKL+.
-    */
-   if (devinfo->gen < 9) {
+   if (!devinfo->has_sample_with_hiz) {
       return false;
    }