Mesa (main): i915g: Handle fragment depth being in OUT[1] not OUT[0].

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 18 05:01:20 UTC 2021


Module: Mesa
Branch: main
Commit: 934d2c8f7f51d6e148e2b034e88a5eb6e1b9c98a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=934d2c8f7f51d6e148e2b034e88a5eb6e1b9c98a

Author: Emma Anholt <emma at anholt.net>
Date:   Sun Jun 13 09:39:23 2021 -0700

i915g: Handle fragment depth being in OUT[1] not OUT[0].

Prevents regressions when switching to nir-to-tgsi which orders the
outputs differently.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11329>

---

 src/gallium/drivers/i915/i915_fpc_translate.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c
index cbcaeeaf230..46ddff544fb 100644
--- a/src/gallium/drivers/i915/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915/i915_fpc_translate.c
@@ -1186,8 +1186,10 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
 static void
 i915_fixup_depth_write(struct i915_fp_compile *p)
 {
-   /* XXX assuming pos/depth is always in output[0] */
-   if (p->shader->info.num_outputs != 0 && p->shader->info.output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
+   for (int i = 0; i < p->shader->info.num_outputs; i++) {
+      if (p->shader->info.output_semantic_name[i] != TGSI_SEMANTIC_POSITION)
+         continue;
+
       const uint depth = UREG(REG_TYPE_OD, 0);
 
       i915_emit_arith(p,



More information about the mesa-commit mailing list