From bd06a26662345897a15efa6cf5c709242cccfeed Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 23 Feb 2022 13:47:37 -0500 Subject: [PATCH] panfrost: Add an unpacked message preload struct The compiler will soon produce preloaded messages, but it should not pack them itself, as this would require depending on GenXML or handcoding bitfields / bit packs in the compiler. Instead, add a struct encoding the unpacked form of the message, used as ABI between the compiler and the common driver. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/util/pan_ir.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 946ae7b..5cc2684 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -186,6 +186,33 @@ struct bifrost_shader_blend_info { unsigned format; }; +/* + * Unpacked form of a v7 message preload descriptor, produced by the compiler's + * message preload optimization. By splitting out this struct, the compiler does + * not need to know about data structure packing, avoiding a dependency on + * GenXML. + */ +struct bifrost_message_preload { + /* Whether to preload this message */ + bool enabled; + + /* Varying to load from */ + unsigned varying_index; + + /* Register type, FP32 otherwise */ + bool fp16; + + /* Number of components, ignored if texturing */ + unsigned num_components; + + /* If texture is set, performs a texture instruction according to + * sampler_index, skip, and zero_lod. If texture is unset, only the + * varying load is performed. + */ + bool texture, skip, zero_lod; + unsigned sampler_index; +}; + struct bifrost_shader_info { struct bifrost_shader_blend_info blend[8]; nir_alu_type blend_src1_type; -- 2.7.4