diff options
author | Matthew McClure <[email protected]> | 2013-11-26 10:50:27 -0800 |
---|---|---|
committer | José Fonseca <[email protected]> | 2013-12-09 12:57:02 +0000 |
commit | 0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1 (patch) | |
tree | af651e31eae395fb14550a9e2c3d38a61013135b /src/gallium/drivers/llvmpipe/lp_rast.c | |
parent | 992a2dbba80aba35efe83202e1013bd6143f0dba (diff) |
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 <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 0cd62c2d99f..6feec947137 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -367,6 +367,9 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task, depth_stride = scene->zsbuf.stride; } + /* Propagate non-interpolated raster state. */ + task->thread_data.raster_state.viewport_index = inputs->viewport_index; + /* run shader on 4x4 block */ BEGIN_JIT_CALL(state, task); variant->jit_function[RAST_WHOLE]( &state->jit_context, @@ -462,6 +465,9 @@ lp_rast_shade_quads_mask(struct lp_rasterizer_task *task, /* always count this not worth bothering? */ task->ps_invocations += 1 * variant->ps_inv_multiplier; + /* Propagate non-interpolated raster state. */ + task->thread_data.raster_state.viewport_index = inputs->viewport_index; + /* run shader on 4x4 block */ BEGIN_JIT_CALL(state, task); variant->jit_function[RAST_EDGE_TEST](&state->jit_context, |