panfrost: Simplify format_to_bifrost_blend prototype
Avoids a util_format_description call in a hot path, and drops some indirection everywhere. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10188>
This commit is contained in:
committed by
Marge Bot
parent
86e895c429
commit
0f2140df8e
@@ -358,7 +358,7 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch,
|
||||
*/
|
||||
cfg.bifrost.internal.fixed_function.num_comps = 4;
|
||||
cfg.bifrost.internal.fixed_function.conversion.memory_format =
|
||||
panfrost_format_to_bifrost_blend(dev, format_desc, true);
|
||||
panfrost_format_to_bifrost_blend(dev, format, true);
|
||||
cfg.bifrost.internal.fixed_function.conversion.register_format =
|
||||
bifrost_blend_type_from_nir(fs->info.bifrost.blend[i].type);
|
||||
cfg.bifrost.internal.fixed_function.rt = i;
|
||||
|
||||
@@ -614,7 +614,7 @@ pan_blend_get_bifrost_desc(const struct panfrost_device *dev,
|
||||
}
|
||||
|
||||
cfg.fixed_function.conversion.memory_format =
|
||||
panfrost_format_to_bifrost_blend(dev, desc, true);
|
||||
panfrost_format_to_bifrost_blend(dev, fmt, true);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -248,9 +248,6 @@ pan_blitter_emit_bifrost_blend(const struct panfrost_device *dev,
|
||||
blit_shader->blend_ret_offsets[rt];
|
||||
}
|
||||
} else {
|
||||
const struct util_format_description *format_desc =
|
||||
util_format_description(iview->format);
|
||||
|
||||
cfg.bifrost.equation.rgb.a = MALI_BLEND_OPERAND_A_SRC;
|
||||
cfg.bifrost.equation.rgb.b = MALI_BLEND_OPERAND_B_SRC;
|
||||
cfg.bifrost.equation.rgb.c = MALI_BLEND_OPERAND_C_ZERO;
|
||||
@@ -260,7 +257,7 @@ pan_blitter_emit_bifrost_blend(const struct panfrost_device *dev,
|
||||
cfg.bifrost.equation.color_mask = 0xf;
|
||||
cfg.bifrost.internal.fixed_function.num_comps = 4;
|
||||
cfg.bifrost.internal.fixed_function.conversion.memory_format =
|
||||
panfrost_format_to_bifrost_blend(dev, format_desc, true);
|
||||
panfrost_format_to_bifrost_blend(dev, iview->format, true);
|
||||
cfg.bifrost.internal.fixed_function.conversion.register_format =
|
||||
blit_type_to_reg_fmt(type);
|
||||
|
||||
|
||||
@@ -699,13 +699,13 @@ panfrost_invert_swizzle(const unsigned char *in, unsigned char *out)
|
||||
|
||||
unsigned
|
||||
panfrost_format_to_bifrost_blend(const struct panfrost_device *dev,
|
||||
const struct util_format_description *desc, bool dither)
|
||||
enum pipe_format format, bool dither)
|
||||
{
|
||||
struct pan_blendable_format fmt = panfrost_blendable_formats[desc->format];
|
||||
struct pan_blendable_format fmt = panfrost_blendable_formats[format];
|
||||
|
||||
/* Formats requiring blend shaders are stored raw in the tilebuffer */
|
||||
if (!fmt.internal)
|
||||
return dev->formats[desc->format].hw;
|
||||
return dev->formats[format].hw;
|
||||
|
||||
unsigned extra = 0;
|
||||
|
||||
|
||||
@@ -254,8 +254,7 @@ panfrost_bifrost_swizzle(unsigned components)
|
||||
|
||||
unsigned
|
||||
panfrost_format_to_bifrost_blend(const struct panfrost_device *dev,
|
||||
const struct util_format_description *desc,
|
||||
bool dither);
|
||||
enum pipe_format format, bool dither);
|
||||
|
||||
struct pan_pool;
|
||||
struct pan_scoreboard;
|
||||
|
||||
Reference in New Issue
Block a user