mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 18:30:09 +01:00
gallium/u_blitter: remove unused code for integer MSAA resolve
GL doesn't have it. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17692>
This commit is contained in:
parent
fd7a968c36
commit
2057516922
3 changed files with 14 additions and 43 deletions
|
|
@ -1032,13 +1032,11 @@ static void *blitter_get_fs_texfetch_col(struct blitter_context_priv *ctx,
|
|||
assert(!ctx->cached_all_shaders);
|
||||
if (filter == PIPE_TEX_FILTER_LINEAR) {
|
||||
*shader = util_make_fs_msaa_resolve_bilinear(pipe, tgsi_tex,
|
||||
src_nr_samples,
|
||||
stype);
|
||||
src_nr_samples);
|
||||
}
|
||||
else {
|
||||
*shader = util_make_fs_msaa_resolve(pipe, tgsi_tex,
|
||||
src_nr_samples,
|
||||
stype);
|
||||
src_nr_samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -708,8 +708,7 @@ util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
|
|||
|
||||
void *
|
||||
util_make_fs_msaa_resolve(struct pipe_context *pipe,
|
||||
enum tgsi_texture_type tgsi_tex, unsigned nr_samples,
|
||||
enum tgsi_return_type stype)
|
||||
enum tgsi_texture_type tgsi_tex, unsigned nr_samples)
|
||||
{
|
||||
struct ureg_program *ureg;
|
||||
struct ureg_src sampler, coord;
|
||||
|
|
@ -722,7 +721,9 @@ util_make_fs_msaa_resolve(struct pipe_context *pipe,
|
|||
|
||||
/* Declarations. */
|
||||
sampler = ureg_DECL_sampler(ureg, 0);
|
||||
ureg_DECL_sampler_view(ureg, 0, tgsi_tex, stype, stype, stype, stype);
|
||||
ureg_DECL_sampler_view(ureg, 0, tgsi_tex,
|
||||
TGSI_RETURN_TYPE_FLOAT, TGSI_RETURN_TYPE_FLOAT,
|
||||
TGSI_RETURN_TYPE_FLOAT, TGSI_RETURN_TYPE_FLOAT);
|
||||
coord = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_GENERIC, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0);
|
||||
|
|
@ -740,26 +741,13 @@ util_make_fs_msaa_resolve(struct pipe_context *pipe,
|
|||
ureg_imm1u(ureg, i));
|
||||
ureg_TXF(ureg, tmp, tgsi_tex, ureg_src(tmp_coord), sampler);
|
||||
|
||||
if (stype == TGSI_RETURN_TYPE_UINT)
|
||||
ureg_U2F(ureg, tmp, ureg_src(tmp));
|
||||
else if (stype == TGSI_RETURN_TYPE_SINT)
|
||||
ureg_I2F(ureg, tmp, ureg_src(tmp));
|
||||
|
||||
/* Add it to the sum.*/
|
||||
ureg_ADD(ureg, tmp_sum, ureg_src(tmp_sum), ureg_src(tmp));
|
||||
}
|
||||
|
||||
/* Calculate the average and return. */
|
||||
ureg_MUL(ureg, tmp_sum, ureg_src(tmp_sum),
|
||||
ureg_MUL(ureg, out, ureg_src(tmp_sum),
|
||||
ureg_imm1f(ureg, 1.0 / nr_samples));
|
||||
|
||||
if (stype == TGSI_RETURN_TYPE_UINT)
|
||||
ureg_F2U(ureg, out, ureg_src(tmp_sum));
|
||||
else if (stype == TGSI_RETURN_TYPE_SINT)
|
||||
ureg_F2I(ureg, out, ureg_src(tmp_sum));
|
||||
else
|
||||
ureg_MOV(ureg, out, ureg_src(tmp_sum));
|
||||
|
||||
ureg_END(ureg);
|
||||
|
||||
return ureg_create_shader_and_destroy(ureg, pipe);
|
||||
|
|
@ -769,8 +757,7 @@ util_make_fs_msaa_resolve(struct pipe_context *pipe,
|
|||
void *
|
||||
util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
|
||||
enum tgsi_texture_type tgsi_tex,
|
||||
unsigned nr_samples,
|
||||
enum tgsi_return_type stype)
|
||||
unsigned nr_samples)
|
||||
{
|
||||
struct ureg_program *ureg;
|
||||
struct ureg_src sampler, coord;
|
||||
|
|
@ -784,7 +771,9 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
|
|||
|
||||
/* Declarations. */
|
||||
sampler = ureg_DECL_sampler(ureg, 0);
|
||||
ureg_DECL_sampler_view(ureg, 0, tgsi_tex, stype, stype, stype, stype);
|
||||
ureg_DECL_sampler_view(ureg, 0, tgsi_tex,
|
||||
TGSI_RETURN_TYPE_FLOAT, TGSI_RETURN_TYPE_FLOAT,
|
||||
TGSI_RETURN_TYPE_FLOAT, TGSI_RETURN_TYPE_FLOAT);
|
||||
coord = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_GENERIC, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0);
|
||||
|
|
@ -816,11 +805,6 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
|
|||
ureg_imm1u(ureg, i));
|
||||
ureg_TXF(ureg, tmp, tgsi_tex, ureg_src(tmp_coord[c]), sampler);
|
||||
|
||||
if (stype == TGSI_RETURN_TYPE_UINT)
|
||||
ureg_U2F(ureg, tmp, ureg_src(tmp));
|
||||
else if (stype == TGSI_RETURN_TYPE_SINT)
|
||||
ureg_I2F(ureg, tmp, ureg_src(tmp));
|
||||
|
||||
/* Add it to the sum.*/
|
||||
ureg_ADD(ureg, tmp_sum[c], ureg_src(tmp_sum[c]), ureg_src(tmp));
|
||||
}
|
||||
|
|
@ -844,19 +828,10 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
|
|||
ureg_src(tmp_sum[3]),
|
||||
ureg_src(tmp_sum[2]));
|
||||
|
||||
ureg_LRP(ureg, tmp,
|
||||
ureg_LRP(ureg, out,
|
||||
ureg_scalar(ureg_src(tmp), 1),
|
||||
ureg_src(bottom),
|
||||
ureg_src(top));
|
||||
|
||||
/* Convert to the texture format and return. */
|
||||
if (stype == TGSI_RETURN_TYPE_UINT)
|
||||
ureg_F2U(ureg, out, ureg_src(tmp));
|
||||
else if (stype == TGSI_RETURN_TYPE_SINT)
|
||||
ureg_F2I(ureg, out, ureg_src(tmp));
|
||||
else
|
||||
ureg_MOV(ureg, out, ureg_src(tmp));
|
||||
|
||||
ureg_END(ureg);
|
||||
|
||||
return ureg_create_shader_and_destroy(ureg, pipe);
|
||||
|
|
|
|||
|
|
@ -141,15 +141,13 @@ util_make_fs_blit_msaa_stencil(struct pipe_context *pipe,
|
|||
|
||||
void *
|
||||
util_make_fs_msaa_resolve(struct pipe_context *pipe,
|
||||
enum tgsi_texture_type tgsi_tex, unsigned nr_samples,
|
||||
enum tgsi_return_type stype);
|
||||
enum tgsi_texture_type tgsi_tex, unsigned nr_samples);
|
||||
|
||||
|
||||
void *
|
||||
util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
|
||||
enum tgsi_texture_type tgsi_tex,
|
||||
unsigned nr_samples,
|
||||
enum tgsi_return_type stype);
|
||||
unsigned nr_samples);
|
||||
|
||||
extern void *
|
||||
util_make_geometry_passthrough_shader(struct pipe_context *pipe,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue