Used for depth test, alpha test, stencil test, shadow test, etc.
#define PIPE_LOGICOP_OR 14
#define PIPE_LOGICOP_SET 15
-#define PIPE_STENCIL_FUNC_NEVER 0
-#define PIPE_STENCIL_FUNC_LESS 1
-#define PIPE_STENCIL_FUNC_EQUAL 2
-#define PIPE_STENCIL_FUNC_LEQUAL 3
-#define PIPE_STENCIL_FUNC_GREATER 4
-#define PIPE_STENCIL_FUNC_NOTEQUAL 5
-#define PIPE_STENCIL_FUNC_GEQUAL 6
-#define PIPE_STENCIL_FUNC_ALWAYS 7
+/**
+ * Inequality functions. Used for depth test, stencil compare, alpha
+ * test, shadow compare, etc.
+ */
+#define PIPE_FUNC_NEVER 0
+#define PIPE_FUNC_LESS 1
+#define PIPE_FUNC_EQUAL 2
+#define PIPE_FUNC_LEQUAL 3
+#define PIPE_FUNC_GREATER 4
+#define PIPE_FUNC_NOTEQUAL 5
+#define PIPE_FUNC_GEQUAL 6
+#define PIPE_FUNC_ALWAYS 7
#define PIPE_STENCIL_OP_KEEP 0
#define PIPE_STENCIL_OP_ZERO 1
#define PIPE_STENCIL_OP_DECR_WRAP 6
#define PIPE_STENCIL_OP_INVERT 7
-/* Note: same as stencil funcs. Also used for shadow/depth compare */
-#define PIPE_DEPTH_FUNC_NEVER 0
-#define PIPE_DEPTH_FUNC_LESS 1
-#define PIPE_DEPTH_FUNC_EQUAL 2
-#define PIPE_DEPTH_FUNC_LEQUAL 3
-#define PIPE_DEPTH_FUNC_GREATER 4
-#define PIPE_DEPTH_FUNC_NOTEQUAL 5
-#define PIPE_DEPTH_FUNC_GEQUAL 6
-#define PIPE_DEPTH_FUNC_ALWAYS 7
-
#define PIPE_TEX_WRAP_REPEAT 0
#define PIPE_TEX_WRAP_CLAMP 1
#define PIPE_TEX_WRAP_CLAMP_TO_EDGE 2
gl_depth_func_to_sp(GLenum func)
{
/* Same values, just biased */
- assert(PIPE_DEPTH_FUNC_NEVER == GL_NEVER - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_LESS == GL_LESS - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_EQUAL == GL_EQUAL - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_LEQUAL == GL_LEQUAL - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_GREATER == GL_GREATER - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_NOTEQUAL == GL_NOTEQUAL - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_GEQUAL == GL_GEQUAL - GL_NEVER);
- assert(PIPE_DEPTH_FUNC_ALWAYS == GL_ALWAYS - GL_NEVER);
+ assert(PIPE_FUNC_NEVER == GL_NEVER - GL_NEVER);
+ assert(PIPE_FUNC_LESS == GL_LESS - GL_NEVER);
+ assert(PIPE_FUNC_EQUAL == GL_EQUAL - GL_NEVER);
+ assert(PIPE_FUNC_LEQUAL == GL_LEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_GREATER == GL_GREATER - GL_NEVER);
+ assert(PIPE_FUNC_NOTEQUAL == GL_NOTEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_GEQUAL == GL_GEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_ALWAYS == GL_ALWAYS - GL_NEVER);
assert(func >= GL_NEVER);
assert(func <= GL_ALWAYS);
return func - GL_NEVER;
gl_stencil_func_to_sp(GLenum func)
{
/* Same values, just biased */
- assert(PIPE_STENCIL_FUNC_NEVER == GL_NEVER - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_LESS == GL_LESS - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_EQUAL == GL_EQUAL - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_LEQUAL == GL_LEQUAL - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_GREATER == GL_GREATER - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_NOTEQUAL == GL_NOTEQUAL - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_GEQUAL == GL_GEQUAL - GL_NEVER);
- assert(PIPE_STENCIL_FUNC_ALWAYS == GL_ALWAYS - GL_NEVER);
+ assert(PIPE_FUNC_NEVER == GL_NEVER - GL_NEVER);
+ assert(PIPE_FUNC_LESS == GL_LESS - GL_NEVER);
+ assert(PIPE_FUNC_EQUAL == GL_EQUAL - GL_NEVER);
+ assert(PIPE_FUNC_LEQUAL == GL_LEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_GREATER == GL_GREATER - GL_NEVER);
+ assert(PIPE_FUNC_NOTEQUAL == GL_NOTEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_GEQUAL == GL_GEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_ALWAYS == GL_ALWAYS - GL_NEVER);
assert(func >= GL_NEVER);
assert(func <= GL_ALWAYS);
return func - GL_NEVER;