Commit Graph

170927 Commits

Author SHA1 Message Date
Juston Li
a55d26b566 venus: add back sparse binding support
Add back support for vkQueueBindSparse that works with fence and timeline
semaphore feedback.

For each vkQueueBindSparse batch, if it contains feedback then move the
signal operations to a subsequent vkQueueSubmit with feedback cmds.

This requires queue families that support vkQueueSubmit alongside sparse
binding support so any queue familes that exclusively support sparse
binding will be filtered out.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22616>
2023-05-09 04:35:16 +00:00
Juston Li
c3e1140c20 venus: add helper function support for VkBindSparseInfo
add getter/setters for VkBindSparseInfo so we can at least share
vn_queue_submission_prepare() to handle external semaphores and
check for fence/semaphore feedback

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22616>
2023-05-09 04:35:16 +00:00
Juston Li
6ec54465d4 venus: filter out queue familes with exclusive sparse binding support
We require the queue to have additional support to be able to send
feedback commands.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22616>
2023-05-09 04:35:16 +00:00
Qiang Yu
1ba2460e61 ac/nir/cull: fix line position w culling
Fixes: db0e9d3cab ("ac/nir/ngg: support line culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8950
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22867>
2023-05-09 02:30:41 +00:00
Mike Blumenkrantz
24350064ca zink: fix uncached memory readback
the inner conditional here didn't include uncached readback, meaning
that many (most?) buffers allocated with uncached memory (i.e., BAR) were
being read back directly instead of using staging resources to be faster

at some point this inner conditional should be reevaluated to determine
whether it still does anything, but this is not that time

fixes, among other things, loading in DOOM2016 on some GPUs

Fixes: 52f27cda05 ("zink: allow direct memory mapping for any COHERENT+CACHED buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
6452849b11 zink: block batching of unordered barriers if previous usage was write
in the case where a cmdbuf was submitted with write access and the subsequent
batch promotes an op to unordered, it's important for associated barriers
to happen-before those ops to guarantee synchronization

the fixes tag is wrong on this, but it's all in the same release

Fixes: bf0af0f8ed ("zink: move all barrier-related functions to c++")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
9b4b0911ee zink: disable batched unordered barries with ZINK_DEBUG=noreorder
another improvement for debugging

Fixes: bf0af0f8ed ("zink: move all barrier-related functions to c++")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
4b7245284d zink: flush INDIRECT_BUFFER mem barrier for compute
this is usable in gfx and compute, so don't desync

Fixes: 3674839d11 ("zink: batch mem barrier hooks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
5149b2a938 zink: unbind the ssbo slot being iterated, not the index of the buffer
this otherwise breaks ssbo binding

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
2f0749f8fd zink: use an intermediate variable for binding ssbo slots
this makes the bug more obvious

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
ecb4e6af21 zink: delete unnecessary pipeline stage flags from inference
I added these for completeness, but zink will never use them

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
98c411a2a1 zink: add PERSISTENT for db buffer maps
Fixes: 13c6ad0038 ("zink: use a single descriptor buffer for all non-bindless types")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Mike Blumenkrantz
8e75378a2d zink: delete persistent map tracking
this was never needed and never did anything: zink only uses COHERENT
memory, which is always available on queue submission, so it was all
just pointless code

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
2023-05-09 00:56:19 +00:00
Jesse Natalie
ebe3b91ca0 microsoft/compiler: Avoid integer divides by 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22787>
2023-05-09 00:33:59 +00:00
Jesse Natalie
a6ac1f5fbd spirv2dxil: Lower large temps to scratch
WARP has a temp register limit, and the control flow needed to convert
indirect to direct accesses on large temps ends up bloating shaders massively.
We can just go ahead and spill these large temps to scratch, which maps
to an alloca in DXIL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22787>
2023-05-09 00:33:59 +00:00
Jesse Natalie
a4ce095bad dzn: Use A4B4G4R4 instead of B4G4R4A4 when available
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22911>
2023-05-09 00:17:16 +00:00
Mike Blumenkrantz
95df5f2e8c zink: stringify unsupported prim restart log error
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22760>
2023-05-08 23:34:27 +00:00
Mike Blumenkrantz
e205a4839b zink: allow vk 1.2 timelineSemaphore feature if extension isn't supported
this is a weird case but whatever

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22760>
2023-05-08 23:34:27 +00:00
Jesse Natalie
421546c60d ci/windows: Pick up WARP 1.0.6 NuGet with lots of dzn fixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22908>
2023-05-08 22:58:58 +00:00
Axel Davy
17fe6d1252 frontend/nine: Add debug driconf var force_features_emulation
This is useful to debug drivers to be able to
disable all specific d3d9 features and always trigger
the emulated path.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:21 +00:00
Axel Davy
824fad18b3 frontend/nine: Fix shader cap test for POSITIONT
This feature is almost never used in programmable
shaders so no issue was ever reported.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:21 +00:00
Axel Davy
2c8eb27e2c frontend/nine: Implement backup support for clip planes
Implement backup support for clip planes.
Driver support is still preferred, as the driver
can reuse the compilation of the core of the shader
to generate variants.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:21 +00:00
Mike Blumenkrantz
7a3b2f9485 tgsi_to_nir: handle PIPE_CAP_NIR_COMPACT_ARRAYS for clipdistance
drivers that set this cap require clipdistance to be passed as an
array of floats, so convert the existing stores during finalize

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:21 +00:00
Axel Davy
f0e9c225d8 docs/gallium: Clarify PIPE_CAP_CLIP_PLANES
Drivers with PIPE_CAP_CLIP_PLANES set to 0,
such as zink, ignore clip_plane_enable.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:21 +00:00
Axel Davy
3d5f3c5178 frontend/nine: initialize force_color_in_centroid
The first version of the shader didn't have proper
force_color_in_centroid field set.

That won't make much a difference (centroid is very
similar to no centroid) but it is still better.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:21 +00:00
Axel Davy
2f5f388a2c frontend/nine: Get rid of INTERPOLATE_COLOR
Some drivers don't handle it, and those who do replace it anyway
depending on the rasterizer setting. Keep the rasterizer setting
but replace the interpolation flag accordingly.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Axel Davy
33bb1e0410 frontend/nine: Enforce legacy pow behaviour
Gallium drivers used to implement the legacy behaviour.
It's not the case of all recent drivers, so implement
the legacy behaviour in nine.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Axel Davy
77c0230006 frontend/nine: Print warning incomplete position_t support
What would be missing for position_t to work in
vs programmable shaders when VS_WINDOW_SPACE_POSITION
is unavailable is to apply the inverse viewport transformation
similarly to what is done for ff vs.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Axel Davy
372c4549f4 frontend/nine: Improve VS_WINDOW_SPACE_POSITION fallback
Previously we would implement position_t by
applying the inverse of the viewport, and
advertising clipping was going to occur with
the cap CLIPTLVERTS.

However when the cap is advertised, clipping
is supposed to be disabled via sw emulation
when D3DRS_CLIPPING is set to FALSE.

Since we don't support that either, instead take the
approach of disabling at least depth clipping, and
not advertising the cap.

Ideally, clipping should be totally disabled.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Axel Davy
98a51b7794 frontend/nine: Implement backup support for pointsize
Improve support for drivers that don't support the
pointsize states.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Axel Davy
87fd0f29fc frontend/nine: Implement alpha test backup support
Implement alpha test emulation for drivers without support.

Driver support is still a preferred option, as driver
can reuse the compilation of the main core of the shader
to generate shader variants.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8315

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Axel Davy
31fe84f2bc frontend/nine: Drop max_ps_const_f
Replace max_ps_const_f with a constant.
In practice it already was always the
same value no matter the hw.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>
2023-05-08 21:41:20 +00:00
Mike Blumenkrantz
b4ea6adda5 zink: don't init mutable for swapchain src during blit
fixes #8993

cc: 23.1 <mesa-stable>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22876>
2023-05-08 21:17:17 +00:00
Mike Blumenkrantz
d2c63624c1 zink: don't init mutable resource bit for swapchain images
these are either already mutable (for srgb) or invalid usage

fixes #8970

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22876>
2023-05-08 21:17:17 +00:00
Lionel Landwerlin
cb8a878b53 intel: enable protected context creation along with engines
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22898>
2023-05-08 20:40:20 +00:00
Connor Abbott
cbc1c6a16f tu: Expose VK_EXT_fragment_density_map
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
761a1e9863 tu: Don't allow importing/exporting subsampled images with modifiers
Right now subsampled images are the same as non-subsampled images, this
will change when we actually implement them which will be an ABI break.
Disallow importing/exporting them with modifiers until that's stabilized
to force users to match the driver UUID.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
cc33082d00 tu/autotune: Always prefer GMEM with fragment density maps
If we encounter an app doing bad things where we want sysmem, we can fix
that later, but this seems like the right thing to do initially.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
6f2be52487 tu, ir3: Handle FDM shader builtins
Also, add the necessary transform to fixup gl_FragCoord.xy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
b474ed1f3a nir, ir3: Add option to use unscaled FragCoord for input attachments
When rendering a scaled tile, we need to use the original, hardware
FragCoord when accessing input attachments that are on-tile (i.e. were
rendered to in a previous subpass) because they are also scaled in the
same way that FragCoord is scaled. For input attachments that aren't
already on-tile, however, we need to use the fixed gl_FragCoord. Add a
new intrinsic and a bitfield of input attachments which should use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
715327ff85 tu: Implement FDM scaled loads/stores
In addition to scaling the rendering itself, we need to scale
loads/stores except when using subsampling, but subsampling isn't
implemented yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
fec372dfa5 tu: Implement FDM viewport patching
We scale the actual rendering by patching the viewport state. This is
helped by a HW bit to make the viewport index equal to the view index,
so that we can have a different scaling per-view.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
17c732f531 ir3: Record whether a shader writes gl_ViewportIndex
This will be needed by turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
05f96dd00f tu: Add core FDM patchpoint infrastructure
FDM is implemented pretty much entirely inside the driver, by patching
various structures for each bin. This adds the core infrastructure to
sample the density map, compute the scaled bin sizes we will use, create
patchpoints, and apply them at the start of each bin before executing
the IB2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
ebb8e104a5 tu/cs: Add support for CS patching
In order to patch the command stream on the gpu, we need two features:

1. The ability to use a read-write BO instead of a read-only one, when
   patching might be performed.
2. The ability to get the iova of the current position after reserving
   some number of dwords, even with externally-allocated command
   streams.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
2aa3dc3bd0 tu: Implement sampling the fragment density map
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
64daede1c3 tu: Parse fragment density map attachment info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:26 +00:00
Connor Abbott
ab75e0a126 freedreno/a6xx: Document per-view viewport in GRAS_SU_CNTL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:25 +00:00
Connor Abbott
768dcc7a27 tu: Make dynamic viewport and scissor count more accurate
Because we delay emitting them until we know the pipeline, we can track
the actual count instead of taking the max.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:25 +00:00
Connor Abbott
0f33d0392a tu: Merge RB_DEPTH_CNTL and RB_STENCIL_CONTROL drawstates
We're again running out of draw states, and this matches what gallium
does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
2023-05-08 19:59:25 +00:00