From 7edc8b4e794a71da5b21cfbdb850420dfbac5122 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 18 Jun 2022 20:33:18 -0500 Subject: [PATCH] VideoBackends:Metal: Don't set primitive on ubershaders --- Source/Core/VideoBackends/Metal/MTLObjectCache.mm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Core/VideoBackends/Metal/MTLObjectCache.mm b/Source/Core/VideoBackends/Metal/MTLObjectCache.mm index 0110ebb769..49a9f4b1fb 100644 --- a/Source/Core/VideoBackends/Metal/MTLObjectCache.mm +++ b/Source/Core/VideoBackends/Metal/MTLObjectCache.mm @@ -330,10 +330,13 @@ public: // Throw extras in bits we don't otherwise use if (cfg.rasterization_state.cullmode == CullMode::All) blend.hex |= 1 << 29; - if (cfg.rasterization_state.primitive == PrimitiveType::Points) - blend.hex |= 1 << 30; - else if (cfg.rasterization_state.primitive == PrimitiveType::Lines) - blend.hex |= 1 << 31; + if (cfg.usage != AbstractPipelineUsage::GXUber) + { + if (cfg.rasterization_state.primitive == PrimitiveType::Points) + blend.hex |= 1 << 30; + else if (cfg.rasterization_state.primitive == PrimitiveType::Lines) + blend.hex |= 1 << 31; + } } PipelineID() { memset(this, 0, sizeof(*this)); } PipelineID(const PipelineID& other) { memcpy(this, &other, sizeof(*this)); } @@ -386,7 +389,8 @@ public: if (config.vertex_format) [desc setVertexDescriptor:static_cast(config.vertex_format)->Get()]; RasterizationState rs = config.rasterization_state; - [desc setInputPrimitiveTopology:GetClass(rs.primitive)]; + if (config.usage != AbstractPipelineUsage::GXUber) + [desc setInputPrimitiveTopology:GetClass(rs.primitive)]; if (rs.cullmode == CullMode::All) [desc setRasterizationEnabled:NO]; MTLRenderPipelineColorAttachmentDescriptor* color0 =