summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-08-21 04:57:56 +0200
committerSubv <subv2112@gmail.com>2018-08-21 04:57:56 +0200
commite3bddf81375ce5b13666d64cbf534c802a74b8d3 (patch)
treed66e6c33b5686fb1144a634eeed9327efbaffcf5 /src
parentMerge pull request #1126 from lioncash/telem (diff)
downloadyuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.tar
yuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.tar.gz
yuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.tar.bz2
yuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.tar.lz
yuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.tar.xz
yuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.tar.zst
yuzu-e3bddf81375ce5b13666d64cbf534c802a74b8d3.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 6fb663bbc..aeb908744 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -918,7 +918,6 @@ private:
FragmentHeader header;
std::memcpy(&header, program_code.data(), PROGRAM_HEADER_SIZE);
- ASSERT_MSG(header.writes_depth == 0, "Depth write is unimplemented");
ASSERT_MSG(header.writes_samplemask == 0, "Samplemask write is unimplemented");
// Write the color outputs using the data in the shader registers, disabled
@@ -935,6 +934,12 @@ private:
}
}
}
+
+ if (header.writes_depth) {
+ // The depth output is always 2 registers after the last color output, and current_reg
+ // already contains one past the last color register.
+ shader.AddLine("gl_FragDepth = " + regs.GetRegisterAsFloat(current_reg + 1) + ';');
+ }
}
/**