[3/9] intel gen4-5: fix GL_VERTEX_PROGRAM_TWO_SIDE selection.
diff mbox

Message ID 1342728024-15055-4-git-send-email-galibert@pobox.com
State New, archived
Headers show

Commit Message

Olivier Galibert July 19, 2012, 8 p.m. UTC
Previous code only selected two side in pure fixed-function setups.
This version also activates it when needed with shaders programs.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
---
 src/mesa/drivers/dri/i965/brw_sf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Anholt July 26, 2012, 5:19 p.m. UTC | #1
Olivier Galibert <galibert@pobox.com> writes:

> Previous code only selected two side in pure fixed-function setups.
> This version also activates it when needed with shaders programs.
>
> Signed-off-by: Olivier Galibert <galibert@pobox.com>
> ---
>  src/mesa/drivers/dri/i965/brw_sf.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
> index 23a874a..791210f 100644
> --- a/src/mesa/drivers/dri/i965/brw_sf.c
> +++ b/src/mesa/drivers/dri/i965/brw_sf.c
> @@ -192,7 +192,7 @@ brw_upload_sf_prog(struct brw_context *brw)
>  
>     /* _NEW_LIGHT */
>     key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
> -   key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
> +   key.do_twoside_color = ctx->VertexProgram._TwoSideEnabled;

ctx->VertexProgram._TwoSideEnabled is also changed when _NEW_PROGRAM is
set, so that should be noted in the _NEW_LIGHT comment above and
included in brw_sf_prog.dirty.mesa.

Patch
diff mbox

diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index 23a874a..791210f 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -192,7 +192,7 @@  brw_upload_sf_prog(struct brw_context *brw)
 
    /* _NEW_LIGHT */
    key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
-   key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
+   key.do_twoside_color = ctx->VertexProgram._TwoSideEnabled;
 
    /* _NEW_POLYGON */
    if (key.do_twoside_color) {