Commit Graph

178205 Commits

Author SHA1 Message Date
Charmaine Lee
2f6497c50a svga: fix immediates used in rawbuf for constant buffer
Since constant buffers can be accessed as raw buffers, indices to
the constant buffers will have to be declared as immediates.
But it is a waste to define immediates for every possible indices
to the constant buffer, we will only include immediates that are used in
the shader. But since immediate block is declared in a very early stage
of a shader, this patch will append any new immediates to the immediate
list and reemit the immediate block if needed.

Fixes assertion running yuzu

Reviewed-by: Maaz Mombasawalam <mombasawalam@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Charmaine Lee
d6b9a0a997 svga: restrict use of rawbuf for constant buffer access to GL43 device
Restrict use of rawbuf for constant buffer access to GL43 capable
device only.

Fixes glretrace regressions running with SW Renderer.

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Charmaine Lee
b46526b7a4 svga: fix persistent mapped surface update to constant buffer
Currently when a buffer is mapped with the persistent bit set and is
later bound as a constant buffer, the updated buffer content is not
properly updated to the constant buffer surface as the constant buffer
surface is different from the original buffer surface. Doing
a buffer copy to sync the content of the constant buffer will fix
the problem, but the buffer copy can be costly.
To properly fix the issue, instead of creating a secondary surface
for the constant buffer, the original buffer surface will be accessed as
a raw buffer.

This fixes the rendering issue running yuzu deko_basic.nro

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Gert Wollny
4f96d2f6ba ci: Upref virglrenderer
Pull in the latest changes regarding texture wrapping
modes handling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25343>
2023-09-25 22:51:20 +00:00
Gert Wollny
9efe50c83b virgl: report MIRROR_CLAMP features better
The new host version checks the support of these features better,
so report here accordingly. This fixes a number of texwrap piglit
tests on Intel.

v2: Stick to old test for PIPE_CAP_TEXTURE_MIRROR_CLAMP because
    host has to be backward compatible.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25343>
2023-09-25 22:51:20 +00:00
Faith Ekstrand
733c07bba0 nvk: Advertise discreteQueuePriorities = 2
This is a lie since we don't do anything with queue priorities at
present but Vulkan requires us to advertise at least 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25383>
2023-09-25 22:06:26 +00:00
Faith Ekstrand
00b681058f nvk: Advertise maxMemoryAllocationCount = 4096
This is the minimum and also what the proprietary driver advertises.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25383>
2023-09-25 22:06:26 +00:00
Faith Ekstrand
59000decf4 nvk: Re-order physical device limits
They now match the order in vulkan_core.h which makes it easier to find
missing entries of which there was one.  This also fixes a bug where we
were setting .bufferImageGranularity twice and we were overwriting the
correct value with an incorrect one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25383>
2023-09-25 22:06:26 +00:00
Connor Abbott
f5b8b2f57a tu: Remove pipeline from state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
9efb0f3c7d tu: Don't use pipeline for active stages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
2cd93ea4a0 tu: Don't use pipeline for per_view_viewport
We already have the state in the command buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
630e60fae7 tu: Don't use pipeline for bandwidth validity
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
768b1eacc7 tu: Don't use pipeline for dynamic draw states
For dynamic states that are precompiled from static state, just set the
corresponding dynamic draw state directly, and keep a record of which
ones are precompiled when we go to emit states at draw time so we don't
accidentally re-emit them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
edce0af242 tu: Make compute dispatch use the shader
With this, the last use of the compute pipeline is gone. We still use
the pipeline for the load state, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
2d00b2b9c7 tu: Don't reference pipeline for some draw states
These draw states are things that depend on pipeline-only state:

- The load state depends on knowing the pipeline layout, which we won't
  know for a shader that's loaded from a binary. This is going away on
  a7xx anyway, and we should be able to use the a7xx strategy of
  prefetching the descriptors in the preamble on a6xx too.
- The prim order state depends on feedback loops and raster order
  attachment access, which isn't supported at the moment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
