aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv/emit_context.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-03-25 20:27:09 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:24 -0400
commitf5672777c8af4700c9e0fc32af52cb2563f564f4 (patch)
treeabb38c87d961475efecff436f2c1a76247c5f8be /src/shader_recompiler/backend/spirv/emit_context.cpp
parentfda0835300a7ef6112791ae503435c81ffe883f5 (diff)
shader: Implement FragDepth
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index 5db4a9082c..3d028db0fc 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -359,6 +359,12 @@ void EmitContext::DefineOutputs(const Info& info) {
Decorate(frag_color[i], spv::Decoration::Location, static_cast<u32>(i));
Name(frag_color[i], fmt::format("frag_color{}", i));
}
+ if (!info.stores_frag_depth) {
+ return;
+ }
+ frag_depth = DefineOutput(*this, F32[1]);
+ Decorate(frag_depth, spv::Decoration::BuiltIn, static_cast<u32>(spv::BuiltIn::FragDepth));
+ Name(frag_depth, "frag_depth");
}
}