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).
This commit is contained in:
Ian Romanick 2009-09-03 14:05:18 -07:00
parent 8ca6fd8a83
commit b8e389bb03
2 changed files with 903 additions and 862 deletions

File diff suppressed because it is too large Load diff

View file

@ -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