1d74af8bb6 tu: Rewrite remaining pipeline LRZ handling
Now that the FS-specific parts are split out, the only remaining part is
the blend state part. Use the same state that we use for dynamic
blending for static blending, eliminating the last use of the pipeline
in the LRZ code. While we're at it fix a bug where dynamic blending
didn't always disable LRZ writes (even though it only mattered with a
non-conformant debug flag because we invalidated LRZ anyway).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
41797b9e94 tu: Use pipeline feedback loop flag indirectly
Remove another use of the pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
419c4b8ece tu: Decouple program state from the pipeline
There are a couple pieces of state that we can't calculate until we know
all of the shaders:

- The actual variants to use (i.e. whether to use safe-const variants)
- Program config and VPC draw states
- Const layout, which depends on the variants
- Whether per-view viewports should be enabled

Now that these are all combined in tu_pipeline::program, move these into
a separate struct that can be referenced directly without a pipeline.
The next step is to refactor the code filling it out so that it can be
called at draw time when given just the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
26352d26bf tu: Rework passing shared consts
The way this works now is awkward to map to shader objects. We don't
have the pipeline layout when "linking" shaders at draw time, so we have
to piece it together from the shaders. Store the information we need in
the shaders and piece it together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
efaf77bbdd tu: Rewrite tessellation modes handling
Before this, we combined the modes after compiling the shaders when
constructing the pipeline. But that's a bit awkward with shader objects,
where there is no good place to put state derived from TCS and TES but
not the other stages. However, shader objects leaves us with an out:
when compiling separately, the modes must be on one of the shaders. So
instead we just copy the modes earlier, in the NIR shaders, and then get
them from the appropriate shader later. That way there is no extra
overhead when fast-linking, as there currently is, and we don't need to
create an awkward separate object just for this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
169a44d562 tu: Use shader directly for VS/TCS output size and patch size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
8810c89b44 tu: Move FS-specific pipeline information to the shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
df007dcfe7 tu: Start tracking shaders independently of pipeline
We will gradually transition over users of cmd->state.pipeline and
TU_CMD_DIRTY_PIPELINE to shaders and derived state from shaders. This
just puts in place the framework to start doing that.

When importing a library with all of the shader state, we now have to
import the shaders in addition to the program, so that they are
available when we bind the pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
0f022c3076 tu: Create singleton "empty" shaders
The most important of these is the empty FS, which should cut down on
time spent in the compiler when we fast-link a pipeline where there is
only a library with the VS and no library with the empty FS. Source
engine is known to do this.

This is also necessary for shader objects where the "empty" shaders are
never created up-front. We will use these when a NULL shader is bound.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Caio Oliveira
1020cf8a82 util: Add a few basic tests for linear_alloc
Not comprehensive, but those were the ones used to work on the
previous linear_alloc changes.  Also having a test already
set up lower the barrier to add more tests for future in case of
bugs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
591db9a9a5 util: Remove per-buffer header in linear alloc for release mode
There's only need to keep the offset and size of the latest buffer,
so rename linear_header into linear_ctx and change the code to
keep records there.

For debug mode we still keep a header, now called linear_node_canary,
to have a magic check.  Since due to alignment we have a free space,
also keep the individual occupation of each node (offset), for
debugging.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
c415da3dfc util: Remove size information from child allocations
With linear_realloc() gone, there's no code that reads the size
in linear_size_chunk struct, so it can be removed.  This removes
the 8-byte overhead per child allocation and simplifies the
allocation code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
8fc130783b util: Remove linear_realloc()
Now that linear_realloc() is unused, remove it.  It is not an actual
realloc, will always allocate new memory and copy data around -- and
had a big warning about it in the documentation.

In the couple of uses we had before, the client code knew the size,
so it could be changed to perform the allocation and the copy by
themselves.  The client code keeping the size is the recommended
way here.

This will allow us remove linear_size_chunk later.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
1486742b26 util: Remove usages of linear_realloc()
Note that for linear allocator, the realloc will always
allocate new memory.  In both cases that realloc was used,
the existing size was known, so we can just allocate
and do the copy ourselves.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
63ab985511 util: Use an opaque type for linear context
In the linear allocation only the parent (context) can be used
to allocate new children, so let's use an opaque type to identify
the linear context.  This is similar to what's done in GC allocator.

