From: Boris Brezillon Date: Mon, 25 Jan 2021 12:53:32 +0000 (+0100) Subject: panfrost: Move pan_special_varying definition to pan_encoder.h X-Git-Tag: upstream/21.2.3~6742 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0113a0a1eed3aa23d3f4a9a95d90cb302608cfb5;p=platform%2Fupstream%2Fmesa.git panfrost: Move pan_special_varying definition to pan_encoder.h Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 24926bb..aeffdf2 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1762,30 +1762,6 @@ pan_varying_size(enum mali_format fmt) return bpc * chan; } -/* Indices for named (non-XFB) varyings that are present. These are packed - * tightly so they correspond to a bitfield present (P) indexed by (1 << - * PAN_VARY_*). This has the nice property that you can lookup the buffer index - * of a given special field given a shift S by: - * - * idx = popcount(P & ((1 << S) - 1)) - * - * That is... look at all of the varyings that come earlier and count them, the - * count is the new index since plus one. Likewise, the total number of special - * buffers required is simply popcount(P) - */ - -enum pan_special_varying { - PAN_VARY_GENERAL = 0, - PAN_VARY_POSITION = 1, - PAN_VARY_PSIZ = 2, - PAN_VARY_PNTCOORD = 3, - PAN_VARY_FACE = 4, - PAN_VARY_FRAGCOORD = 5, - - /* Keep last */ - PAN_VARY_MAX, -}; - /* Given a varying, figure out which index it corresponds to */ static inline unsigned diff --git a/src/panfrost/lib/pan_encoder.h b/src/panfrost/lib/pan_encoder.h index 99971d2..7c26b13 100644 --- a/src/panfrost/lib/pan_encoder.h +++ b/src/panfrost/lib/pan_encoder.h @@ -30,6 +30,30 @@ #include #include "midgard_pack.h" +/* Indices for named (non-XFB) varyings that are present. These are packed + * tightly so they correspond to a bitfield present (P) indexed by (1 << + * PAN_VARY_*). This has the nice property that you can lookup the buffer index + * of a given special field given a shift S by: + * + * idx = popcount(P & ((1 << S) - 1)) + * + * That is... look at all of the varyings that come earlier and count them, the + * count is the new index since plus one. Likewise, the total number of special + * buffers required is simply popcount(P) + */ + +enum pan_special_varying { + PAN_VARY_GENERAL = 0, + PAN_VARY_POSITION = 1, + PAN_VARY_PSIZ = 2, + PAN_VARY_PNTCOORD = 3, + PAN_VARY_FACE = 4, + PAN_VARY_FRAGCOORD = 5, + + /* Keep last */ + PAN_VARY_MAX, +}; + /* Invocation packing */ void