Alyssa Rosenzweig
36248dd448
pan/mdg: Implement uclz
...
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
Alyssa Rosenzweig
887e391447
pan/mdg: Rename bitcount8 to popcnt, fixing the unit
...
Still doesn't seem to work correctly for negative values.
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
Alyssa Rosenzweig
e55af16bfe
pan/mdg: Lower bitfield instructions
...
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
Alyssa Rosenzweig
94b6d4e0ed
pan/mdg: Remove unused pack_unorm_4x8 lowering
...
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
Alyssa Rosenzweig
954623856c
pan/mdg: Assert on bad 64-bit swizzle in disassembly
...
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:29 -05:00
Alyssa Rosenzweig
97a85c1071
panfrost: Add MULTISAMPLED sysval
...
To be used with Bifrost coverage mask updates.
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:29 -05:00
Alyssa Rosenzweig
9f55657366
panfrost: Overhaul sysval handling
...
Don't preassign.
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:29 -05:00
Alyssa Rosenzweig
4086b8980d
panfrost: Implement get_sample_position
...
Easy now that we have the table.
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:29 -05:00
Alyssa Rosenzweig
b01df1f9bf
panfrost: Advertise MSAA 8x and 16x
...
On Bifrost. Could support Mali T760+ with additional debug.
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:29 -05:00
Alyssa Rosenzweig
072cc5d5f1
panfrost: Ensure open_device has pandecode initialized
...
Requires reordering some calls.
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:29 -05:00
Alyssa Rosenzweig
dd3bda22f4
panfrost: Use sample location LUT
...
Fixes multisampling issues on Bifrost.
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:29 -05:00
Alyssa Rosenzweig
a61fb62966
panfrost: Upload sample positions on device init
...
Needed to correctly implement multisampling on Bifrost, and used in
gl_SamplePosition implementation on Midgard. These are architecturally
invariant, so it's fine to hard code.
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:29 -05:00
Alyssa Rosenzweig
376c3fa4db
panfrost: Set sample count/pattern for tiler FBD
...
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:29 -05:00
Alyssa Rosenzweig
555c17e2c6
panfrost: Remove batch_is_scanout
...
Unused since last commit.
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:29 -05:00
Alyssa Rosenzweig
1a6fc40b99
panfrost: Remove PAN_REQ_DEPTH_WRITE
...
No consumers, garbage collect the whole thing.
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:29 -05:00
Alyssa Rosenzweig
37050ad62a
panfrost: Remove PAN_REQ_MSAA
...
Neglible win for draw time overhead.
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:29 -05:00
Alyssa Rosenzweig
1439f8db12
panfrost: Don't use PAN_REQ_MSAA in SFBD
...
We can also generalize a bit to eliminate the state dependence.
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:29 -05:00
Alyssa Rosenzweig
7b5aa5fbf2
panfrost: Don't set REQ_MSAA in pan_mfbd
...
No remaining consumer.
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:29 -05:00
Alyssa Rosenzweig
ccce5b922f
panfrost: Generalize MSAA handling
...
This uses the framebuffer MSAA state directly and will generalize to
MSAA 8x/16x when somebody gets around to it.
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:29 -05:00
Alyssa Rosenzweig
bea7839c1e
panfrost: Set tiler descriptor sampler pattern
...
Bifrost requires this to match the framebuffer descriptor's sample
pattern, but we were leaving the default (single-sampled)
unconditionally, leading to undefined behaviour.
It is unknown if this fixes any user-visible bugs, but without the
commit the descriptor is likely out-of-spec.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: 21.0 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774 >
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig
b08100fb96
panfrost: Add panfrost_sample_pattern helper
...
We always use rotated grids to preserve current behaviour.
Cc stable as it is required for the next commit. If deemed too invasive,
a simpler fix could be backported.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: 21.0 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774 >
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig
b6ad375bdf
panfrost: Respect info.fs.uses_sample_shading
...
Now that this is a link-time property.
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:29 -05:00
Alyssa Rosenzweig
55f8df6d36
panfrost: Refactor sample shading state
...
Moves the decision to evaluate per-sample to link time instead of
draw-time, with an explicit property. No functional change.
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:28 -05:00
Alyssa Rosenzweig
56bf3086fc
panfrost: Push sample positions sysval for 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:28 -05:00
Alyssa Rosenzweig
beb7d66056
panfrost: Add sample positions sysval
...
For Midgard. On Bifrost, the hardware pushes this directly to FAU.
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:28 -05:00
Alyssa Rosenzweig
f782983cfb
panfrost: Preload sample mask if needed
...
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:28 -05:00
Alyssa Rosenzweig
9d682ad7f9
pan/decode: Only print local storage for vertex jobs
...
It's convenient to group this with the framebuffer, but the other fields
are unused by the hardware for vertex jobs. They _are_ used for tiler
jobs.
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:28 -05:00
Alyssa Rosenzweig
b27d0164ee
pan/decode: Cleanup sample locations decode
...
We know what this is now. I opted to leave it in ~fixed-point format to
avoid bikeshedding over precision.
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:28 -05:00
Alyssa Rosenzweig
2afdcc187b
nir: Add sample_positions_pan intrinsic
...
Facilites the gl_SamplePosition lowering on Bifrost, where the sample
positions are accessed directly in a packed in-memory format.
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:28 -05:00
Kenneth Graunke
e7dc48c309
iris: Make a pin_scratch_space() helper
...
We need to (re-)pin the scratch buffer in four different places, and
it's going to get slightly more complicated on future platforms. So,
make a helper function, allowing us to add the complexity in one spot.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9023 >
2021-02-12 21:14:26 +00:00
Hoe Hao Cheng
93ff47eb19
zink: enable KHR_shader_draw_parameters on Vulkan <1.2
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
efe6f00e34
zink/codegen: do not enable extensions that are now core
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
4deb58b9d8
zink/codegen: fix type annotations
...
mypy complains about this
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
4751135e57
zink/codegen: validate has_properties and has_features
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
613132c41f
zink/codegen: perform basic validation in zink_device_info
...
Check for existence of extension and its type
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
33d006f565
zink/codegen: make zink_device_info accept vk.xml
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
3d36bfd21f
zink/codegen: introduce notion of non-standard extensions
...
this is for the MoltenVK extensions, especially "VK_MVK_moltenvk", which
right now is reserved in the registry. Making it non-standard skips all
the validations.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
7489f5fc4d
zink/codegen: more validation in zink_instance
...
the MVK check is a workaround, since VK_MVK_moltenvk is not an official
VK extension per se - the next patch will introduce nonstandardness to
Extension.
Two new validations are added by this patch:
1. extension type (non-instance extensions are rejected)
2. existence of specified instance functions
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng
b64a9a12a4
zink/codegen: introduce ExtensionRegistry
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021 >
2021-02-12 21:04:24 +00:00
Samuel Pitoiset
caa4a218f1
radv/winsys: set use_global_list inside the critical section
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9006 >
2021-02-12 19:12:01 +00:00
Samuel Pitoiset
7379ca4043
radv: only make the WSI images resident if the global BO list is used
...
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4270
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4286
Fixes: 96b03aaa17 ("radv: use the global BO list from the winsys")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9006 >
2021-02-12 19:12:01 +00:00
Daniel Schürmann
44a76ba16d
aco: use VCC as regular SGPR pair on GFX10
...
There is no need to reserve it for special purposes, only.
Totals from 139391 (100.00% of 139391) affected shaders (Navi10):
VGPRs: 4738296 -> 4738156 (-0.00%); split: -0.01%, +0.00%
SpillSGPRs: 16188 -> 14968 (-7.54%); split: -7.60%, +0.06%
CodeSize: 294204472 -> 294118048 (-0.03%); split: -0.04%, +0.01%
MaxWaves: 2119584 -> 2119619 (+0.00%); split: +0.00%, -0.00%
Instrs: 56075079 -> 56056235 (-0.03%); split: -0.05%, +0.01%
Cycles: 1757781564 -> 1755354032 (-0.14%); split: -0.16%, +0.02%
VMEM: 52995887 -> 52996319 (+0.00%); split: +0.07%, -0.07%
SMEM: 9005338 -> 9004858 (-0.01%); split: +0.16%, -0.17%
VClause: 1178436 -> 1178331 (-0.01%); split: -0.02%, +0.01%
SClause: 2403649 -> 2404542 (+0.04%); split: -0.14%, +0.18%
Copies: 3447073 -> 3432417 (-0.43%); split: -0.66%, +0.23%
Branches: 1166542 -> 1166422 (-0.01%); split: -0.11%, +0.10%
PreSGPRs: 4229322 -> 4235538 (+0.15%)
PreVGPRs: 3817111 -> 3817040 (-0.00%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
112f389261
aco: don't abort() if disassembly fails
...
We used that to catch assembly errors in the past,
but now, there are too many hardware features we
use in ACO that are not supported by the LLVM disassembler,
that it is not really suited anymore as a debugging tool.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
171fbe3ae1
aco: check get_reg_specified() on register hints
...
This ensures that max_used_sgpr is adjusted accordingly.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
dd16e21e97
aco: also consider VCC in get_reg_specified()
...
This allows split_vector and others to keep their VCC position.
Totals from 4573 (3.28% of 139391) affected shaders (Navi10):
CodeSize: 54292268 -> 54289324 (-0.01%); split: -0.03%, +0.03%
Instrs: 10327645 -> 10326941 (-0.01%); split: -0.04%, +0.04%
Cycles: 744410748 -> 744034732 (-0.05%); split: -0.07%, +0.02%
VMEM: 749093 -> 749092 (-0.00%); split: +0.00%, -0.00%
SMEM: 269306 -> 269322 (+0.01%)
SClause: 358746 -> 358744 (-0.00%)
Copies: 826051 -> 823910 (-0.26%); split: -0.55%, +0.29%
Branches: 355074 -> 356493 (+0.40%); split: -0.01%, +0.41%
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
947bf0bd67
aco: don't decrease the vgpr_limit when encountering bpermute
...
Instead we recalculate vgpr_limit on demand, depending on
the number of needed shared VGPRs.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
b98a4d4dd7
aco: refactor GPR limit calculation
...
This patch delays the calculation of GPR limits in order to
precisely incorporate extra registers (VCC etc.) and shared VGPRs.
Additionally, the allocation granularity is used to set the config.
This has some effect on the reported SGPR stats.
Totals (Navi10):
SGPRs: 6971787 -> 17753642 (+154.65%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
eaf681724e
aco: change gpr_alloc_granule to full alignment
...
This also switches the alloc_granule of Tonga and Iceland
to 96, so that the calculation is consistent.
Also changes the granularity for RDNA to 16 to keep
better stats with the upcoming patch.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Daniel Schürmann
bacc3b36f5
aco: fix shared VGPR allocation on RDNA2
...
VGPRs are now allocated in blocks of 8 normal
or 16 shared VGPRs, respectively.
Fixes: 14a5021aff ('aco/gfx10: Refactor of GFX10 wave64 bpermute.')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8921 >
2021-02-12 19:00:18 +00:00
Hoe Hao Cheng
04df0cb4ae
zink: VK_KHR_draw_indirect_count is a device extension
...
this fixes some testcases on CI.
Fixes: 1c01ad1b80 ("zink: add KHR_draw_indirect_count detection")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8991 >
2021-02-12 18:27:25 +00:00