diff options
author | Roland Scheidegger <[email protected]> | 2013-06-07 21:03:40 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-06-07 21:15:01 +0200 |
commit | d8146f240e628e70d4c07f7e805a179f70c36e23 (patch) | |
tree | edfc30c3469fc1cb24ff96891453d1c9806e41d3 /src/gallium/drivers/llvmpipe/lp_setup_point.c | |
parent | 0f4c08aea2da3bd808109d09dbcdc249d1fb6b74 (diff) |
llvmpipe: add support for layered rendering
Mostly just make sure the layer parameter gets passed through to the right
places (and get clamped, can do this at setup time), fix up clears to
clear all layers and disable opaque optimization. Luckily don't need to
touch the jitted code.
(Clears invoked via pipe's clear_render_target method will not work however
since the pipe_util_clear function used for it doesn't handle clearing
multiple layers yet.)
v2: per Brian's suggestion, prettify var initialization and add some comments,
add assertion for impossible layer specification for surface.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_point.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_point.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c index b8040ae56f6..789caa80761 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_point.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c @@ -325,11 +325,17 @@ try_setup_point( struct lp_setup_context *setup, unsigned nr_planes = 4; struct point_info info; unsigned scissor_index = 0; + unsigned layer = 0; if (setup->viewport_index_slot > 0) { unsigned *udata = (unsigned*)v0[setup->viewport_index_slot]; scissor_index = lp_clamp_scissor_idx(*udata); } + if (setup->layer_slot > 0) { + layer = *(unsigned*)v0[setup->layer_slot]; + layer = MIN2(layer, scene->fb_max_layer); + } + /* Bounding rectangle (in pixels) */ { /* Yes this is necessary to accurately calculate bounding boxes @@ -386,6 +392,7 @@ try_setup_point( struct lp_setup_context *setup, point->inputs.frontfacing = TRUE; point->inputs.disable = FALSE; point->inputs.opaque = FALSE; + point->inputs.layer = layer; { struct lp_rast_plane *plane = GET_PLANES(point); |