diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-12-20 13:48:24 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-12-24 23:46:23 +0000 |
commit | 1bce7fdecd86601a300be9a58a346b8c110d9587 (patch) | |
tree | 315f15619e9693211b43fa9bbd1a1a159720a2b5 /src/panfrost/midgard/midgard.h | |
parent | 4ec1f95d76b476dd602dca41e5a1065a2c0d6135 (diff) |
pan/midgard: Do witchcraft on texture offsets
My latest divination spell has uncovered a pattern in the aether.
Although the swizzle is unaligned, its format is otherwise standard.
Document this, removing the old incorrect understanding of the swizzle
(which coincided on common special swizzles only).
Fixes dEQP-GLES3.functional.shaders.texture_functions.texelfetchoffset.sampler2d_fixed_fragment
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/midgard.h')
-rw-r--r-- | src/panfrost/midgard/midgard.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h index ea026621db3..807f8f1ede9 100644 --- a/src/panfrost/midgard/midgard.h +++ b/src/panfrost/midgard/midgard.h @@ -691,16 +691,30 @@ __attribute__((__packed__)) /* In immediate mode, each offset field is an immediate range [0, 7]. * * In register mode, offset_x becomes a register full / select / upper - * triplet and a vec3 swizzle is splattered across offset_y/offset_z in - * a genuinely bizarre way. + * triplet followed by a vec3 swizzle is splattered across + * offset_y/offset_z in a genuinely bizarre way. * * For texel fetches in immediate mode, the range is the full [-8, 7], * but for normal texturing the top bit must be zero and a register - * used instead. It's not clear where this limitation is from. */ + * used instead. It's not clear where this limitation is from. + * + * union { + * struct { + * signed offset_x : 4; + * signed offset_y : 4; + * signed offset_z : 4; + * } immediate; + * struct { + * bool full : 1; + * bool select : 1; + * bool upper : 1; + * unsigned swizzle : 8; + * unsigned zero : 1; + * } register; + * } + */ - signed offset_x : 4; - signed offset_y : 4; - signed offset_z : 4; + unsigned offset : 12; /* In immediate bias mode, for a normal texture op, this is * texture bias, computed as int(2^8 * frac(biasf)), with |