spirv: add SpvCapabilityFloat16 support
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 12 Apr 2019 06:53:35 +0000 (08:53 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 15 Apr 2019 08:43:52 +0000 (10:43 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/shader_info.h
src/compiler/spirv/spirv_to_nir.c

index 0b67082a7324aa1c03b2fb5f8128b61049116673..45ba2982884481f42cee7444c0ac786bec725122 100644 (file)
@@ -70,6 +70,7 @@ struct spirv_supported_capabilities {
    bool transform_feedback;
    bool trinary_minmax;
    bool variable_pointers;
+   bool float16;
 };
 
 typedef struct shader_info {
index ef12e21eaa68fc4a454be166e373f2d0607dc748..99bf649e57e6f9d9bc6845b51f7ac0ae279774c6 100644 (file)
@@ -3561,7 +3561,6 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityLinkage:
       case SpvCapabilityVector16:
       case SpvCapabilityFloat16Buffer:
-      case SpvCapabilityFloat16:
       case SpvCapabilitySparseResidency:
          vtn_warn("Unsupported SPIR-V capability: %s",
                   spirv_capability_to_string(cap));
@@ -3731,6 +3730,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          spv_check_supported(derivative_group, cap);
          break;
 
+      case SpvCapabilityFloat16:
+         spv_check_supported(float16, cap);
+         break;
+
       default:
          vtn_fail("Unhandled capability");
       }