Mesa (main): microsoft/compiler: More robustly handle setting Register=-1

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 25 20:29:25 UTC 2021


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

Author: Michael Tang <tangm at microsoft.com>
Date:   Mon Aug 23 18:48:50 2021 -0700

microsoft/compiler: More robustly handle setting Register=-1

This is the 'N/A mask' case in the DXIL disassembly.

This logic is taken from: https://github.com/microsoft/DirectXShaderCompiler/blob/7c9e487afd17b7726229d8ceb3242a412134afe7/tools/clang/tools/dxcompiler/dxcdisassembler.cpp#L106

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12513>

---

 src/microsoft/compiler/dxil_signature.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/microsoft/compiler/dxil_signature.c b/src/microsoft/compiler/dxil_signature.c
index 2b2928fff65..895ec30a848 100644
--- a/src/microsoft/compiler/dxil_signature.c
+++ b/src/microsoft/compiler/dxil_signature.c
@@ -50,8 +50,8 @@ struct semantic_info {
 static bool
 is_depth_output(enum dxil_semantic_kind kind)
 {
-   return kind == DXIL_SEM_DEPTH ||
-         kind == DXIL_SEM_STENCIL_REF;
+   return kind == DXIL_SEM_DEPTH || kind == DXIL_SEM_DEPTH_GE ||
+          kind == DXIL_SEM_DEPTH_LE || kind == DXIL_SEM_STENCIL_REF;
 }
 
 static uint8_t
@@ -111,7 +111,11 @@ get_additional_semantic_info(nir_shader *s, nir_variable *var, struct semantic_i
    info->rows = 1;
    if (info->kind == DXIL_SEM_TARGET) {
       info->start_row = info->index;
-   } else if (is_depth || (info->kind == DXIL_SEM_PRIMITIVE_ID && is_gs_shader)) {
+   } else if (is_depth ||
+              (info->kind == DXIL_SEM_PRIMITIVE_ID && is_gs_shader) ||
+              info->kind == DXIL_SEM_COVERAGE ||
+              info->kind == DXIL_SEM_SAMPLE_INDEX) {
+      // This turns into a 'N/A' mask in the disassembly
       info->start_row = -1;
    } else if (var->data.compact) {
       if (var->data.location_frac) {



More information about the mesa-commit mailing list