summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_inlines.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 2d603e4ddf6..a1ece415f46 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/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;