llvmpipe: handle early test property.
authorDave Airlie <airlied@redhat.com>
Fri, 19 Jul 2019 05:45:22 +0000 (15:45 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 27 Aug 2019 02:29:33 +0000 (12:29 +1000)
Also handle setting late for shaders that use stores

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 101877ded3471446fc0d7b4a77b8caadae7e7b6c..bf2c03135728093da16a2c56094048bc1bda3ae1 100644 (file)
@@ -346,8 +346,12 @@ generate_fs_loop(struct gallivm_state *gallivm,
       zs_format_desc = util_format_description(key->zsbuf_format);
       assert(zs_format_desc);
 
-      if (!shader->info.base.writes_z && !shader->info.base.writes_stencil) {
-         if (key->alpha.enabled ||
+      if (shader->info.base.properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL])
+         depth_mode = EARLY_DEPTH_TEST | EARLY_DEPTH_WRITE;
+      else if (!shader->info.base.writes_z && !shader->info.base.writes_stencil) {
+         if (shader->info.base.writes_memory)
+            depth_mode = LATE_DEPTH_TEST | LATE_DEPTH_WRITE;
+         else if (key->alpha.enabled ||
              key->blend.alpha_to_coverage ||
              shader->info.base.uses_kill ||
              shader->info.base.writes_samplemask) {