summaryrefslogtreecommitdiff
path: root/src/mesa/shader/program_parse.y
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-09-03 14:05:18 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-09-03 14:05:18 -0700
commitb8e389bb0315287b72087b93a089ab944d77ab80 (patch)
tree4b35266c7a2ee37b6356d02db4803d0c4595cde3 /src/mesa/shader/program_parse.y
parent8ca6fd8a83412e3a76746f0ee61027b796516f95 (diff)
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).
Diffstat (limited to 'src/mesa/shader/program_parse.y')
-rw-r--r--src/mesa/shader/program_parse.y17
1 files changed, 17 insertions, 0 deletions
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