[Mesa-dev] [PATCH 1/6] gallium/util: replace unsigned with tgsi enum types
Roland Scheidegger
sroland at vmware.com
Wed Feb 7 16:14:49 UTC 2018
Am 07.02.2018 um 06:30 schrieb Brian Paul:
> ---
> src/gallium/auxiliary/util/u_simple_shaders.c | 36 ++++++++++++++-------------
> src/gallium/auxiliary/util/u_simple_shaders.h | 29 ++++++++++-----------
> 2 files changed, 34 insertions(+), 31 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c
> index 9679545..09491f4 100644
> --- a/src/gallium/auxiliary/util/u_simple_shaders.c
> +++ b/src/gallium/auxiliary/util/u_simple_shaders.c
> @@ -202,7 +202,8 @@ void *util_make_layered_clear_geometry_shader(struct pipe_context *pipe)
> static void
> ureg_load_tex(struct ureg_program *ureg, struct ureg_dst out,
> struct ureg_src coord, struct ureg_src sampler,
> - unsigned tex_target, bool load_level_zero, bool use_txf)
> + enum tgsi_texture_type tex_target,
> + bool load_level_zero, bool use_txf)
> {
> if (use_txf) {
> struct ureg_dst temp = ureg_DECL_temporary(ureg);
> @@ -230,14 +231,14 @@ ureg_load_tex(struct ureg_program *ureg, struct ureg_dst out,
> * MOV OUT[0], TEMP[0]
> * END;
> *
> - * \param tex_target one of PIPE_TEXTURE_x
> + * \param tex_target one of TGSI_TEXTURE_x
> * \parma interp_mode either TGSI_INTERPOLATE_LINEAR or PERSPECTIVE
> * \param writemask mask of TGSI_WRITEMASK_x
> */
> void *
> util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> unsigned writemask,
> enum tgsi_return_type stype,
> enum tgsi_return_type dtype,
> @@ -310,11 +311,12 @@ util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
> /**
> * Make a simple fragment shader that sets the output color to a color
> * taken from a texture.
> - * \param tex_target one of PIPE_TEXTURE_x
> + * \param tex_target one of TGSI_TEXTURE_x
> */
> void *
> -util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target,
> - unsigned interp_mode,
> +util_make_fragment_tex_shader(struct pipe_context *pipe,
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> enum tgsi_return_type stype,
> enum tgsi_return_type dtype,
> bool load_level_zero,
> @@ -335,8 +337,8 @@ util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target,
> */
> void *
> util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> bool load_level_zero,
> bool use_txf)
> {
> @@ -388,10 +390,10 @@ util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe,
> */
> void *
> util_make_fragment_tex_shader_writedepthstencil(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> - bool load_level_zero,
> - bool use_txf)
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> + bool load_level_zero,
> + bool use_txf)
Here and below, indentation?
Albeit those names are really long, hence the params not fitting into 80
chars...
In any case,
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
> {
> struct ureg_program *ureg;
> struct ureg_src depth_sampler, stencil_sampler;
> @@ -452,10 +454,10 @@ util_make_fragment_tex_shader_writedepthstencil(struct pipe_context *pipe,
> */
> void *
> util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> - bool load_level_zero,
> - bool use_txf)
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> + bool load_level_zero,
> + bool use_txf)
> {
> struct ureg_program *ureg;
> struct ureg_src stencil_sampler;
> diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h b/src/gallium/auxiliary/util/u_simple_shaders.h
> index a281f57..5c22246 100644
> --- a/src/gallium/auxiliary/util/u_simple_shaders.h
> +++ b/src/gallium/auxiliary/util/u_simple_shaders.h
> @@ -70,8 +70,8 @@ util_make_layered_clear_geometry_shader(struct pipe_context *pipe);
>
> extern void *
> util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> unsigned writemask,
> enum tgsi_return_type stype,
> enum tgsi_return_type dtype,
> @@ -79,8 +79,9 @@ util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
> bool use_txf);
>
> extern void *
> -util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target,
> - unsigned interp_mode,
> +util_make_fragment_tex_shader(struct pipe_context *pipe,
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> enum tgsi_return_type stype,
> enum tgsi_return_type dtype,
> bool load_level_zero,
> @@ -88,26 +89,26 @@ util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target,
>
> extern void *
> util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> bool load_level_zero,
> bool use_txf);
>
>
> extern void *
> util_make_fragment_tex_shader_writedepthstencil(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> - bool load_level_zero,
> - bool use_txf);
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> + bool load_level_zero,
> + bool use_txf);
>
>
> extern void *
> util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
> - unsigned tex_target,
> - unsigned interp_mode,
> - bool load_level_zero,
> - bool use_txf);
> + enum tgsi_texture_type tex_target,
> + enum tgsi_interpolate_mode interp_mode,
> + bool load_level_zero,
> + bool use_txf);
>
>
> extern void *
>
More information about the mesa-dev
mailing list