mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
gallium/aux: move util_pipe_tex_to_tgsi_tex to u_blitter.c
This is the only place this is called from, and this allows us to avoid a TGSI specific include from generic code. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34954>
This commit is contained in:
parent
d2ac44dfde
commit
20986b77f3
10 changed files with 54 additions and 47 deletions
|
|
@ -934,6 +934,51 @@ static void set_texcoords_in_vertices(const struct blitter_attrib *attrib,
|
|||
out[1] = attrib->texcoord.y2;
|
||||
}
|
||||
|
||||
/** Convert PIPE_TEXTURE_x to TGSI_TEXTURE_x */
|
||||
static inline enum tgsi_texture_type
|
||||
util_pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target,
|
||||
unsigned nr_samples)
|
||||
{
|
||||
switch (pipe_tex_target) {
|
||||
case PIPE_BUFFER:
|
||||
return TGSI_TEXTURE_BUFFER;
|
||||
|
||||
case PIPE_TEXTURE_1D:
|
||||
assert(nr_samples <= 1);
|
||||
return TGSI_TEXTURE_1D;
|
||||
|
||||
case PIPE_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 nr_samples > 1 ? TGSI_TEXTURE_2D_ARRAY_MSAA :
|
||||
TGSI_TEXTURE_2D_ARRAY;
|
||||
|
||||
case PIPE_TEXTURE_CUBE_ARRAY:
|
||||
return TGSI_TEXTURE_CUBE_ARRAY;
|
||||
|
||||
default:
|
||||
assert(0 && "unexpected texture target");
|
||||
return TGSI_TEXTURE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
static void *blitter_get_fs_texfetch_col(struct blitter_context_priv *ctx,
|
||||
enum pipe_format src_format,
|
||||
enum pipe_format dst_format,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#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/compiler.h"
|
||||
|
|
@ -788,52 +787,6 @@ util_query_clear_result(union pipe_query_result *result, unsigned type)
|
|||
}
|
||||
}
|
||||
|
||||
/** Convert PIPE_TEXTURE_x to TGSI_TEXTURE_x */
|
||||
static inline enum tgsi_texture_type
|
||||
util_pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target,
|
||||
unsigned nr_samples)
|
||||
{
|
||||
switch (pipe_tex_target) {
|
||||
case PIPE_BUFFER:
|
||||
return TGSI_TEXTURE_BUFFER;
|
||||
|
||||
case PIPE_TEXTURE_1D:
|
||||
assert(nr_samples <= 1);
|
||||
return TGSI_TEXTURE_1D;
|
||||
|
||||
case PIPE_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 nr_samples > 1 ? TGSI_TEXTURE_2D_ARRAY_MSAA :
|
||||
TGSI_TEXTURE_2D_ARRAY;
|
||||
|
||||
case PIPE_TEXTURE_CUBE_ARRAY:
|
||||
return TGSI_TEXTURE_CUBE_ARRAY;
|
||||
|
||||
default:
|
||||
assert(0 && "unexpected texture target");
|
||||
return TGSI_TEXTURE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
util_copy_constant_buffer(struct pipe_constant_buffer *dst,
|
||||
const struct pipe_constant_buffer *src,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
#include "compiler/nir/nir.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
#include "pipe/p_state.h"
|
||||
#include "util/u_inlines.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "nir/pipe_nir.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_pack_color.h"
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "nir/pipe_nir.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
#include "compiler/nir/nir.h"
|
||||
#include "compiler/nir/nir_builder.h"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "si_pipe.h"
|
||||
#include "si_shader_internal.h"
|
||||
#include "util/mesa-sha1.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
#include "sid.h"
|
||||
#include "nir.h"
|
||||
#include "nir_tcs_info.h"
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "util/format/u_format.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
#include "svga_winsys.h"
|
||||
#include "svga_screen.h"
|
||||
#include "svga_format.h"
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
#include "cso_cache/cso_context.h"
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/u_inlines.h"
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include "nv50_ir_target_nv50.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
namespace nv50_ir {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue