From 15000c79da7c083a9306d53dae04afd6584e06e0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 1 Jul 2019 15:01:19 -0700 Subject: [PATCH] nir: Add Panfrost-specific blending intrinsic This gives more flexibility than the normal store_deref/store_output versions (particularly, it allows us to abuse the type system in awful ways, which is necessary for efficient format conversion in blend shaders.) Signed-off-by: Alyssa Rosenzweig Acked-by: Karol Herbst --- src/compiler/nir/nir_intrinsics.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index e4f94257acd..0fd8a30eb4d 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -760,3 +760,19 @@ intrinsic("ssbo_atomic_or_ir3", src_comp=[1, 1, 1, 1], dest_comp=1) intrinsic("ssbo_atomic_xor_ir3", src_comp=[1, 1, 1, 1], dest_comp=1) intrinsic("ssbo_atomic_exchange_ir3", src_comp=[1, 1, 1, 1], dest_comp=1) intrinsic("ssbo_atomic_comp_swap_ir3", src_comp=[1, 1, 1, 1, 1], dest_comp=1) + +# Intrinsics used by the Midgard/Bifrost blend pipeline. These are defined +# within a blend shader to read/write the raw value from the tile buffer, +# without applying any format conversion in the process. If the shader needs +# usable pixel values, it must apply format conversions itself. +# +# These definitions are generic, but they are explicitly vendored to prevent +# other drivers from using them, as their semantics is defined in terms of the +# Midgard/Bifrost hardware tile buffer and may not line up with anything sane. +# One notable divergence is sRGB, which is asymmetric: raw_input_pan requires +# an sRGB->linear conversion, but linear values should be written to +# raw_output_pan and the hardware handles linear->sRGB. + +# src[] = { value } +store("raw_output_pan", 1, []) +load("raw_output_pan", 0, [], [CAN_ELIMINATE, CAN_REORDER]) -- 2.30.2