From b048d8bf8f056759d1845a799d4ba2ac84bce30f Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 5 Jun 2019 15:39:41 +0200 Subject: mesa/st: add tgsi-lowering code for depth-clamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a TGSI pass that lowers depth-clamping into shader-operations, by replacing the depth-value with 0 (a z-coordinate of zero will always pass the OpenGL depth test conditions), and using a dedicated varying to interpolate the real depth-value instead. Finally we replace the depth-output in the fragment shader. v1 implemented by Erik Faye-Lund v2: Add support for handling depth clip mode, and refactor code v3: - Rename *_vs functions to *_last_vertex_stage (Erik) - Use 0.0 depth to avoid clipping (Erik) v4: Fix inversion of bool value for clip control property Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Marek Olšák --- src/mesa/meson.build | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/meson.build') diff --git a/src/mesa/meson.build b/src/mesa/meson.build index 4a89358a267..563bdd7c103 100644 --- a/src/mesa/meson.build +++ b/src/mesa/meson.build @@ -600,6 +600,8 @@ files_libmesa_gallium = files( 'state_tracker/st_shader_cache.h', 'state_tracker/st_texture.c', 'state_tracker/st_texture.h', + 'state_tracker/st_tgsi_lower_depth_clamp.c', + 'state_tracker/st_tgsi_lower_depth_clamp.h', 'state_tracker/st_tgsi_lower_yuv.c', 'state_tracker/st_tgsi_lower_yuv.h', 'state_tracker/st_util.h', -- cgit v1.2.3