From 68416cd9a206cee87da40ffc831d6cba8d420982 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 28 Jan 2022 23:32:21 +0100 Subject: [PATCH] early-access version 2441 --- README.md | 2 +- src/shader_recompiler/backend/spirv/emit_spirv.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d47eb312a..b731a4489 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2440. +This is the source code for early-access 2441. ## Legal Notice diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 50918317f..08b3a81ce 100755 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp @@ -387,6 +387,14 @@ void SetupSignedNanCapabilities(const Profile& profile, const IR::Program& progr } } +void SetupTransformFeedbackCapabilities(EmitContext& ctx, Id main_func) { + if (ctx.runtime_info.xfb_varyings.empty()) { + return; + } + ctx.AddCapability(spv::Capability::TransformFeedback); + ctx.AddExecutionMode(main_func, spv::ExecutionMode::Xfb); +} + void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ctx) { if (info.uses_sampled_1d) { ctx.AddCapability(spv::Capability::Sampled1D); @@ -442,9 +450,6 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct if (info.uses_sample_id) { ctx.AddCapability(spv::Capability::SampleRateShading); } - if (!ctx.runtime_info.xfb_varyings.empty()) { - ctx.AddCapability(spv::Capability::TransformFeedback); - } if (info.uses_derivatives) { ctx.AddCapability(spv::Capability::DerivativeControl); } @@ -484,6 +489,7 @@ std::vector EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in SetupSignedNanCapabilities(profile, program, ctx, main); } SetupCapabilities(profile, program.info, ctx); + SetupTransformFeedbackCapabilities(ctx, main); PatchPhiNodes(program, ctx); return ctx.Assemble(); }