[Mesa-dev] [PATCH 1/6] glsl: Avoid cascading errors when looking for a scalar boolean and failing.

Kenneth Graunke kenneth at whitecape.org
Mon Apr 11 11:32:00 PDT 2011


On 04/09/2011 10:17 PM, Eric Anholt wrote:
> By always using a boolean, we should generally avoid further
> complaints.  The failure case I see is logic_not, where the user might
> understandably make the mistake of using `!' on a boolean vector (like
> a piglit case did recently!), and then get a further complaint that
> the new boolean type doesn't match the bvec it gets assigned to.
>
> Fixes invalid-logic-not-06.vert (assertion failure when the bad type
> ends up in an expression and ir_constant_expression gets angry).
> ---
>   src/glsl/ast_to_hir.cpp |  124 ++++++++++++++++++-----------------------------
>   1 files changed, 48 insertions(+), 76 deletions(-)

Nice refactor, and the fallback seems reasonable.  I still think error 
handling in AST-to-HIR is a mess, but this is fine for now.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list