diff options
author | Brian Paul <[email protected]> | 2010-03-18 13:02:53 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-03-18 13:06:32 -0600 |
commit | 22e6dc387039e79f6d1435ae8b7422a6514d5d10 (patch) | |
tree | 15a8e1c26690f70b6d8486ebdc83fc6312a04619 /src/gallium/drivers/llvmpipe/lp_setup_tri.c | |
parent | d219b8a022a6fdaa0106c6e160b594c359f85185 (diff) |
gallivm/llvmpipe: added lp_rast_shader_inputs::facing and pass through
The triangle rasterizer sets this field to indicate front/back-facing.
It gets passed into the generated fragment code as another parameter.
Used now for stencil front/back selection but will also be used for
fragment shaders in general (see TGSI_SEMANTIC_FACE).
With this commit two-sided stenciling mostly works but there's
still a bug or two...
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_tri.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_tri.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index ac6264dc73e..ce689d3d568 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -361,6 +361,8 @@ do_triangle_ccw(struct lp_setup_context *setup, */ setup_tri_coefficients( setup, tri, oneoverarea, v1, v2, v3, frontfacing ); + tri->inputs.facing = frontfacing ? 1.0F : -1.0F; + /* half-edge constants, will be interated over the whole render target. */ tri->c1 = tri->dy12 * x1 - tri->dx12 * y1; |