diff options
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_inlines.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h index 2d603e4dd..a1ece415f 100644 --- a/mesalib/src/gallium/auxiliary/util/u_inlines.h +++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h @@ -548,23 +548,37 @@ 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) +util_pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target, + unsigned nr_samples) { switch (pipe_tex_target) { case PIPE_TEXTURE_1D: + assert(nr_samples <= 1); return TGSI_TEXTURE_1D; + case PIPE_TEXTURE_2D: - return TGSI_TEXTURE_2D; + return nr_samples > 1 ? TGSI_TEXTURE_2D_MSAA : TGSI_TEXTURE_2D; + case PIPE_TEXTURE_RECT: + assert(nr_samples <= 1); return TGSI_TEXTURE_RECT; + case PIPE_TEXTURE_3D: + assert(nr_samples <= 1); return TGSI_TEXTURE_3D; + case PIPE_TEXTURE_CUBE: + assert(nr_samples <= 1); return TGSI_TEXTURE_CUBE; + case PIPE_TEXTURE_1D_ARRAY: + assert(nr_samples <= 1); return TGSI_TEXTURE_1D_ARRAY; + case PIPE_TEXTURE_2D_ARRAY: - return TGSI_TEXTURE_2D_ARRAY; + return nr_samples > 1 ? TGSI_TEXTURE_2D_ARRAY_MSAA : + TGSI_TEXTURE_2D_ARRAY; + default: assert(0 && "unexpected texture target"); return TGSI_TEXTURE_UNKNOWN; |