diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2008-01-04 17:06:55 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2008-01-04 18:21:45 +0100 |
commit | 1c5f27a18b775b3784fcd265d60e0affa0b31581 (patch) | |
tree | 8f9841014fdf5ddd0c4151c6ad1a0977170e6c79 /src/mesa/pipe | |
parent | 6f012904318311207a20bbf586f1a9f9f8b7fc20 (diff) |
gallium: Make texture target an enum for better debuggability.
Also make enum pipe_format used in a couple more places.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r-- | src/mesa/pipe/i965simple/brw_wm_surface_state.c | 6 | ||||
-rw-r--r-- | src/mesa/pipe/p_defines.h | 10 | ||||
-rw-r--r-- | src/mesa/pipe/p_state.h | 5 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/pipe/i965simple/brw_wm_surface_state.c b/src/mesa/pipe/i965simple/brw_wm_surface_state.c index 5c7dee5790..fc40e0438c 100644 --- a/src/mesa/pipe/i965simple/brw_wm_surface_state.c +++ b/src/mesa/pipe/i965simple/brw_wm_surface_state.c @@ -33,7 +33,7 @@ #include "brw_state.h" #include "brw_defines.h" -static unsigned translate_tex_target( int target ) +static unsigned translate_tex_target( enum pipe_texture_target target ) { switch (target) { case PIPE_TEXTURE_1D: @@ -54,9 +54,9 @@ static unsigned translate_tex_target( int target ) } } -static unsigned translate_tex_format( unsigned mesa_format ) +static unsigned translate_tex_format( enum pipe_format pipe_format ) { - switch( mesa_format ) { + switch( pipe_format ) { case PIPE_FORMAT_U_L8: return BRW_SURFACEFORMAT_L8_UNORM; diff --git a/src/mesa/pipe/p_defines.h b/src/mesa/pipe/p_defines.h index a67ed60547..c6d9c02bd9 100644 --- a/src/mesa/pipe/p_defines.h +++ b/src/mesa/pipe/p_defines.h @@ -115,10 +115,12 @@ #define PIPE_STENCIL_OP_INVERT 7 /** Texture types */ -#define PIPE_TEXTURE_1D 0 -#define PIPE_TEXTURE_2D 1 -#define PIPE_TEXTURE_3D 2 -#define PIPE_TEXTURE_CUBE 3 +enum pipe_texture_target { + PIPE_TEXTURE_1D = 0, + PIPE_TEXTURE_2D = 1, + PIPE_TEXTURE_3D = 2, + PIPE_TEXTURE_CUBE = 3 +}; #define PIPE_TEX_FACE_POS_X 0 #define PIPE_TEX_FACE_NEG_X 1 diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h index 16d50fdb82..76e633e930 100644 --- a/src/mesa/pipe/p_state.h +++ b/src/mesa/pipe/p_state.h @@ -39,6 +39,7 @@ #define PIPE_STATE_H #include "p_compiler.h" +#include "p_defines.h" #include "p_format.h" /** @@ -262,8 +263,8 @@ struct pipe_texture { /* Effectively the key: */ - unsigned target; /**< PIPE_TEXTURE_x */ - enum pipe_format format; /**< PIPE_FORMAT_x */ + enum pipe_texture_target target; /**< PIPE_TEXTURE_x */ + enum pipe_format format; /**< PIPE_FORMAT_x */ unsigned first_level; unsigned last_level; |