summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-21 15:24:25 -0700
committerJason Ekstrand <[email protected]>2017-05-03 11:25:46 -0700
commitf903f78b7237f11f0f8f2bb10db0741a1c69458e (patch)
treeebdcf2a23ebcd692296b1fe2f167d42a1f4843ff /src
parent99d07095533fa46c76f1d739411a8fcbcc4924c2 (diff)
spirv: Add support for SPV_KHR_multiview
Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/spirv/nir_spirv.h1
-rw-r--r--src/compiler/spirv/spirv_to_nir.c4
-rw-r--r--src/compiler/spirv/vtn_variables.c4
3 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 1779d1c5f3f..7f16866b493 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -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,
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index d3ad2d13ed8..c120ad6d19d 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -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");
}
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 293d07d68bf..365e562386f 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -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");