From 613da72ac0c2f56a5e1a2c4becf7e373a2b82e77 Mon Sep 17 00:00:00 2001 From: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:34:56 +0200 Subject: [PATCH] [spv-out] require ClipDistance & CullDistance capabilities if necessary (#2528) --- src/back/spv/writer.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/back/spv/writer.rs b/src/back/spv/writer.rs index 56d018b6f3..8cad9c4d27 100644 --- a/src/back/spv/writer.rs +++ b/src/back/spv/writer.rs @@ -1514,8 +1514,20 @@ impl Writer { // vertex Bi::BaseInstance => BuiltIn::BaseInstance, Bi::BaseVertex => BuiltIn::BaseVertex, - Bi::ClipDistance => BuiltIn::ClipDistance, - Bi::CullDistance => BuiltIn::CullDistance, + Bi::ClipDistance => { + self.require_any( + "`clip_distance` built-in", + &[spirv::Capability::ClipDistance], + )?; + BuiltIn::ClipDistance + } + Bi::CullDistance => { + self.require_any( + "`cull_distance` built-in", + &[spirv::Capability::CullDistance], + )?; + BuiltIn::CullDistance + } Bi::InstanceIndex => BuiltIn::InstanceIndex, Bi::PointSize => BuiltIn::PointSize, Bi::VertexIndex => BuiltIn::VertexIndex,