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

This reverts commit 7a53e67816.

(cherry picked from commit 68f325b256)
This commit is contained in:
Jason Ekstrand 2020-04-01 12:40:34 -05:00 committed by Eric Engestrom
parent 4601358fa3
commit 2120f106e0
2 changed files with 4 additions and 24 deletions

View file

@ -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"
},

View file

@ -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);