Wire up FragDepth builtin

Bug: b/118386749
Test: dEQP-VK.renderpass.*
Test: dEQP-VK.glsl.*
Change-Id: I1f830c3fbe5b1f6bca0a6f17dd37fffd00e0cfa3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29249
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index 74d5b29..305d7d5 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -71,6 +71,12 @@
 			}
 		}
 
+		it = spirvShader->outputBuiltins.find(spv::BuiltInFragDepth);
+		if (it != spirvShader->outputBuiltins.end())
+		{
+			oDepth = routine.getVariable(it->second.Id)[it->second.FirstComponent];
+		}
+
 		if(spirvShader->getModes().DepthReplacing)
 		{
 			oDepth = Min(Max(oDepth, Float4(0.0f)), Float4(1.0f));