Mesa (20.0): Revert "spirv: Implement OpCopyObject and OpCopyLogical as blind copies"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 3 11:18:07 UTC 2020


Module: Mesa
Branch: 20.0
Commit: 2120f106e0e8688bded05d0b66206f2fc1150941
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2120f106e0e8688bded05d0b66206f2fc1150941

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Apr  1 12:40:34 2020 -0500

Revert "spirv: Implement OpCopyObject and OpCopyLogical as blind copies"

This reverts commit 7a53e67816ed9baf7d825ed60ee59f0c05f9df48.

(cherry picked from commit 68f325b256d96dca923f6c7d84bc6faf43911245)

---

 .pick_status.json                 |  2 +-
 src/compiler/spirv/spirv_to_nir.c | 26 +++-----------------------
 2 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 7ab22bd299c..1d19040a311 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -283,7 +283,7 @@
         "description": "Revert \"spirv: Implement OpCopyObject and OpCopyLogical as blind copies\"",
         "nominated": false,
         "nomination_type": 2,
-        "resolution": 4,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "7a53e67816ed9baf7d825ed60ee59f0c05f9df48"
     },
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 5b0d35c8167..2f9d2eecad9 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3569,30 +3569,10 @@ vtn_handle_composite(struct vtn_builder *b, SpvOp opcode,
                                  w + 5, count - 5);
       break;
 
+   case SpvOpCopyLogical:
    case SpvOpCopyObject:
-   case SpvOpCopyLogical: {
-      struct vtn_value *src = vtn_untyped_value(b, w[3]);
-      struct vtn_value *dst = vtn_push_value(b, w[2], src->value_type);
-      if (opcode == SpvOpCopyObject) {
-         vtn_fail_if(dst->type->id != src->type->id,
-                     "Result Type of OpCopyObject must equal Operand type");
-      } else {
-         assert(opcode == SpvOpCopyLogical);
-         /* The logical type matching rules should guarantee we have exactly
-          * the same GLSL type which means that, if it's an SSA value, we
-          * don't actually need to clone it; we can just copy it blind.
-          */
-         vtn_fail_if(dst->type->type != src->type->type,
-                     "Result Type of OpCopyLogical must logically match "
-                     "the Operand type");
-      }
-      struct vtn_value src_copy = *src;
-      src_copy.name = dst->name;
-      src_copy.decoration = dst->decoration;
-      src_copy.type = dst->type;
-      *dst = src_copy;
-      return;
-   }
+      ssa = vtn_composite_copy(b, vtn_ssa_value(b, w[3]));
+      break;
 
    default:
       vtn_fail_with_opcode("unknown composite operation", opcode);



More information about the mesa-commit mailing list