[v2,44/53] compiler/spirv: add support for Float16 and Int8 capabilities

Submitted by Iago Toral Quiroga on Dec. 19, 2018, 11:51 a.m.

Details

Message ID 20181219115121.20815-45-itoral@igalia.com
State New
Headers show
Series "intel: VK_KHR_shader_float16_int8 implementation" ( rev: 3 ) in Mesa

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga Dec. 19, 2018, 11:51 a.m.
v2:
 - Merge Float16 and Int8 capabilities into a single patch

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 b21db3e60f0..b4bc95912a5 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -46,6 +46,8 @@  struct spirv_supported_capabilities {
    bool variable_pointers;
    bool storage_16bit;
    bool int16;
+   bool float16;
+   bool int8;
    bool shader_viewport_index_layer;
    bool subgroup_arithmetic;
    bool subgroup_ballot;
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 7dc6bc914d6..dbfd800c945 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3431,9 +3431,7 @@  vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityLinkage:
       case SpvCapabilityVector16:
       case SpvCapabilityFloat16Buffer:
-      case SpvCapabilityFloat16:
       case SpvCapabilityStorageImageMultisample:
-      case SpvCapabilityInt8:
       case SpvCapabilitySparseResidency:
          vtn_warn("Unsupported SPIR-V capability: %s",
                   spirv_capability_to_string(cap));
@@ -3450,12 +3448,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);