anv/pipeline: Add support for early depth stencil
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Jun 2016 03:16:01 +0000 (20:16 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 4 Jun 2016 02:29:28 +0000 (19:29 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/gen7_pipeline.c
src/intel/vulkan/gen8_pipeline.c

index a53bdc4314b2e9f889a1e892be20be4f8da9b79a..f069db99477773fe382a73150be659f2e39a9249 100644 (file)
@@ -365,12 +365,20 @@ genX(graphics_pipeline_create)(
          wm.ThreadDispatchEnable                = true;
          wm.LineEndCapAntialiasingRegionWidth   = 0; /* 0.5 pixels */
          wm.LineAntialiasingRegionWidth         = 1; /* 1.0 pixels */
-         wm.EarlyDepthStencilControl            = EDSC_NORMAL;
          wm.PointRasterizationRule              = RASTRULE_UPPER_RIGHT;
          wm.PixelShaderComputedDepthMode        = wm_prog_data->computed_depth_mode;
          wm.PixelShaderUsesSourceDepth          = wm_prog_data->uses_src_depth;
          wm.PixelShaderUsesSourceW              = wm_prog_data->uses_src_w;
          wm.PixelShaderUsesInputCoverageMask    = wm_prog_data->uses_sample_mask;
+
+         if (wm_prog_data->early_fragment_tests) {
+            wm.EarlyDepthStencilControl         = EDSC_PREPS;
+         } else if (wm_prog_data->has_side_effects) {
+            wm.EarlyDepthStencilControl         = EDSC_PSEXEC;
+         } else {
+            wm.EarlyDepthStencilControl         = EDSC_NORMAL;
+         }
+
          wm.BarycentricInterpolationMode        = wm_prog_data->barycentric_interp_modes;
       }
    }
index 77c81f421066b554dfd422e6a42d96ee0a2d17d9..1300c0d1dff5f78938ee4f61466865e4a91ef70e 100644 (file)
@@ -329,10 +329,17 @@ genX(graphics_pipeline_create)(
       wm.StatisticsEnable                    = true;
       wm.LineEndCapAntialiasingRegionWidth   = _05pixels;
       wm.LineAntialiasingRegionWidth         = _10pixels;
-      wm.EarlyDepthStencilControl            = NORMAL;
       wm.ForceThreadDispatchEnable           = NORMAL;
       wm.PointRasterizationRule              = RASTRULE_UPPER_RIGHT;
 
+      if (wm_prog_data && wm_prog_data->early_fragment_tests) {
+         wm.EarlyDepthStencilControl         = PREPS;
+      } else if (wm_prog_data && wm_prog_data->has_side_effects) {
+         wm.EarlyDepthStencilControl         = PSEXEC;
+      } else {
+         wm.EarlyDepthStencilControl         = NORMAL;
+      }
+
       wm.BarycentricInterpolationMode = pipeline->ps_ksp0 == NO_KERNEL ?
          0 : wm_prog_data->barycentric_interp_modes;
    }