_mesa_error(ctx, GL_INVALID_ENUM, "C/AFragmentOpATI(arg)");
return 0;
}
- if ((arg == GL_SECONDARY_INTERPOLATOR_ATI) && (((optype == 0) && (argRep == GL_ALPHA)) ||
- ((optype == 1) && ((arg == GL_ALPHA) || (argRep == GL_NONE))))) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interp)");
- return 0;
- }
- if ((arg == GL_SECONDARY_INTERPOLATOR_ATI) && (((optype == 0) && (argRep == GL_ALPHA)) ||
- ((optype == 1) && ((arg == GL_ALPHA) || (argRep == GL_NONE))))) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interp)");
- return 0;
+ /* The ATI_fragment_shader spec says:
+ *
+ * The error INVALID_OPERATION is generated by
+ * ColorFragmentOp[1..3]ATI if <argN> is SECONDARY_INTERPOLATOR_ATI
+ * and <argNRep> is ALPHA, or by AlphaFragmentOp[1..3]ATI if <argN>
+ * is SECONDARY_INTERPOLATOR_ATI and <argNRep> is ALPHA or NONE, ...
+ */
+ if (arg == GL_SECONDARY_INTERPOLATOR_ATI) {
+ if (optype == ATI_FRAGMENT_SHADER_COLOR_OP && argRep == GL_ALPHA) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "CFragmentOpATI(sec_interp)");
+ return 0;
+ } else if (optype == ATI_FRAGMENT_SHADER_ALPHA_OP &&
+ (argRep == GL_ALPHA || argRep == GL_NONE)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "AFragmentOpATI(sec_interp)");
+ return 0;
+ }
}
if ((curProg->cur_pass == 1) &&
((arg == GL_PRIMARY_COLOR_ARB) || (arg == GL_SECONDARY_INTERPOLATOR_ATI))) {
return;
}
}
- if ((op == GL_DOT4_ATI) &&
- (((arg1 == GL_SECONDARY_INTERPOLATOR_ATI) && ((arg1Rep == GL_ALPHA) || (arg1Rep == GL_NONE))) ||
- (((arg2 == GL_SECONDARY_INTERPOLATOR_ATI) && ((arg2Rep == GL_ALPHA) || (arg2Rep == GL_NONE)))))) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interp)");
+ /* The ATI_fragment_shader spec says:
+ *
+ * The error INVALID_OPERATION is generated by... ColorFragmentOp2ATI
+ * if <op> is DOT4_ATI and <argN> is SECONDARY_INTERPOLATOR_ATI and
+ * <argNRep> is ALPHA or NONE.
+ */
+ if (optype == ATI_FRAGMENT_SHADER_COLOR_OP && op == GL_DOT4_ATI &&
+ ((arg1 == GL_SECONDARY_INTERPOLATOR_ATI && (arg1Rep == GL_ALPHA || arg1Rep == GL_NONE)) ||
+ (arg2 == GL_SECONDARY_INTERPOLATOR_ATI && (arg2Rep == GL_ALPHA || arg2Rep == GL_NONE)))) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interpDOT4)");
+ return;
}
if (!check_arith_arg(curProg, optype, arg1, arg1Rep)) {