Update the documentation and a couple of function names to
refer to linear context instead of linear parent.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
b269cadf56 util: Make DECLARE_LINEAR_ALLOC_* macros assume no destructors
Linear allocator doesn't support calling custom destructors to
its child allocations nor freeing individual child allocations.
So the destructor callback and the delete operator don't apply
to objects using linear allocator.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
aec516ead6 util: Remove size from linear_parent creation
None of the callsites took advantage of this, so remove
the feature.  This will help to a next change that will
add an opaque type to represent a linear parent.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
4519421db5 util: Use linear parent to (r)allocated extra nodes
Instead of making all the nodes children of the same original
ralloc_ctx, use that context just for the first node (which
is the linear parent).  The remaining nodes are (r)allocated
using the first one.

With that change, to free/steal, it is sufficient to apply the
operation to the first node, which uses the underlying linked
list between the nodes at ralloc level.  And we can remove
the 'next' pointer in linear_header, now unused.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
6764689e0e util: Remove ralloc_parent from linear_header
We can reach the ralloc parent from the linear parent, since
it is what was used to allocate the linear parent in the first
place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Samuel Pitoiset
53d9312a5b radv/ci: skip dEQP-VK.robustness.* on Vangogh due to weird GPU hangs
For very weird reasons, this subset hangs on VanGogh only. It took a
while to figure out that and I can't reproduce on my Steam Deck. Skip
the whole subset for now until the issue is figured out to avoid
blocking the CTS update.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24947>
2023-09-25 15:53:51 +00:00
Samuel Pitoiset
a217c5c58c ci: update to vulkan-cts-1.3.6.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24947>
2023-09-25 15:53:51 +00:00
Konrad Dybcio
f4fecdad72 freedreno: Include speedbin fallback in 730 chipid to fix probing
The kernel exposes CHIP_ID, which consists of:

[63:48] const 0 / reserved
[47:32] speedbin (default 0xffff)
[31:0 ] actual gpu chip ID

Fix the 730 chip id to make it probe correctly.
Keep the existing entry for the downstream KGSL driver.

This is essentially the same as Commit 6067aba9e6 ("freedreno: Include
speedbin fallback in 740 chipid to fix probing"), except for the older
core.

Fixes: cd3719be7d ("freedreno: Fully define a730 and a740 device properties")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25375>
2023-09-25 15:00:58 +00:00
Rhys Perry
21db2e7017 aco: reset prefetch in the correct block after removing the exit
fossil-db (navi31):
Totals from 279 (0.35% of 79332) affected shaders:
(no stat changes)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: c778803d67 ("aco/assembler: change prefetch mode on GFX10.3+ during loops if beneficial")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25312>
2023-09-25 14:18:46 +00:00
Lionel Landwerlin
1c21b3a62a intel/ds: avoid dropping traces when running out of shared memory
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
00b65c75ad anv/utrace: trace CPU on timestamp buffer readiness
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
7d30b1e28f intel/ds: track number of tracepoint timestamp copies
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
64769bc5b2 util/u_trace: count number of tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
a5f58e5f85 intel/ds: lock submissions to u_trace_context
This allows for submissions to be outside the global anv_device mutex.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
a851dc5e3c intel: don't assume Linux minor dev node
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
6857497be6 anv: enable utrace timestamp buffer copies on compute engine
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
a334fb005b anv: move utrace flush out of backends
The next patch is going to introduce some locking that needs to happen
before the submission to the backend.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
08e0c063cf anv: move simple shaders code to its own object
We would like to call those function from anv_utrace.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
7a35113455 anv: add simple shader support without a command buffer
Limited to compute for now. Annoyingly Gfx9 requires a binding table
block.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
2cc5b3b1e0 anv: add a memcpy compute internal kernel
We'll use this memcpy utrace timestamp data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
e0f420c334 anv: fix utrace timestamp buffer copies
Fixes: 521c216efc ("anv: use COMPUTE_WALKER post sync field to track compute work")
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00