spirv: Add support for SPV_KHR_multiview
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 21 Mar 2017 22:24:25 +0000 (15:24 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 3 May 2017 18:25:46 +0000 (11:25 -0700)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/spirv/nir_spirv.h
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c

index 1779d1c5f3f1811e3c23683d086dfde476e777b6..7f16866b4930e30a2fc2905195840b34b96c171f 100644 (file)
@@ -50,6 +50,7 @@ struct nir_spirv_supported_extensions {
    bool image_read_without_format;
    bool image_write_without_format;
    bool int64;
+   bool multiview;
 };
 
 nir_function *spirv_to_nir(const uint32_t *words, size_t word_count,
index d3ad2d13ed86cc4c25e73332490dbdaab11478b4..c120ad6d19de2334591168fdd09c5f167ccbe3c8 100644 (file)
@@ -2730,6 +2730,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          spv_check_supported(image_write_without_format, cap);
          break;
 
+      case SpvCapabilityMultiView:
+         spv_check_supported(multiview, cap);
+         break;
+
       default:
          unreachable("Unhandled capability");
       }
index 293d07d68bf02ecf8df63cc7c8aaffcb4111e319..365e562386fe62b0c2cec2dfed7b72227ab481ac 100644 (file)
@@ -1036,6 +1036,10 @@ vtn_get_builtin_location(struct vtn_builder *b,
       *location = SYSTEM_VALUE_DRAW_ID;
       set_mode_system_value(mode);
       break;
+   case SpvBuiltInViewIndex:
+      *location = SYSTEM_VALUE_VIEW_INDEX;
+      set_mode_system_value(mode);
+      break;
    case SpvBuiltInHelperInvocation:
    default:
       unreachable("unsupported builtin");