Mesa (staging/19.0): spirv: Handle SpvOpDecorateId

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 24 23:48:50 UTC 2019


Module: Mesa
Branch: staging/19.0
Commit: d4bbf9f838f46c0f9ff05e5bc8d680e2887bdc3f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4bbf9f838f46c0f9ff05e5bc8d680e2887bdc3f

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Mon Apr 22 16:09:56 2019 -0700

spirv: Handle SpvOpDecorateId

This operation decorate with an Id instead of a Literal or String.

It is used by HlslCounterBufferGOOGLE (provided by
SPV_GOOGLE_hlsl_functionality1).  Even if we don't do anything with
that decoration, we must be able to parse SPIR-V that uses it.

Fixes: 891886da2f9 "spirv: Add no-op support for VK_GOOGLE_hlsl_functionality1"
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
(cherry picked from commit 7e2684ce014c3f7813c4f0b2d8424fd588606d5f)

---

 src/compiler/spirv/spirv_to_nir.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index f91b5e1019c..6b9c831bfad 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -494,6 +494,7 @@ vtn_handle_decoration(struct vtn_builder *b, SpvOp opcode,
       break;
 
    case SpvOpDecorate:
+   case SpvOpDecorateId:
    case SpvOpMemberDecorate:
    case SpvOpDecorateStringGOOGLE:
    case SpvOpMemberDecorateStringGOOGLE:
@@ -503,6 +504,7 @@ vtn_handle_decoration(struct vtn_builder *b, SpvOp opcode,
       struct vtn_decoration *dec = rzalloc(b, struct vtn_decoration);
       switch (opcode) {
       case SpvOpDecorate:
+      case SpvOpDecorateId:
       case SpvOpDecorateStringGOOGLE:
          dec->scope = VTN_DEC_DECORATION;
          break;
@@ -3760,6 +3762,7 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
    case SpvOpExecutionMode:
    case SpvOpDecorationGroup:
    case SpvOpDecorate:
+   case SpvOpDecorateId:
    case SpvOpMemberDecorate:
    case SpvOpGroupDecorate:
    case SpvOpGroupMemberDecorate:
@@ -3947,6 +3950,7 @@ vtn_handle_variable_or_type_instruction(struct vtn_builder *b, SpvOp opcode,
    case SpvOpMemberName:
    case SpvOpDecorationGroup:
    case SpvOpDecorate:
+   case SpvOpDecorateId:
    case SpvOpMemberDecorate:
    case SpvOpGroupDecorate:
    case SpvOpGroupMemberDecorate:




More information about the mesa-commit mailing list