diff options
author | Marek Olšák <[email protected]> | 2012-07-08 15:58:19 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-12 02:08:30 +0200 |
commit | 2dca61bcb357d70be2bb4f2d28321dfc5fc10c69 (patch) | |
tree | 3f7dbc2106d24303602c9082d6c73a8c11bd5fe7 /src/gallium/auxiliary/util/u_inlines.h | |
parent | bdaf0a085ba7b8af4cf858b31f701caf571b7c4f (diff) |
gallium/util: move pipe_tex_to_tgsi_tex helper function into u_inlines
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_inlines.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 2ec153c5823..2d603e4ddf6 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -30,6 +30,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" +#include "pipe/p_shader_tokens.h" #include "pipe/p_state.h" #include "pipe/p_screen.h" #include "util/u_debug.h" @@ -545,6 +546,31 @@ util_query_clear_result(union pipe_query_result *result, unsigned type) } } +/** Convert PIPE_TEXTURE_x to TGSI_TEXTURE_x */ +static INLINE unsigned +util_pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target) +{ + switch (pipe_tex_target) { + case PIPE_TEXTURE_1D: + return TGSI_TEXTURE_1D; + case PIPE_TEXTURE_2D: + return TGSI_TEXTURE_2D; + case PIPE_TEXTURE_RECT: + return TGSI_TEXTURE_RECT; + case PIPE_TEXTURE_3D: + return TGSI_TEXTURE_3D; + case PIPE_TEXTURE_CUBE: + return TGSI_TEXTURE_CUBE; + case PIPE_TEXTURE_1D_ARRAY: + return TGSI_TEXTURE_1D_ARRAY; + case PIPE_TEXTURE_2D_ARRAY: + return TGSI_TEXTURE_2D_ARRAY; + default: + assert(0 && "unexpected texture target"); + return TGSI_TEXTURE_UNKNOWN; + } +} + #ifdef __cplusplus } #endif |