mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 07:30:22 +01:00
Define just one set of PIPE_FUNC_LESS, GREATER, EQUAL, etc tokens.
Used for depth test, alpha test, stencil test, shadow test, etc.
This commit is contained in:
parent
9ec2e16223
commit
efe6c50089
3 changed files with 28 additions and 34 deletions
|
|
@ -71,14 +71,18 @@
|
|||
#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
|
||||
|
|
@ -89,16 +93,6 @@
|
|||
#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
|
||||
|
|
|
|||
|
|
@ -45,14 +45,14 @@ static GLuint
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -45,14 +45,14 @@ static GLuint
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue