[v3,33/42] compiler/spirv: add support for Float16 and Int8 capabilities

Submitted by Iago Toral Quiroga on Jan. 15, 2019, 1:54 p.m.

Details

Message ID 20190115135414.2313-34-itoral@igalia.com
State New
Headers show
Series "intel: VK_KHR_shader_float16_int8 implementation" ( rev: 5 4 ) in Mesa

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga Jan. 15, 2019, 1:54 p.m.
v2:
 - Merge Float16 and Int8 capabilities into a single patch (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v1)
---
 src/compiler/shader_info.h        | 2 ++
 src/compiler/spirv/spirv_to_nir.c | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index 87a2c805d37..1d45433312a 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -37,12 +37,14 @@  struct spirv_supported_capabilities {
    bool descriptor_array_dynamic_indexing;
    bool device_group;
    bool draw_parameters;
+   bool float16;
    bool float64;
    bool geometry_streams;
    bool gcn_shader;
    bool image_ms_array;
    bool image_read_without_format;
    bool image_write_without_format;
+   bool int8;
    bool int16;
    bool int64;
    bool int64_atomics;
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 76a997ee341..731b1cbea5b 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3518,8 +3518,6 @@  vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityLinkage:
       case SpvCapabilityVector16:
       case SpvCapabilityFloat16Buffer:
-      case SpvCapabilityFloat16:
-      case SpvCapabilityInt8:
       case SpvCapabilitySparseResidency:
          vtn_warn("Unsupported SPIR-V capability: %s",
                   spirv_capability_to_string(cap));
@@ -3536,12 +3534,18 @@  vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityFloat64:
          spv_check_supported(float64, cap);
          break;
+      case SpvCapabilityFloat16:
+         spv_check_supported(float16, cap);
+         break;
       case SpvCapabilityInt64:
          spv_check_supported(int64, cap);
          break;
       case SpvCapabilityInt16:
          spv_check_supported(int16, cap);
          break;
+      case SpvCapabilityInt8:
+         spv_check_supported(int8, cap);
+         break;
 
       case SpvCapabilityTransformFeedback:
          spv_check_supported(transform_feedback, cap);