summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2024-01-08 12:17:54 +0200
committerEric Engestrom <eric@engestrom.ch>2024-01-09 19:37:45 +0000
commit354363cc89185c215b121218f03f9e24bc61fa9d (patch)
tree76a8d413eef7cdc3bb09465141b6289a5f7bdbfe
parent10bb376e09b1e2d328980446bfc5a227f9821fbd (diff)
downloadmesa-354363cc89185c215b121218f03f9e24bc61fa9d.tar.gz
mesa-354363cc89185c215b121218f03f9e24bc61fa9d.tar.bz2
mesa-354363cc89185c215b121218f03f9e24bc61fa9d.zip
intel/fs: fix depth compute state for unchanged depth layout
There is no VK CTS exercising this case. If there was we would run into hangs as noticed in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26876 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26923> (cherry picked from commit 4b30b46ffdbc962f09ef87529a71d78cf514f8d8)
-rw-r--r--.pick_status.json2
-rw-r--r--src/intel/compiler/brw_fs.cpp12
2 files changed, 12 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 334507ad35e..6d91a8b0d1f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -284,7 +284,7 @@
"description": "intel/fs: fix depth compute state for unchanged depth layout",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index aa01a2241ce..e6a603a9048 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -7599,7 +7599,17 @@ computed_depth_mode(const nir_shader *shader)
case FRAG_DEPTH_LAYOUT_LESS:
return BRW_PSCDEPTH_ON_LE;
case FRAG_DEPTH_LAYOUT_UNCHANGED:
- return BRW_PSCDEPTH_OFF;
+ /* We initially set this to OFF, but having the shader write the
+ * depth means we allocate register space in the SEND message. The
+ * difference between the SEND register count and the OFF state
+ * programming makes the HW hang.
+ *
+ * Removing the depth writes also leads to test failures. So use
+ * LesserThanOrEqual, which fits writing the same value
+ * (unchanged/equal).
+ *
+ */
+ return BRW_PSCDEPTH_ON_LE;
}
}
return BRW_PSCDEPTH_OFF;