[Mesa-dev] [PATCH v3 20/22] spirv: enable SpvCapabilityFloat64 only to supported platforms

Samuel Iglesias Gonsálvez siglesias at igalia.com
Thu Jan 5 10:18:43 UTC 2017


v2 (Jason):
- Use nir_spirv_supported_extensions to check if the feature is enabled.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/compiler/spirv/nir_spirv.h    | 1 +
 src/compiler/spirv/spirv_to_nir.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 116b0a374cd..2850e91e8b8 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -45,6 +45,7 @@ struct nir_spirv_specialization {
 };
 
 struct nir_spirv_supported_extensions {
+   bool float64;
    bool image_ms_array;
 };
 
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 7217a5e7d51..65efbf5a551 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -2603,7 +2603,6 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityVector16:
       case SpvCapabilityFloat16Buffer:
       case SpvCapabilityFloat16:
-      case SpvCapabilityFloat64:
       case SpvCapabilityInt64:
       case SpvCapabilityInt64Atomics:
       case SpvCapabilityAtomicStorage:
@@ -2620,6 +2619,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
                   spirv_capability_to_string(cap));
          break;
 
+      case SpvCapabilityFloat64:
+         spv_check_supported(float64, cap);
+         break;
+
       case SpvCapabilityAddresses:
       case SpvCapabilityKernel:
       case SpvCapabilityImageBasic:
-- 
2.11.0



More information about the mesa-dev mailing list