nir: add shader_clock intrinsic

v2: Add flags and inline comment/description.
v3: None of the input/outputs are variables
v4: Drop clockARB reference, relate code motion barrier comment wrt
intrinsic flag.
v5: Drop the "thus we can eliminate..." comment (Connor)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Emil Velikov
2015-10-07 11:59:26 +01:00
committed by Emil Velikov
parent f1d98fc90a
commit 7682844f34
2 changed files with 14 additions and 0 deletions

View File

@@ -83,6 +83,14 @@ BARRIER(discard)
*/
BARRIER(memory_barrier)
/*
* Shader clock intrinsic with semantics analogous to the clock2x32ARB()
* GLSL intrinsic.
* The latter can be used as code motion barrier, which is currently not
* feasible with NIR.
*/
INTRINSIC(shader_clock, 0, ARR(), true, 1, 0, 0, NIR_INTRINSIC_CAN_ELIMINATE)
/** A conditional discard, with a single boolean source. */
INTRINSIC(discard_if, 1, ARR(1), false, 0, 0, 0, 0)