Mesa (master): nir,spirv: Add support for the ShaderCallKHR scope

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 6 00:40:27 UTC 2020


Module: Mesa
Branch: master
Commit: 21b1b915498447a66d555338830183eb6eb97d8d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21b1b915498447a66d555338830183eb6eb97d8d

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Aug  5 14:50:36 2020 -0500

nir,spirv: Add support for the ShaderCallKHR scope

It's currently entirely trivial.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6479>

---

 src/amd/compiler/aco_instruction_selection.cpp | 2 ++
 src/compiler/nir/nir.h                         | 1 +
 src/compiler/nir/nir_print.c                   | 1 +
 src/compiler/spirv/spirv_to_nir.c              | 4 ++++
 4 files changed, 8 insertions(+)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index d1b7da5b5d0..d680ab83699 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -6620,6 +6620,8 @@ sync_scope translate_nir_scope(nir_scope scope)
       return scope_queuefamily;
    case NIR_SCOPE_DEVICE:
       return scope_device;
+   case NIR_SCOPE_SHADER_CALL:
+      unreachable("unsupported scope");
    }
    unreachable("invalid scope");
 }
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index f177de75e96..e43062fbacc 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1708,6 +1708,7 @@ typedef enum {
    NIR_SCOPE_NONE,
    NIR_SCOPE_INVOCATION,
    NIR_SCOPE_SUBGROUP,
+   NIR_SCOPE_SHADER_CALL,
    NIR_SCOPE_WORKGROUP,
    NIR_SCOPE_QUEUE_FAMILY,
    NIR_SCOPE_DEVICE,
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 8c62b1235d8..9286636aed3 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -975,6 +975,7 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
          case NIR_SCOPE_DEVICE:       fprintf(fp, "DEVICE");       break;
          case NIR_SCOPE_QUEUE_FAMILY: fprintf(fp, "QUEUE_FAMILY"); break;
          case NIR_SCOPE_WORKGROUP:    fprintf(fp, "WORKGROUP");    break;
+         case NIR_SCOPE_SHADER_CALL:  fprintf(fp, "SHADER_CALL");  break;
          case NIR_SCOPE_SUBGROUP:     fprintf(fp, "SUBGROUP");     break;
          case NIR_SCOPE_INVOCATION:   fprintf(fp, "INVOCATION");   break;
          }
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 88390bd3d0d..e0eda4ccb3d 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -2363,6 +2363,10 @@ vtn_scope_to_nir_scope(struct vtn_builder *b, SpvScope scope)
       nir_scope = NIR_SCOPE_INVOCATION;
       break;
 
+   case SpvScopeShaderCallKHR:
+      nir_scope = NIR_SCOPE_SHADER_CALL;
+      break;
+
    default:
       vtn_fail("Invalid memory scope");
    }



More information about the mesa-commit mailing list