summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_state_derived.c
diff options
context:
space:
mode:
authorMatthew McClure <mcclurem@vmware.com>2013-11-26 10:50:27 -0800
committerJosé Fonseca <jfonseca@vmware.com>2013-12-09 12:57:02 +0000
commit0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1 (patch)
treeaf651e31eae395fb14550a9e2c3d38a61013135b /src/gallium/drivers/llvmpipe/lp_state_derived.c
parent992a2dbba80aba35efe83202e1013bd6143f0dba (diff)
downloadexternal_mesa3d-0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1.zip
external_mesa3d-0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1.tar.gz
external_mesa3d-0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1.tar.bz2
llvmpipe: clamp fragment shader depth write to the current viewport depth range.
With this patch, generate_fs_loop will clamp any fragment shader depth writes to the viewport's min and max depth values. Viewport selection is determined by the geometry shader output for the viewport array index. If no index is specified, then the default viewport index is zero. Semantics for this path can be found in draw_clamp_viewport_idx and lp_clamp_viewport_idx. lp_jit_viewport was created to store viewport information visible to JIT code, and is validated when the LP_NEW_VIEWPORT dirty flag is set. lp_rast_shader_inputs is responsible for passing the viewport_index through the rasterizer stage to fragment stage (via lp_jit_thread_data). Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_derived.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_derived.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c
index 47e413b..5c3a3a8 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_derived.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c
@@ -219,6 +219,18 @@ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe )
llvmpipe->num_samplers[PIPE_SHADER_FRAGMENT],
llvmpipe->samplers[PIPE_SHADER_FRAGMENT]);
+ if (llvmpipe->dirty & LP_NEW_VIEWPORT) {
+ /*
+ * Update setup and fragment's view of the active viewport state.
+ *
+ * XXX TODO: It is possible to only loop over the active viewports
+ * instead of all viewports (PIPE_MAX_VIEWPORTS).
+ */
+ lp_setup_set_viewports(llvmpipe->setup,
+ PIPE_MAX_VIEWPORTS,
+ llvmpipe->viewports);
+ }
+
llvmpipe->dirty = 0;
}