Alyssa Rosenzweig [Wed, 27 Jan 2021 20:44:00 +0000 (15:44 -0500)]
pan/bi: Implement load_sample_mask_in
Preloaded.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 19:01:23 +0000 (14:01 -0500)]
pan/bi: Fix gl_SampleID read
Fixes dEQP-GLES31.functional.shaders.sample_variables.sample_id.default_framebuffer
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 17:41:57 +0000 (12:41 -0500)]
pan/bi: Lower ifind_msb
We have ufind_msb efficient, implement in terms of that.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 17:31:45 +0000 (12:31 -0500)]
pan/bi: Implement ufind_msb
Lowered to #(sz - 1) - clz(x), taking advantage of the machine's
8-bit and 16-bit variants of clz and the widening on the second argument
of ISUB to implement neatly in two instructions.
Note that in NIR, ufind_msb can take any integer type but always output
i32.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 17:17:26 +0000 (12:17 -0500)]
pan/bi: Implement bitfield_reverse
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Boris Brezillon [Mon, 25 Jan 2021 12:22:05 +0000 (13:22 +0100)]
pan/bi: Support bit_count()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Boris Brezillon [Mon, 25 Jan 2021 12:21:28 +0000 (13:21 +0100)]
pan/bi: Add uclz() support
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 16:51:38 +0000 (11:51 -0500)]
pan/bi: Lower bitfield inserts/extracts
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 16:22:10 +0000 (11:22 -0500)]
pan/bi: Implement texture gathers
Passes all of dEQP-GLES31.functional.texture.gather.*
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 16:21:48 +0000 (11:21 -0500)]
pan/bi: Remove redundant TEXC opcode check
Already checked in emit_tex
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 18:20:32 +0000 (13:20 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 01:03:38 +0000 (20:03 -0500)]
pan/mdg: Stub load_barycentric_sample
Now parity with Bifrost for not failing over these intrinsics.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 18:02:01 +0000 (13:02 -0500)]
pan/mdg: Lower ufind_msb, poorly
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 17:57:06 +0000 (12:57 -0500)]
pan/mdg: Implement uclz
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
Alyssa Rosenzweig [Wed, 27 Jan 2021 17:17:59 +0000 (12:17 -0500)]
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>
Alyssa Rosenzweig [Wed, 27 Jan 2021 16:51:30 +0000 (11:51 -0500)]
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>
Alyssa Rosenzweig [Wed, 27 Jan 2021 15:27:10 +0000 (10:27 -0500)]
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>
Alyssa Rosenzweig [Wed, 27 Jan 2021 13:49:09 +0000 (08:49 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 23:10:02 +0000 (18:10 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 22:16:07 +0000 (17:16 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 21:40:51 +0000 (16:40 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 21:27:09 +0000 (16:27 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 21:26:57 +0000 (16:26 -0500)]
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>
Alyssa Rosenzweig [Wed, 27 Jan 2021 20:35:39 +0000 (15:35 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 20:56:05 +0000 (15:56 -0500)]
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>
Alyssa Rosenzweig [Fri, 12 Feb 2021 21:40:07 +0000 (16:40 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:43:42 +0000 (14:43 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:43:15 +0000 (14:43 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:41:55 +0000 (14:41 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:40:56 +0000 (14:40 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:39:04 +0000 (14:39 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:37:51 +0000 (14:37 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:33:08 +0000 (14:33 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 19:31:18 +0000 (14:31 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 17:13:47 +0000 (12:13 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 17:12:16 +0000 (12:12 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 01:43:53 +0000 (20:43 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 01:25:55 +0000 (20:25 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 17:43:08 +0000 (12:43 -0500)]
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>
Alyssa Rosenzweig [Fri, 12 Feb 2021 21:28:52 +0000 (16:28 -0500)]
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>
Alyssa Rosenzweig [Fri, 29 Jan 2021 21:52:45 +0000 (16:52 -0500)]
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>
Alyssa Rosenzweig [Wed, 27 Jan 2021 21:18:01 +0000 (16:18 -0500)]
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>
Kenneth Graunke [Fri, 12 Feb 2021 19:39:45 +0000 (11:39 -0800)]
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>
Hoe Hao Cheng [Fri, 12 Feb 2021 20:56:23 +0000 (04:56 +0800)]
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>
Hoe Hao Cheng [Fri, 12 Feb 2021 19:14:26 +0000 (03:14 +0800)]
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>
Hoe Hao Cheng [Fri, 12 Feb 2021 13:50:55 +0000 (21:50 +0800)]
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>
Hoe Hao Cheng [Thu, 11 Feb 2021 19:35:32 +0000 (03:35 +0800)]
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>
Hoe Hao Cheng [Thu, 11 Feb 2021 18:41:18 +0000 (02:41 +0800)]
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>
Hoe Hao Cheng [Thu, 11 Feb 2021 18:10:40 +0000 (02:10 +0800)]
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>
Hoe Hao Cheng [Thu, 11 Feb 2021 18:16:06 +0000 (02:16 +0800)]
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>
Hoe Hao Cheng [Thu, 11 Feb 2021 18:14:14 +0000 (02:14 +0800)]
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>
Hoe Hao Cheng [Thu, 11 Feb 2021 16:17:04 +0000 (00:17 +0800)]
zink/codegen: introduce ExtensionRegistry
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021>
Samuel Pitoiset [Fri, 12 Feb 2021 09:08:14 +0000 (10:08 +0100)]
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>
Samuel Pitoiset [Fri, 12 Feb 2021 09:06:48 +0000 (10:06 +0100)]
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:
96b03aaa175 ("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>
Daniel Schürmann [Tue, 2 Feb 2021 16:46:35 +0000 (17:46 +0100)]
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>
Daniel Schürmann [Mon, 8 Feb 2021 16:30:26 +0000 (17:30 +0100)]
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>
Daniel Schürmann [Sat, 6 Feb 2021 17:40:21 +0000 (18:40 +0100)]
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>
Daniel Schürmann [Mon, 8 Feb 2021 13:38:43 +0000 (14:38 +0100)]
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>
Daniel Schürmann [Fri, 5 Feb 2021 13:38:08 +0000 (14:38 +0100)]
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>
Daniel Schürmann [Fri, 5 Feb 2021 13:36:39 +0000 (14:36 +0100)]
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>
Daniel Schürmann [Tue, 2 Feb 2021 16:33:09 +0000 (17:33 +0100)]
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>
Daniel Schürmann [Fri, 5 Feb 2021 17:25:18 +0000 (18:25 +0100)]
aco: fix shared VGPR allocation on RDNA2
VGPRs are now allocated in blocks of 8 normal
or 16 shared VGPRs, respectively.
Fixes:
14a5021aff661a26d76f330fec55d400d35443a8 ('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>
Hoe Hao Cheng [Thu, 11 Feb 2021 16:35:15 +0000 (00:35 +0800)]
zink: VK_KHR_draw_indirect_count is a device extension
this fixes some testcases on CI.
Fixes:
1c01ad1b804 ("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>
Samuel Pitoiset [Thu, 11 Feb 2021 18:27:24 +0000 (19:27 +0100)]
radv: emit pipeline bind markers for SQTT
I suspect this marker to be useful for correlating pipeline shaders.
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/8995>
Mike Blumenkrantz [Fri, 12 Feb 2021 15:22:43 +0000 (10:22 -0500)]
zink: fix streamout for tess stage
the tess shader needs to actually emit xfb stuff in order for it to work
Fixes:
2891e0b74e6 ("zink: pull xfb info from tess shader when applicable")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9013>
Jesse Natalie [Thu, 4 Feb 2021 16:43:25 +0000 (08:43 -0800)]
wgl: Disable automatic use of layered drivers with LIBGL_ALWAYS_SOFTWARE
Fixes:
8955980f ("gallium/targets/libgl-gdi: prefer d3d12 driver")
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8865>
Jesse Natalie [Thu, 4 Feb 2021 16:30:02 +0000 (08:30 -0800)]
d3d12: Fail screen creation if a shader validator is needed and can't be created
Also fail screen creation if experimental shader models are requested, but can't be enabled
Fixes:
2ea15cd6 ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4022
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8865>
Jesse Natalie [Thu, 4 Feb 2021 16:08:12 +0000 (08:08 -0800)]
wgl: Add a loop for screen creation with an ordered list of fallbacks
Fixes:
8955980f ("gallium/targets/libgl-gdi: prefer d3d12 driver")
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4022
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8865>
Jesse Natalie [Thu, 4 Feb 2021 15:58:06 +0000 (07:58 -0800)]
wgl: Refactor screen creation to a function
Fixes:
8955980f ("gallium/targets/libgl-gdi: prefer d3d12 driver")
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4022
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8865>
Alyssa Rosenzweig [Fri, 12 Feb 2021 13:21:45 +0000 (08:21 -0500)]
pan/bi: Fix empty shader handling
Fixes INSTR_INVALID_ENC fault on dEQP-GLES31.functional.compute.basic.empty
Fixes:
bfcdc8f1747 ("pan/bi: Add some zero bytes after shaders on Bifrost")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9011>
Alyssa Rosenzweig [Thu, 11 Feb 2021 20:23:01 +0000 (15:23 -0500)]
pan/bi: Fix jumps to terminal block again
New scheduler broke this. We need to shuffle some code around so we do
the lower pre-schedule instead of post-schedule (no clauses to work
with).
Fixes:
77933d16d8c ("pan/bi: Switch to new scheduler")
Reported-by: Icecream95 <ixn@disroot.org>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9011>
Alyssa Rosenzweig [Wed, 27 Jan 2021 17:17:36 +0000 (12:17 -0500)]
panfrost: Fake shader images for bifrost+deqp
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9011>
Michel Dänzer [Thu, 11 Feb 2021 08:56:09 +0000 (09:56 +0100)]
ci: Disable scons-win64 job
It's failed for almost a month, so right now it's mostly noise and a
waste of CI resources.
It can easily be re-enabled by an MR which makes it pass again.
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8976>
Bas Nieuwenhuizen [Thu, 11 Feb 2021 19:32:00 +0000 (20:32 +0100)]
radv: Ignore WC flags for VRAM.
Otherwise there might be buffers for which we don't have a type.
Fixes:
7262c743dc8 ("radv: Determine memory type for import based on fd.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4280
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8996>
Mike Blumenkrantz [Thu, 20 Aug 2020 17:36:46 +0000 (13:36 -0400)]
zink: support SO_OVERFLOW pipe query types
this is really just not what we want to be doing. vulkan has no method for
doing on-gpu checks for xfb overflow, instead providing the info as two values
for the user to do with as they will, forcing us to gpu stall any time we
need to interact with these queries
for the ANY variant of the query, we need to create even more xfb query pools,
since we now need to be monitoring all available vertex streams for overflows
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8992>
Mike Blumenkrantz [Sat, 6 Feb 2021 00:31:05 +0000 (19:31 -0500)]
zink: put SO_OVERFLOW queries on the primgen list
these need to know if xfb was active during the query
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8992>
Mike Blumenkrantz [Thu, 20 Aug 2020 17:35:46 +0000 (13:35 -0400)]
zink: break out cpu query reading for qbos into separate function
we're going to need this more than once
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8992>
Mike Blumenkrantz [Thu, 20 Aug 2020 14:27:38 +0000 (10:27 -0400)]
zink: make the xfb_query_pool into an array
we'll need to potentially be observing all streams to handle the
query types from ARB_transform_feedback_overflow_query
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8992>
Mike Blumenkrantz [Thu, 20 Aug 2020 14:26:57 +0000 (10:26 -0400)]
zink: always use query->type for starting/stopping xfb queries
we're going to be seeing some overlap here
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8992>
Alyssa Rosenzweig [Fri, 12 Feb 2021 02:33:02 +0000 (21:33 -0500)]
pan/bi: Skip ATEST for colour blit shaders
Small win.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9002>
Alyssa Rosenzweig [Fri, 12 Feb 2021 02:32:39 +0000 (21:32 -0500)]
panfrost: Pass is_blit flag around
There are blit shader specific optimizations available.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9002>
Erik Faye-Lund [Thu, 4 Feb 2021 10:21:35 +0000 (11:21 +0100)]
zink: use gallium api to copy to display-target
This allows us to avoid us to avoid forcing linear and host-visible
display-targets.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
Erik Faye-Lund [Thu, 4 Feb 2021 12:58:12 +0000 (13:58 +0100)]
zink: ignore irrelevant bind-flags
We don't need to create display-targets for shared or scanout, becuase
we never even see those in the sw-winsys case.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
Erik Faye-Lund [Thu, 4 Feb 2021 09:46:56 +0000 (10:46 +0100)]
zink: limit host-visible bind-flags
The only type that should really require to be host-visible is the
display-target, and that's just because of our silly flush_frontbuffer
implementation.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
Erik Faye-Lund [Thu, 4 Feb 2021 09:42:22 +0000 (10:42 +0100)]
zink: don't always require linear display-targets
We only need these display-targets to be linear in the case of a
software winsys. In the DRM case, they can be tiled without issues.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
Erik Faye-Lund [Wed, 3 Feb 2021 16:22:29 +0000 (17:22 +0100)]
zink: do not use extra staging resource unless needed
The reason we check for staging-resources here is really because they
are the only images guaranteed to be host-visible.
But on UMA architectures, it's quite likely to have memory that is
*both* host-visible *and* device-local, so let's see what we found
instead.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
Erik Faye-Lund [Wed, 3 Feb 2021 16:11:56 +0000 (17:11 +0100)]
zink: drop extra set of parens
We don't need to be doubly sure here, we can just use a single set of
parents instead.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
Erik Faye-Lund [Thu, 11 Feb 2021 10:12:55 +0000 (11:12 +0100)]
ci: disable sporadically failing test
spec@arb_timer_query@timestamp-get seems to fail on D3D12 / Windows
every now and then. Until that's been figured out, let's disable the
test in CI.
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8978>
Erik Faye-Lund [Thu, 11 Feb 2021 12:34:45 +0000 (13:34 +0100)]
lavapipe: handle null-buffers for xfb
The Vulkan spec says the following for vkCmdBeginTransformFeedbackEXT:
"For each element of pCounterBuffers that is VK_NULL_HANDLE, transform
feedback will start capturing vertex data to byte zero in the
corresponding bound transform feedback buffer."
While not quite as explicit, similar wording exists for
vkCmdEndTransformFeedbackEXT in "Valid Usage" section.
So, this means that we should handle NULL in this case, and simply
ignore the corresponding reads and writes.
This fixes a whole lot of crashes when using transform-feedback with
Zink.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8982>
Giovanni Mascellani [Fri, 12 Feb 2021 07:36:58 +0000 (08:36 +0100)]
anv: Allow null handle in DestroyDescriptorUpdateTemplate.
By the Vulkan specification, and similarly to many other Vulkan calls,
it is allowed to destroy a null descriptor update template.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Fixes:
af5f13e58c9dfe ("anv: add VK_KHR_descriptor_update_template support")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9005>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:28:52 +0000 (12:28 +0100)]
broadcom/compiler: use unifa for UBO loads from uniform addresses
This basically processes UBO loads as uniform loads by writing
the load address to the unifa register and reading sequential
values with ldunifa.
This process is faster than going through the TMU, but we can only
use it when the address we are reading from is uniform across all
channels, since we are basically reading from the UBO address
as if it was a uniform stream.
This leads to better performance in the UE4 Shooter demo.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:24:57 +0000 (12:24 +0100)]
broadcom/compiler: emit ldunifarf when needed
Just like ldunif and ldunifrf, ldunifa writes to the r5 accumulator
and ldunifarf writes to the register file.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:18:38 +0000 (12:18 +0100)]
broadcom/compiler: do not DCE ldunifa
ldunifa reads a uniform from the unifa address and updates the unifa
address implicitly, so if we dead-code-eliminate one a follow-up
ldunifa will not read from the appropriate address.
We could avoid this if the compiler ensures that every ldunifa is
paired with an explicit unifa, so for example if we are reading a
vec4, we could emit:
unifa (addrr)
ldunifa
unifa (addr+4)
ldunifa
unifa (addr+8)
ldunifa
unifa (addr+12)
ldunifa
instead of:
unifa (addr)
ldunifa
ldunifa
ldunifa
ldunifa
But since each unifa has a 3 delay slot before we can do ldunifa,
that would end up being quite expensive.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:16:10 +0000 (12:16 +0100)]
broadcom/compiler: disallow reading two uniforms in the same instruction
The simulator asserts on this, which can happen if we merge a ldunif
(or any other instruction that reads a uniform implicitly) and
ldunifa in the same instruction.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:15:17 +0000 (12:15 +0100)]
broadcom/compiler: ensure 3-slot delay between unifa and ldunifa
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:13:02 +0000 (12:13 +0100)]
broadcom/compiler: preserve ordering of unifa/ldunifa sequences
unifa writes the addresss from which follow-up ldunifa loads,
and each ldunifa increments the unifa addeess by 32-bit so the
loads need to be ordered too.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 11:09:28 +0000 (12:09 +0100)]
broadcom/compiler: disallow unifa overlap with thread switch/end
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 12:22:28 +0000 (13:22 +0100)]
broadcom/compiler: add a helper to check if an instruction writes unifa
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 10:52:13 +0000 (11:52 +0100)]
broadcom/compiler: don't check for GFXH-1633 on V3D 4.2.x
This has been fixed since V3D 4.2.14 (Rpi4), which is the hardware
we are targetting. Our version resolution doesn't allow us to check
for 4.2 versions lower than .14, but that is okay because the
simulator would still validate this in any case.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
Iago Toral Quiroga [Thu, 11 Feb 2021 10:32:35 +0000 (11:32 +0100)]
broadcom/compiler: name registers correctly based on V3D version
So we can differentiate between TMU for V3D 4.x and UNIFA for V3D 4.x,
which are aliased.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>