Timothy Arceri
7647023f3b
glsl: enable the use of the nir based varying linker
...
Here as well as calling the pass we need to switch the order of
some of the information gathering and optimisation calls. We also
need to create a custom callback for the dead variables removal
pass to clean up dead builtin varying in SSO programs without
causing piglit regressions.
shader-db results IRIS (BDW):
total instructions in shared programs: 17487900 -> 17477072 (-0.06%)
instructions in affected programs: 128682 -> 117854 (-8.41%)
helped: 587
HURT: 82
helped stats (abs) min: 1 max: 145 x̄: 18.82 x̃: 20
helped stats (rel) min: 0.21% max: 77.78% x̄: 17.41% x̃: 8.85%
HURT stats (abs) min: 1 max: 6 x̄: 2.68 x̃: 2
HURT stats (rel) min: 0.25% max: 9.76% x̄: 2.94% x̃: 2.16%
95% mean confidence interval for instructions value: -17.71 -14.66
95% mean confidence interval for instructions %-change: -16.40% -13.42%
Instructions are helped.
total cycles in shared programs: 857442520 -> 857170199 (-0.03%)
cycles in affected programs: 112252720 -> 111980399 (-0.24%)
helped: 13733
HURT: 13349
helped stats (abs) min: 1 max: 7293 x̄: 81.44 x̃: 10
helped stats (rel) min: <.01% max: 90.32% x̄: 3.30% x̃: 0.62%
HURT stats (abs) min: 1 max: 7424 x̄: 63.38 x̃: 8
HURT stats (rel) min: <.01% max: 192.23% x̄: 3.28% x̃: 0.54%
95% mean confidence interval for cycles value: -14.01 -6.10
95% mean confidence interval for cycles %-change: -0.17% 0.06%
Inconclusive result (%-change mean confidence interval includes 0).
total sends in shared programs: 971443 -> 970010 (-0.15%)
sends in affected programs: 4596 -> 3163 (-31.18%)
helped: 446
HURT: 39
helped stats (abs) min: 1 max: 6 x̄: 3.40 x̃: 4
helped stats (rel) min: 3.03% max: 85.71% x̄: 46.48% x̃: 50.00%
HURT stats (abs) min: 1 max: 3 x̄: 2.15 x̃: 2
HURT stats (rel) min: 6.67% max: 25.00% x̄: 15.16% x̃: 10.53%
95% mean confidence interval for sends value: -3.13 -2.78
95% mean confidence interval for sends %-change: -44.16% -38.88%
Sends are helped.
LOST: 235
GAINED: 262
Shader-db results radeonsi (RX580):
169505 shaders in 102144 tests
Totals:
SGPRS: 7698832 -> 7696552 (-0.03 %)
VGPRS: 5547296 -> 5545280 (-0.04 %)
Spilled SGPRs: 14795 -> 14773 (-0.15 %)
Spilled VGPRs: 3782 -> 3782 (0.00 %)
Private memory VGPRs: 1152 -> 1152 (0.00 %)
Scratch size: 3872 -> 3872 (0.00 %) dwords per thread
Code Size: 162946528 -> 162895264 (-0.03 %) bytes
Max Waves: 2449334 -> 2449736 (0.02 %)
Totals from affected shaders:
SGPRS: 215024 -> 212744 (-1.06 %)
VGPRS: 151976 -> 149960 (-1.33 %)
Spilled SGPRs: 162 -> 140 (-13.58 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 5249916 -> 5198652 (-0.98 %) bytes
Max Waves: 54588 -> 54990 (0.74 %)
Panfrost trace checksum is updated as per discussion in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6343
Some virpipe tess shader piglit tests are added as failures to CI
these failures are not a regression but an uncovered existing bug
exposed due to the linker no longer sorting internally facing
shader interfaces in alphabetical order. See details in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6481
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
fa9cee4247
glsl: implement lower_xfb_varying() as a NIR pass
...
This just converts the GLSL IR pass to NIR.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
4600108ddf
glsl: implement opt_dead_builtin_varyings() as a NIR pass
...
And also call it via the NIR varying linker.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
e5122a5543
glsl: add a NIR based varying linker
...
With a NIR based linker we get better xfb packing, and we no longer
depend on the GLSL IR optimisations to be able to link shaders
with a large amount of dead input/outputs.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
e3a45a4778
glsl: implement lower_packed_varyings() as a NIR pass
...
This is essentially the old GLSL IR packing pass rewritten as a
NIR based pass.
Doing this packing in NIR after we have preformed NIRs
optimisation passes can give us better packing results.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
c1fbd0b8ab
nir: skip lowering io to scalar for must_be_shader_input
...
These varyings cannot be packed by the GLSL linkers packing pass
so we need to skip this lowering until later when we can properly
handle them.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
99ab530617
nir: abort io info gathering if location is not set or is a temp value
...
Unlike spirv glsl varyings might not have explicit locations set.
nir_shader_gather_info() was once only called at the end of linking
but these days it even gets called in NIR optimisation loops via
nir_opt_phi_precision.
In the following patches we implement a NIR version of the GLSL
varying linker which means we will have varyings with no location
set when nir_shader_gather_info() gets called the first few times,
and temp values set only for the purpose of removing unmatched
varyings between shaders for some calls after that.
Here rather than asserting we simply abort the io info gathering,
when we hit these values.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
cba2fd51a2
nir: add variable data fields required for NIR glsl varying linking
...
These will be used in the following patches that add a NIR based
varying linker.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
43a8454ea8
glsl: add new build program resource helpers
...
These will be used by a new nir based glsl varying linker that will
add varyings directly to the list before the are packed and we lose
the information.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
23ea24e11f
glsl/mesa: move parse_program_resource_name() to common linker_util code
...
This will be shared by a new NIR varying linking pass in following patches
but probably fits better here anyway considering its also used by
shader_query.cpp
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
5d57bd0345
nir/glsl: wrap component_slots_aligned()
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
6dbe075f92
nir/glsl: wrapper field_index()
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
42a97a0aef
nir/glsl: wrapper contains_{double,interger}()
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
7af9459670
nir/glsl: add glsl_record_compare() wrapper
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Sidney Just
3c0f349a7b
docs: updated zink features and release notes
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
5fda0a996a
zink: enable pipe cap for win32 external memory and fences
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
bedfee121c
zink: implement device LUID and node mask
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
34e62bfa80
zink: implement win32 memory handle import
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
f1f5627286
zink: implement win32 fence import
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
7e3d6a0238
zink: codegen for Win32 external object extensions
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Mike Blumenkrantz
e978a33587
zink: add win32 guards for device extensions with win32 in name
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
787d31650b
mesa: pipe cap for EXT_memory_object_win32 and EXT_semaphore_win32
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
c709bbde9e
mesa: implement import win32 memory and semaphore
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
5e8702f796
mesa: implement GL_DEVICE_LUID_EXT and GL_DEVICE_NODE_MASK_EXT getters
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Mike Blumenkrantz
8917235d12
aux/trace: screen::create_fence_win32
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
a6c468d985
gallium/trace: implement win32 device LUID and node mask getters
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Mike Blumenkrantz
a0b2e43927
gallium/noop: implement pipe_screen::create_fence_win32
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
08dfe2ca84
gallium/noop: implement win32 device LUID and node mask getters
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
e1f6273763
mapi: added EXT_external_objects_win32 definitions
...
Includes implementation stubs
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Sidney Just
f98d47e011
gallium: support for implementing EXT_external_objects_win32
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504 >
2022-05-15 19:56:49 +00:00
Mike Blumenkrantz
ca915c871f
zink: directly reuse surface ivci when rebinding
...
this is simpler and also fixes rebinding samplerviews which use
a levelCount > 1
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
fa3d51892a
zink: fix 3d shader image miplevel calc for depth
...
without adjusting for miplevel here, the shader image might erroneously
be created as a 2d view and/or assert
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
1526df283c
zink: stop leaking shader image surfaces
...
the code here was fine for checking the base resource unbinds and whatever,
but it never actually destroyed the surfaces/bufferviews created,
which meant they were always being leaked
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
2df1c06168
zink: copy incoming shader image struct after doing updates
...
no functional changes
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
32a77b1e25
zink: read shader image r/w usage from incoming data struct
...
no functional changes
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
a3dff53487
zink: simplify dumb update flagging in set_shader_images
...
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
22954b4860
zink: reuse local res pointer in set_shader_images
...
no functional changes
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Mike Blumenkrantz
d0df488970
zink: remove refs from shader images
...
these have implicit refs from the surface/bufferview that gets created,
so adding a ref here is redundant and less performant
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508 >
2022-05-15 19:46:23 +00:00
Chia-I Wu
e9e8c649cd
freedreno/fdperf: support dumping counters
...
This is useful for comparing two workloads.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16488 >
2022-05-14 22:18:52 +00:00
Chia-I Wu
267786be60
freedreno/fdperf: make refresh rate configurable
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16488 >
2022-05-14 22:18:52 +00:00
Chia-I Wu
cd42f63c43
turnip: let modifier takes precedence over TU_DEBUG=noubwc
...
TU_DEBUG=noubwc is not very usable on sway/xwayland where the wsi uses
modifiers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16507 >
2022-05-14 21:56:38 +00:00
Lionel Landwerlin
17fc7b20b1
anv: fix primitives generated queries values
...
Numbers in some situations are incorrect because we don't stall
properly before capturing the register value.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6412
Fixes: a468f26ca5
("anv: implement VK_EXT_primitives_generated_query")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16505 >
2022-05-14 10:47:29 +00:00
Charmaine Lee
058823906e
svga: add svga_compile_shader helper function
...
This patch refactors common shader compilation code into a helper function
which will call the corresponding shader translation function according to
the shader IR type.
It also adds a function pointer for getting dummy shader for different
shader stages.
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16501 >
2022-05-14 03:06:06 +00:00
Charmaine Lee
c291e685bc
svga: create svga_shader_info
...
This patch adds a new structure svga_shader_info which includes
shader info that is accessed outside of the shader translation
code. That's why it cannot be TGSI specific as we will later also
support NIR. This shader info structure, however, is derived
from the TGSI shader info or the NIR shader info.
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16501 >
2022-05-14 03:06:06 +00:00
Charmaine Lee
ed77ac1eef
svga: add a helper function for common shader creation
...
This patch refactors common shader creation code into a helper function.
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16501 >
2022-05-14 03:06:06 +00:00
Rajnesh Kanwal
65fce0f813
pvr: Fix argument comments in render job submission.
...
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15709 >
2022-05-13 23:18:16 +00:00
Rajnesh Kanwal
d50418a4fc
pvr: Add vk_sync support and remove service winsys syncobjs interface.
...
Removing internal pvr_winsys_syncobj abstraction and porting
service winsys syncobj over to vk_sync_type.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15709 >
2022-05-13 23:18:16 +00:00
Jason Ekstrand
98cc4c3a20
nir: Use nir_shader_instructions_pass in nir_lower_input_attachments
...
This simplifies things a bit and also fixes metadata handling.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16482 >
2022-05-13 22:51:38 +00:00
Jason Ekstrand
a170448a18
nir: Put the builder first in lower_input_attachments helpers
...
This is more idiomatic.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16482 >
2022-05-13 22:51:38 +00:00
Jason Ekstrand
5410f4ee89
mesa/st: Use lower_indirect_var_derefs in st_nir_lower_builtin
...
Instead of having a special NIR helper for GL stuff, we can now use the
more generic helper and do so directly.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16482 >
2022-05-13 22:51:38 +00:00