Hi,

_mesa_layout_parameters builds a new gl_program_parameter from an existing one.
The problem is that the StateFlags field is not properly kept, because
parameters handled in "PASS1" are simply memcpy'ed.
This simple patch fixes the issue.

Pierre-Eric
From 274417760584e0461396feaa43b7223a00895a14 Mon Sep 17 00:00:00 2001
From: Pierre-Eric Pelloux-Prayer <pell...@gmail.com>
Date: Thu, 26 May 2011 20:06:42 +0200
Subject: [PATCH 4/7] bugfix : gl_program_parameter_list' StateFlags field may be lost

When using _mesa_layout_parameters, all params copied in the 'layout' output in the PASS 1 don't modify StateFlags (because they are simply memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list StateFlags field is the same as the input one.
---
 src/mesa/program/prog_parameter_layout.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/prog_parameter_layout.c b/src/mesa/program/prog_parameter_layout.c
index d7dc97e..90a9771 100644
--- a/src/mesa/program/prog_parameter_layout.c
+++ b/src/mesa/program/prog_parameter_layout.c
@@ -207,6 +207,7 @@ _mesa_layout_parameters(struct asm_parser_state *state)
       }
    }
 
+   layout->StateFlags = state->prog->Parameters->StateFlags;
    _mesa_free_parameter_list(state->prog->Parameters);
    state->prog->Parameters = layout;
 
-- 
1.7.0.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to