spirv: Support the CullPrimitiveEXT mesh shader built-in.
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 21 Jan 2022 18:38:13 +0000 (19:38 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:18:33 +0000 (16:18 +0000)
This is a per-primitive builtin output which indicates that a
primitive should be culled (deleted) from the output.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

src/compiler/spirv/vtn_variables.c

index 196f1a0..1326a92 100644 (file)
@@ -1162,6 +1162,9 @@ vtn_get_builtin_location(struct vtn_builder *b,
       *location = SYSTEM_VALUE_MESH_VIEW_INDICES;
       set_mode_system_value(b, mode);
       break;
+   case SpvBuiltInCullPrimitiveEXT:
+      *location = VARYING_SLOT_CULL_PRIMITIVE;
+      break;
    default:
       vtn_fail("Unsupported builtin: %s (%u)",
                spirv_builtin_to_string(builtin), builtin);