panfrost: Export bifrost_get_blend_desc with type size

Will be used to lower EXT_shader_framebuffer_fetch on Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>
This commit is contained in:
Alyssa Rosenzweig 2021-02-16 18:10:43 -05:00 committed by Marge Bot
parent 9d2b2e3c67
commit 7dc60fc3c8
2 changed files with 11 additions and 3 deletions

View file

@ -95,9 +95,9 @@ panfrost_create_blend_shader(struct panfrost_context *ctx,
return res;
}
static uint64_t
uint64_t
bifrost_get_blend_desc(const struct panfrost_device *dev,
enum pipe_format fmt, unsigned rt)
enum pipe_format fmt, unsigned rt, unsigned force_size)
{
const struct util_format_description *desc = util_format_description(fmt);
uint64_t res;
@ -108,6 +108,10 @@ bifrost_get_blend_desc(const struct panfrost_device *dev,
cfg.fixed_function.rt = rt;
nir_alu_type T = pan_unpacked_type_for_format(desc);
if (force_size)
T = nir_alu_type_get_base_type(T) | force_size;
switch (T) {
case nir_type_float16:
cfg.fixed_function.conversion.register_format =
@ -175,7 +179,7 @@ panfrost_compile_blend_shader(struct panfrost_blend_shader *shader,
if (pan_is_bifrost(dev)) {
inputs.blend.bifrost_blend_desc =
bifrost_get_blend_desc(dev, shader->key.format, shader->key.rt);
bifrost_get_blend_desc(dev, shader->key.format, shader->key.rt, 0);
}
struct pan_shader_info info;

View file

@ -40,4 +40,8 @@ void
panfrost_compile_blend_shader(struct panfrost_blend_shader *shader,
const float *constants);
uint64_t
bifrost_get_blend_desc(const struct panfrost_device *dev,
enum pipe_format fmt, unsigned rt, unsigned force_size);
#endif