summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-01-28 23:55:17 +0100
committerGitHub <noreply@github.com>2022-01-28 23:55:17 +0100
commit2241d8c971df040050afe3470d4a900f29e9baa4 (patch)
tree539482328b7532c5b1ff581524a696c1b448132b /src/shader_recompiler
parentMerge pull request #7770 from german77/motion-threshold (diff)
parentemit_spirv: Add Xfb execution mode when transform feedback is used (diff)
downloadyuzu-2241d8c971df040050afe3470d4a900f29e9baa4.tar
yuzu-2241d8c971df040050afe3470d4a900f29e9baa4.tar.gz
yuzu-2241d8c971df040050afe3470d4a900f29e9baa4.tar.bz2
yuzu-2241d8c971df040050afe3470d4a900f29e9baa4.tar.lz
yuzu-2241d8c971df040050afe3470d4a900f29e9baa4.tar.xz
yuzu-2241d8c971df040050afe3470d4a900f29e9baa4.tar.zst
yuzu-2241d8c971df040050afe3470d4a900f29e9baa4.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index 50918317f..08b3a81ce 100644
--- 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<u32> 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();
}