Alyssa Rosenzweig
0a5ca3f34f
asahi: Use finer dirty tracking for blend constant
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
d6ca887f90
asahi: Decouple sysval lowering from uniform assignment
...
For merging shader states, we'll need to lower sysvals separately for each
shader but assign uniforms together for the final merged shader. The easiest way
to do that is to decouple the lowering of sysvals to driver uniform reads, from
the assignment of driver uniform reads to actual uniform registers.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
17563210d4
asahi: Put unuploaded uniforms on the batch
...
Less copying needed this way.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
871d97f7d0
asahi: Extract sampler upload
...
Dirty track it.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
9fa5dec767
asahi: Add real per-stage dirty flags
...
Instead of just using ~0 as a stub todo.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
9a60478966
asahi: Upload a single draw_uniforms per draw
...
Not per stage per draw. This is less frequent.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
4717b08f78
asahi: Extract agx_upload_textures
...
By uploading textures ahead-of-time, we can upload uniforms ahead-of-time too.
This will also allow some overhead shaving optimizations, I guess.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
0e6cb6d893
asahi: Collapse grid_info
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
b049b1c98f
asahi: Split out per-stage sysvals
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
31afce2fa5
asahi: Add sysval tables for each shader stage
...
So we can model the descriptors of each shader stage independently, as required
for merged shaders.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
5189bae50c
asahi: Move UBO lowering into GL driver
...
In Vulkan, UBOs are lowered by nir_lower_explicit_io, and the ubo_base_agx
sysval is unused (since it doesn't handle descriptor sets). That makes the UBO
lowering GL-only and hence belongs with the GL driver rather than the compiler.
This lets us delete the ubo_base_agx sysval.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
1d77fb967d
nir,asahi: Remove texture_base_agx
...
Doing a descriptor crawl with binding tables requires a real binding table in
the shader, which won't work for VK or merged shader stages in GL. Instead,
let's lower anything that needs a crawl to bindless in the driver, so the
compiler code doesn't need to know anything about descriptor binding models.
That gets rid of the texture_base_agx sysval, which is problematic when there
are multiple descriptor sets worth of textures.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
1e11862753
agx: Do some texture lowering early
...
We want to make the implicit txs in operations explicit before lower_bindings so
lower_bindings knows to force bindless.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
d42bb650b3
asahi: Add get_query_address helper
...
This is the counterpart of get_oq_index for non-occlusion hardware queries.
These are not tracked with occlusion queries, since occlusion query allocations
are limited, and they are not based on indexing but rather general
batch-allocated space.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
a620e86f35
asahi: Add non-occlusion query tracking
...
For other GPU queries, handled similarly.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
9845814c98
asahi: Sync when beginning a query
...
Otherwise batch->writer might be non-null. Fixes Piglit occlusion_query_conform
(which I think regressed when we added proper syncing).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
a13f233219
asahi: Only touch batch->occlusion_queries for occlusion
...
We will soon have other types of queries with non-null writers.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
dfde9345d7
asahi: Refactor agx_get_query_result
...
In preparation for other types of GPU queries.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
e5dd053640
asahi: Simplify occlusion query batch tracking
...
Yes, this means we now lie to the app. There's nothing more in the spirit of
dumb OpenGL features than lying!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
e72facab9a
asahi: Generalize query logic
...
We will need to do the same flushing dance for non-occlusion GPU queries.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
58efa64c5c
asahi: Preserve atomic ops when rewriting image to bindless
...
Bug fix on its own, and prevents regressions from using bindless more.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
a51c3f638b
asahi: Pass layer stride in pixels, not elements
...
We do all the math in pixels and only multiply by the sample count at the end,
meaning the layer stride needs to be in terms of pixels (not samples) for
correct addressing of multisample array images in our texture lowering. This is
particularly used for lowering the multisample array stores we get from eMRT
with multisampled layered framebuffers.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
486fb75981
asahi: Use local_size from compiler directly
...
This avoids an unnecessary trip through agx_uncompiled_shader.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
6247e617c1
asahi: Report local_size from compiler
...
So we can add more shared in the compiler.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
6aa1cf6e7a
asahi: Advertise OpenGL ES 3.1!
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
7f636a08c8
asahi: Keep drawoverhead from OOMing itself
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
4c36f9052b
asahi: Copy CSO stride
...
Fixes: 7672545223 ("gallium: move vertex stride to CSO")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847 >
2023-08-23 15:06:54 +00:00
Mike Blumenkrantz
fbf3f64c6d
zink: sanitize optimal keys
...
shader keys represent pipeline states which trigger variants, but not
all shaders are affected by certain states
this adds some sanitizing for the optimal path to ignore shader variants
which won't have any effect for the currently bound shaders, thus reducing
the number of pipelines compiled (both unoptimized and optimized)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24831 >
2023-08-23 01:39:42 +00:00
Mike Blumenkrantz
dae144aeac
zink: use the "set" optimal key for prog last_variant_hash for consistency
...
this is the key that has been set during program update for reuse
everywhere else, and everything else in the driver uses it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24831 >
2023-08-23 01:39:42 +00:00
Mike Blumenkrantz
d5157356ce
zink: don't start multiple cache jobs for the same program
...
if there's already a cache job in flight then starting a second one
is illegal
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24831 >
2023-08-23 01:39:42 +00:00
Daniel Schürmann
7e246f7f2b
nir/opt_move: fix handling of if-condition
...
By accident, this used the parent of the nir_src which is a nir_if
instead of the parent of the SSA value.
Totals from 10814 (8.10% of 133461) affected shaders: (GFX11)
Instrs: 21759185 -> 21757190 (-0.01%); split: -0.02%, +0.01%
CodeSize: 112320272 -> 112316008 (-0.00%); split: -0.02%, +0.01%
SpillSGPRs: 11220 -> 11212 (-0.07%)
SpillVGPRs: 911 -> 903 (-0.88%); split: -1.54%, +0.66%
Latency: 258334759 -> 258316073 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 31428650 -> 31426394 (-0.01%); split: -0.02%, +0.01%
VClause: 309119 -> 309090 (-0.01%); split: -0.01%, +0.01%
SClause: 657028 -> 657150 (+0.02%); split: -0.03%, +0.04%
Copies: 1434209 -> 1432420 (-0.12%); split: -0.28%, +0.15%
Branches: 481804 -> 481801 (-0.00%)
PreSGPRs: 829995 -> 829966 (-0.00%)
PreVGPRs: 758249 -> 758253 (+0.00%)
Fixes: 8a78706643 ('nir: refactor nir_opt_move')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24695 >
2023-08-22 21:05:18 +00:00
Eric Engestrom
566c919df8
ci/deqp: backport fix for dEQP-EGL.functional.wide_color.*_888_colorspace_*
...
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24808 >
2023-08-22 18:12:08 +00:00
Emma Anholt
37fcbb375c
blorp: Disable unaligned partial HIZ fast clears for HIZ_CCS too.
...
Fixes MSAA scissored fast clears under zink and ANGLE.
Fixes: e488773b29 ("anv: Fast clear depth/stencil surface in vkCmdClearAttachments")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24225 >
2023-08-22 16:34:52 +00:00
Tapani Pälli
db05db44fe
iris: implement a dummy depth flush for Wa_14016712196
...
Emit depth flush after state that sends implicit depth flush. These
states are:
3DSTATE_HIER_DEPTH_BUFFER
3DSTATE_STENCIL_BUFFER
3DSTATE_DEPTH_BUFFER
3DSTATE_CPSIZE_CONTROL_BUFFER
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24689 >
2023-08-22 12:49:37 +00:00
Georg Lehmann
9cf6984200
nir: unify lower_find_msb with has_{find_msb_rev,uclz}
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24662 >
2023-08-22 12:08:37 +00:00
Georg Lehmann
2ac7e6614a
nir: unify lower_bitfield_extract with has_bfe
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24662 >
2023-08-22 12:08:37 +00:00
Georg Lehmann
34c3f81614
nir: unify lower_bitfield_insert with has_{bfm,bfi,bitfield_select}
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24662 >
2023-08-22 12:08:37 +00:00
Friedrich Vock
be0e3e8e09
ac/sqtt,radv: Split internal and API hash in PSO correlations
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371 >
2023-08-22 11:33:11 +00:00
Marek Vasut
ef4cb2431d
etnaviv: Fully replicate back stencil config
...
The blob replicates both the value mask as well as the stencil reference
of the back-facing stencil to the front-facing stencil. This fixes the
remaining failures in the following dEQPs:
dEQP-GLES2.functional.fbo.render.*_stencil_index8
Fixes: c8ccd63911 ("etnaviv: Fix depth stencil ops on GC880/GC2000")
Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4867 >
2023-08-22 12:00:27 +02:00
Mike Blumenkrantz
d9942442f2
zink: handle patch variable locations for separate shaders better
...
these don't overlap with other locations so they can keep whatever their
current assignments are
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24757 >
2023-08-22 01:31:35 +00:00
Mike Blumenkrantz
ca987c0dfb
zink: wait on async fence during ctx program removal
...
removed=true implies that no async jobs are outstanding
fixes #9580
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24811 >
2023-08-22 00:58:56 +00:00
Dave Airlie
0a90994fce
llvmpipe/cs: drop tgsi for compute/mesh/task shader internals.
...
This drops the info from the compute shader infrastructure.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804 >
2023-08-22 09:53:42 +10:00
Dave Airlie
6222d0633d
llvmpipe/cs: convert to using tgsi->nir
...
Step 1 to removing tgsi info from llvmpipe
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804 >
2023-08-22 09:53:42 +10:00
Dave Airlie
e32510be82
llvmpipe/fs: move some tgsi checks in nir path to nir code.
...
This just does the equivalent checks using NIR instead of tgsi
translated info.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804 >
2023-08-22 09:53:42 +10:00
Dave Airlie
8e2f020bb4
llvmpipe/fs: drop cbuf 0 since it's lowered now.
...
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804 >
2023-08-22 09:53:42 +10:00
Dave Airlie
5120139958
gallivm: drop unused info parameter
...
This isn't used.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804 >
2023-08-22 09:53:42 +10:00
David Heidelberg
6079c3ca49
ci: disable Material Testers.x86_64_2020.04.08_13.38_frame799.rdc trace
...
This change will be revert as soon, as Collabora proxy gets fixed.
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24819 >
2023-08-21 22:31:21 +00:00
Pavel Ondračka
df11f3f7e6
r300: remove the nrt main optimization loop
...
Most of it is already called during finalize_nir, so here we do just some final
polishing.
This brings some minor but reproducible compile-time speedups (dEQP on my RV370
and AMD Ryzen 9 3900X at 8 threads goes from 80s to 74s).
RV530 shader-db:
total instructions in shared programs: 130303 -> 130275 (-0.02%)
instructions in affected programs: 1661 -> 1633 (-1.69%)
helped: 9
HURT: 2
instructions helped: shaders/godot3.4/10-36.shader_test FS: 163 -> 162 (-0.61%)
instructions helped: shaders/tropics/240.shader_test VS: 144 -> 140 (-2.78%)
instructions helped: shaders/tropics/246.shader_test VS: 137 -> 133 (-2.92%)
instructions helped: shaders/tropics/222.shader_test VS: 131 -> 127 (-3.05%)
instructions helped: shaders/tropics/228.shader_test VS: 128 -> 124 (-3.12%)
instructions helped: shaders/tropics/252.shader_test VS: 126 -> 122 (-3.17%)
instructions helped: shaders/tropics/234.shader_test VS: 121 -> 117 (-3.31%)
instructions helped: shaders/tropics/216.shader_test VS: 104 -> 100 (-3.85%)
instructions helped: shaders/tropics/210.shader_test VS: 101 -> 97 (-3.96%)
instructions HURT: shaders/yofrankie/15.shader_test FS: 211 -> 213 (0.95%)
instructions HURT: shaders/yofrankie/42.shader_test FS: 295 -> 298 (1.02%)
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437 >
2023-08-21 20:10:40 +00:00
Pavel Ondračka
4c122086b6
r300: simplify ntr_get_gl_varying_semantic
...
We support TEXCOORDS since d4b8e8a481
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437 >
2023-08-21 20:10:40 +00:00
Pavel Ondračka
85c10bab8c
r300: remove unused barrier code from ntr
...
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437 >
2023-08-21 20:10:40 +00:00