From a8c4242395b1bce0eac2a20243e5289414a9f511 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 30 May 2006 22:17:35 +0000 Subject: Define new NEGATE_* tokens for setting the src register's NegateBase field. Before, we were using GL_TRUE/GL_FALSE in a few places. Note: only the SWZ instruction can negate individual components. --- src/mesa/shader/program_instruction.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/mesa/shader/program_instruction.h') diff --git a/src/mesa/shader/program_instruction.h b/src/mesa/shader/program_instruction.h index 20886d9f02..93bcfc240a 100644 --- a/src/mesa/shader/program_instruction.h +++ b/src/mesa/shader/program_instruction.h @@ -74,6 +74,19 @@ /*@}*/ +/** + * Per-component negation masks + */ +/*@{*/ +#define NEGATE_X 0x1 +#define NEGATE_Y 0x2 +#define NEGATE_Z 0x4 +#define NEGATE_W 0x8 +#define NEGATE_XYZW 0xf +#define NEGATE_NONE 0x0 +/*@}*/ + + /** * Program instruction opcodes, for both vertex and fragment programs. * \note changes to this opcode list must be reflected in t_vb_arbprogram.c @@ -173,7 +186,8 @@ struct prog_src_register */ /*@{*/ /** - * Per-component negation for the SWZ instruction. + * Per-component negation for the SWZ instruction. For non-SWZ + * instructions the only possible values are NEGATE_XYZW and NEGATE_NONE. * * \since * ARB_vertex_program, ARB_fragment_program @@ -190,8 +204,7 @@ struct prog_src_register GLuint Abs:1; /** - * Take the component-wise negation. The negation occurs \b after the - * (optional) absolute value operation. + * Post-absolute value negation (all components). */ GLuint NegateAbs:1; /*@}*/ -- cgit v1.2.3