summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-10-21 20:36:25 -0700
committerJason Ekstrand <[email protected]>2015-10-21 20:36:25 -0700
commitea23cb3543e793796bd9de9a3c5cf9ebbed0d8de (patch)
treee6fb2cdcf1c6cf60c40d06eb1201e572472ffc22 /src
parentd538fe849df0c3f80fea2765ff36dd2db5eab72b (diff)
nir/spirv: Add capabilities and decorations for basic geometry shaders
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/spirv_to_nir.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c
index a3d38831267..ce191514763 100644
--- a/src/glsl/nir/spirv_to_nir.c
+++ b/src/glsl/nir/spirv_to_nir.c
@@ -400,6 +400,10 @@ type_decoration_cb(struct vtn_builder *b,
/* Ignore these, since we get explicit offsets anyways */
break;
+ case SpvDecorationStream:
+ assert(dec->literals[0] == 0);
+ break;
+
default:
unreachable("Unhandled type decoration");
}
@@ -2473,12 +2477,17 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
break;
case SpvOpCapability:
- /*
- * TODO properly handle these and give a real error if asking for too
- * much.
- */
- assert(w[1] == SpvCapabilityMatrix ||
- w[1] == SpvCapabilityShader);
+ switch ((SpvCapability)w[1]) {
+ case SpvCapabilityMatrix:
+ case SpvCapabilityShader:
+ /* All shaders support these */
+ break;
+ case SpvCapabilityGeometry:
+ assert(b->shader->stage == MESA_SHADER_GEOMETRY);
+ break;
+ default:
+ assert(!"Unsupported capability");
+ }
break;
case SpvOpExtInstImport: