summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/prog_instruction.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-01-29 23:22:08 -0800
committerKenneth Graunke <[email protected]>2015-03-27 21:16:34 -0700
commitfaf6106c6f6fa2ba90ec175baaa8b54bec9f5125 (patch)
tree0839a814380095f2930ca0afe01373b574fde3ad /src/mesa/program/prog_instruction.h
parent06f7bea96ab62e7de1523de837f5b69c1bac6513 (diff)
nir: Implement a Mesa IR -> NIR translator.
Shamelessly ripped off from Eric Anholt's tgsi_to_nir pass. This is not built on SCons, like the rest of NIR. v2: - Delete redundant c->s, c->impl, and c->cf_node_list pointers (Ken) - Use nir_builder directly instead of ptn_compile in more places (Ken) - Drop 'struct' keyword in front of nir_builder (ken) - Add a file level Doxygen comment (Ken) - Use scalar constants instead of splatting (Eric) - Use nir_builder helpers for constants, moves, and swizzles (Connor) v3: Minor indentation improvements. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/program/prog_instruction.h')
-rw-r--r--src/mesa/program/prog_instruction.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/program/prog_instruction.h b/src/mesa/program/prog_instruction.h
index ab3acbc02dd..96da198f86d 100644
--- a/src/mesa/program/prog_instruction.h
+++ b/src/mesa/program/prog_instruction.h
@@ -59,6 +59,8 @@
#define SWIZZLE_NOOP MAKE_SWIZZLE4(0,1,2,3)
#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7)
#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1)
+/** Determine if swz contains SWIZZLE_ZERO/ONE/NIL for any components. */
+#define HAS_EXTENDED_SWIZZLE(swz) (swz & 0x924)
#define SWIZZLE_XYZW MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W)
#define SWIZZLE_XXXX MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)