summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_ir.h
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-22 16:07:14 -0600
committerBrian <[email protected]>2007-03-22 16:07:14 -0600
commite6aeb24b23097024ba60e1c49239a18692f781e1 (patch)
tree0e07b8bd5f798fde7d7b49e4e10c23679263ec0b /src/mesa/shader/slang/slang_ir.h
parent0aad9e262784b0f2ac85afdce88414c986dae2f7 (diff)
Overhaul emit_compare() function.
Previously, comparing vec2, vec3, vec4 was broken. Added IR_EQUAL, IR_NOTEQUAL nodes/operators to compute boolean equality/inequality vs. IR_SEQUAL/IR_SNEQUAL which work component-wise. Use IR_EQUAL/IR_NOTEQUAL for the == and != operators. To compute vec4 equality, use SNE, DP4, SEQ instruction sequence.
Diffstat (limited to 'src/mesa/shader/slang/slang_ir.h')
-rw-r--r--src/mesa/shader/slang/slang_ir.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h
index 3c5526e3c54..cc9df69e722 100644
--- a/src/mesa/shader/slang/slang_ir.h
+++ b/src/mesa/shader/slang/slang_ir.h
@@ -69,6 +69,8 @@ typedef enum
IR_CONT_IF_FALSE,
IR_MOVE,
+
+ /* vector ops: */
IR_ADD,
IR_SUB,
IR_MUL,
@@ -80,12 +82,12 @@ typedef enum
IR_CLAMP,
IR_MIN,
IR_MAX,
- IR_SEQUAL, /* Set if args are equal */
- IR_SNEQUAL, /* Set if args are not equal */
- IR_SGE, /* Set if greater or equal */
- IR_SGT, /* Set if greater than */
- IR_SLE, /* Set if less or equal */
- IR_SLT, /* Set if less than */
+ IR_SEQUAL, /* Set if args are equal (vector) */
+ IR_SNEQUAL, /* Set if args are not equal (vector) */
+ IR_SGE, /* Set if greater or equal (vector) */
+ IR_SGT, /* Set if greater than (vector) */
+ IR_SLE, /* Set if less or equal (vector) */
+ IR_SLT, /* Set if less than (vector) */
IR_POW, /* x^y */
IR_EXP, /* e^x */
IR_EXP2, /* 2^x */
@@ -104,7 +106,10 @@ typedef enum
IR_NOISE2, /* noise(x, y) */
IR_NOISE3, /* noise(x, y, z) */
IR_NOISE4, /* noise(x, y, z, w) */
- IR_NOT, /* logical not */
+
+ IR_EQUAL, /* boolean equality */
+ IR_NOTEQUAL,/* boolean inequality */
+ IR_NOT, /* boolean not */
IR_VAR, /* variable reference */
IR_VAR_DECL,/* var declaration */