Commit Graph

7 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 1d2c1b8bd6 pan/mdg: Use nir_lower_helper_writes
It's now in common code, drop our (buggier) copy.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21413>
2023-03-04 13:31:05 -05:00
Alyssa Rosenzweig 10759d1708 pan/mdg: Use special NIR ops for trig scaling
Otherwise the lowering is fundamentally unsound due to incorrect constant
folding, even though it worked by chance with the old pass ordering. We're about
to change slightly the way we handle fsin/fcos, which was enough to trigger this
unsoundness.

shader-db results are mostly a toss-up.

total instructions in shared programs: 1520675 -> 1520220 (-0.03%)
instructions in affected programs: 96841 -> 96386 (-0.47%)
helped: 397
HURT: 3
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.15 x̃: 1
helped stats (rel) min: 0.22% max: 6.25% x̄: 1.15% x̃: 0.40%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.58% max: 2.08% x̄: 1.08% x̃: 0.58%
95% mean confidence interval for instructions value: -1.19 -1.08
95% mean confidence interval for instructions %-change: -1.26% -1.01%
Instructions are helped.

total bundles in shared programs: 650088 -> 649844 (-0.04%)
bundles in affected programs: 31132 -> 30888 (-0.78%)
helped: 229
HURT: 23
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.21 x̃: 1
helped stats (rel) min: 0.49% max: 7.14% x̄: 1.28% x̃: 0.71%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.48 x̃: 1
HURT stats (rel)   min: 0.83% max: 8.33% x̄: 2.38% x̃: 1.85%
95% mean confidence interval for bundles value: -1.08 -0.86
95% mean confidence interval for bundles %-change: -1.15% -0.74%
Bundles are helped.

total quadwords in shared programs: 1137388 -> 1136767 (-0.05%)
quadwords in affected programs: 71826 -> 71205 (-0.86%)
helped: 367
HURT: 17
helped stats (abs) min: 1.0 max: 8.0 x̄: 1.80 x̃: 1
helped stats (rel) min: 0.31% max: 17.24% x̄: 2.27% x̃: 0.96%
HURT stats (abs)   min: 1.0 max: 6.0 x̄: 2.29 x̃: 2
HURT stats (rel)   min: 0.44% max: 11.11% x̄: 2.18% x̃: 1.47%
95% mean confidence interval for quadwords value: -1.76 -1.47
95% mean confidence interval for quadwords %-change: -2.36% -1.78%
Quadwords are helped.

total registers in shared programs: 90483 -> 90461 (-0.02%)
registers in affected programs: 890 -> 868 (-2.47%)
helped: 67
HURT: 44
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 8.33% max: 25.00% x̄: 10.52% x̃: 9.09%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.02 x̃: 1
HURT stats (rel)   min: 9.09% max: 50.00% x̄: 31.15% x̃: 33.33%
95% mean confidence interval for registers value: -0.39 -0.01
95% mean confidence interval for registers %-change: 1.75% 10.25%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total threads in shared programs: 55694 -> 55685 (-0.02%)
threads in affected programs: 21 -> 12 (-42.86%)
helped: 1
HURT: 5
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -2.79 -0.21
95% mean confidence interval for threads %-change: -89.26% 39.26%
Inconclusive result (%-change mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig 1079d7ccd6 pan/mdg: Lower stores from helpers
Required for correct behaviour of SSBOs in fragment shaders on Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Italo Nicola db725e1d52 pan/mdg: create nir pass to lower image coord bitsize
Image coordinates are 16-bit long in midgard, so we must lower them
before emitting image opcodes.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8066>
2021-01-27 12:39:41 +00:00
Alyssa Rosenzweig c495c6c295 pan/mdg: Add pack_unorm_4x8 via 8-bit
More efficient than the 32-bit version in NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5265>
2020-06-01 15:46:23 +00:00
Alyssa Rosenzweig 449e5ded93 pan/mdg: Treat inot as a modifier
With this, we may remove all invert passes and simply look at the src
modifier on NIR->MIR and fixup at pack time. No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5102>
2020-05-19 20:21:28 +00:00
Alyssa Rosenzweig ec2a59cd7a panfrost: Move non-Gallium files outside of Gallium
In preparation for a Panfrost-based non-Gallium driver (maybe
Vulkan...?), hoist everything except for the Gallium driver into a
shared src/panfrost. Practically, that means the compilers, the headers,
and pandecode.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Renamed from src/gallium/drivers/panfrost/midgard/midgard_nir.h (Browse further)