From b8e389bb0315287b72087b93a089ab944d77ab80 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 3 Sep 2009 14:05:18 -0700 Subject: NV fp parser: Support new scalar constant behavior ARBfp requires scalar constants have a '.x' suffix, but NVfp_option does not. This shows up with instructions that require a scalar parameter (e.g., COS). --- src/mesa/shader/program_parse.y | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mesa/shader/program_parse.y') diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 4cd459a096..fa94f763c4 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -534,6 +534,23 @@ scalarSrcReg: optionalSign srcReg scalarSuffix $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, $3.swizzle); } + | optionalSign paramConstScalarUse + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & $2); + + init_src_reg(& $$); + $$.Base.File = PROGRAM_CONSTANT; + $$.Base.Index = temp_sym.param_binding_begin; + } ; swizzleSrcReg: optionalSign srcReg swizzleSuffix -- cgit v1.2.3