Commit Graph

152944 Commits

Author SHA1 Message Date
Jason Ekstrand 7f1e82306c anv: Switch to the new common pipeline cache
This patch is intended to be somewhat minimal.  There's a lot of cleanup
work that can be done but we'll leave that to later patches.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand c551f6c4df anv: Rename a fail label in CreateDevice
The rest of them are labeled with the thing they need to destroy first,
not the thing that failed.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand 93d0c66b27 vulkan/pipeline_cache: Add helpers for storing NIR in the cache
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand 591da98779 vulkan: Add a common VkPipelineCache implementation
This is partly copied+pasted from ANV but is mostly new code with lots
of reference counting bugs fixed (I hope!).  The new cache caches
"object" which derive from a base vk_pipeline_class_object struct.  It
uses a kernel-style "ops" interface for virtual methods on these objects
to allow for easy destruction (when the reference count hits zero) as
well as serialization an deserialization interfaces.  This should allow
drivers to cache basically whatever they want without having to think
too hard about the details.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand 21a7b0f1ab util/set: Respect found in search_or_add_pre_hashed
Fixes: 491e7decad "util/set: add the found param to search_or_add"
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand 96944c8f65 util/blob: Add align helpers
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Marek Olšák c4ca059dee ac/surface: fix an addrlib race condition on gfx9
Addrlib calls GetMetaEquation, which generates and saves address equations
in a global table that is not thread safe.

Fixes: df2cbdd2e3 - amd/addrlib: expose DCC address equations to drivers
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6361

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16091>
2022-04-22 19:12:03 +00:00
Marek Olšák f7a77ff900 nir: fix an uninitialized variable valgrind warning in nir_group_loads
pass_flags is only initialized for grouped loads, so change the order

Fixes: 33b4eb149e - nir: add new SSA instruction scheduler grouping loads into indirection groups

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16090>
2022-04-22 18:18:09 +00:00
Pierre-Eric Pelloux-Prayer fcc499d5e1 ac/surface: adjust gfx9.pitch[*] based on surf->blk_w
This is the same as 8275dc1ed5, but since gfx9.pitch[...] is
used for linear surfaces since 86262b6eac we need to update
it as well.

Fixes: 86262b6eac ("radeonsi,radv: fix usages of surf_pitch")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16053>
2022-04-22 17:21:47 +00:00
Dylan Baker 2766972911 util: remove simple_list
Down to two invasive linked list implementations in Mesa!

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:58 -07:00
Dylan Baker 928f02195e llvmpipe: replace uses of simple_list.h with list.h
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:57 -07:00
Dylan Baker 255a4d55c6 llvmpipe: cleanup trailing whitespace
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:55 -07:00
Dylan Baker 04082fbe24 gallium/draw: use list.h instead of simple_list.h
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:54 -07:00
Dylan Baker d9d092696d gallium/draw: remove trailing whitespace
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:53 -07:00
Dylan Baker 4ac2503b7a gallium/util/u_cache: replace simple_list.h with list.h
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:51 -07:00
Dylan Baker 1221e678ba gallium/util/u_cache.c: remove trailing whitespace
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:49 -07:00
Dylan Baker 0ae787f223 util/list.h: add a function to move an item in a list
This allows for a 1:1 replacement of simple_list move_to_head (though
I've tried to make this function more generally useful.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:47 -07:00
Dylan Baker 4b47e0e125 gallium/driver_trace: remove simple_list.h
Which isn't actually used

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:45 -07:00
Dylan Baker dac8dc9ece gallium/rbug: replace simple_list.h with list.h
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:43 -07:00
Dylan Baker 820e6e01fd r300: remove unused simple_list.h
It's unused, so let's not include it.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:41 -07:00
Dylan Baker 36a9655d50 winsys/radeon: remove unused simple_list.h
It's not used, so let's not include it.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:31 -07:00
Mike Blumenkrantz fbece25a45 zink: add synchronization for buffer clears
cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16098>
2022-04-22 14:41:15 +00:00
Mike Blumenkrantz 06df3ed5c0 zink: fix stride=0 for dynamic state vertex stride checking
this case shouldn't trigger the fully-baked fallback since it's
legal with dynamic state

Fixes: 1eada1b02d ("zink: selectively disable dynamic vertex stride")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16098>
2022-04-22 14:41:15 +00:00
Illia Abernikhin dd24ab86cc vulkan/runtime: repair thread safety in method vk_queue_start_submit_thread()
Accessing queue->submit.thread_run without holding lock vk_queue.submit.mutex.
Elsewhere, vk_queue.submit.thread_run is accessed with vk_queue.mutex
held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).

Found by Coverity.
CID: 1503334

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15736>
2022-04-22 14:15:29 +00:00
Pierre-Eric Pelloux-Prayer ca40bad84a ac/spm: setup write broadcasting correctly
Based on PAL's PerfExperiment::BuildGrbmGfxIndex method.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:51:44 +02:00
Pierre-Eric Pelloux-Prayer 77116d34ea radeonsi: make sure profile_peak is used before using sqtt
Using sqtt without this profile can cause hangs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:51:44 +02:00
Pierre-Eric Pelloux-Prayer c96ee36289 radeonsi/sqtt: enable spm counters on gfx10+
Tested on:
  - navi10: L0 cache counter doesn't work (always 0)
  - sienna_cichlid: L0 doesn't work (always 0) and L1 isn't visible in RGP

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:51:44 +02:00
Pierre-Eric Pelloux-Prayer e5e8b56236 radeonsi/sqtt: setup spm bo
The hardware will write SPM counters to this bo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:12:10 +02:00
Pierre-Eric Pelloux-Prayer a884f36949 radeonsi: add spm counters setup code
Based on radv_spm.c and PAL.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:12:08 +02:00
Pierre-Eric Pelloux-Prayer bb16154d94 radeonsi: add helpers to deal with spm counters
Based on radv_perfcounter.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:12:06 +02:00
Pierre-Eric Pelloux-Prayer 0d733e940b radeonsi: make si_pc_emit_shaders non static
Also pass "cs" as a param to allow updating a specific cs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>
2022-04-22 13:11:45 +02:00
Boris Brezillon e018311b35 dzn: Add KHR_draw_indirect_count support
Unfortunately it's not as simple as passing the indirect draw count
buffer to ExecuteIndirect. The compute job that populate the execute
buffer also needs to know the number of entries that need to be
patched. Instead of transitioning the indirect count buffer from
GENERIC_READ to INDIRECT_ARGUMENT we just keep at as a read-only
resource and copy the draw_count value to the exec buffer in the
compute job.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15914>
2022-04-22 10:01:51 +00:00
Boris Brezillon ece5e27a7f dzn: Allow multiDrawIndirect and drawIndirectFirstInstance
Those are already supported, let's just toggle the switch.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15914>
2022-04-22 10:01:51 +00:00
Juan A. Suarez Romero 697e98c66e v3dv: duplicate key on hashtable insert
The key is created on stack, so as soon as the function returns this key
is lost, so the inserted key in the hashtable is invalid.

Rather, insert a duplicated version on heap.

This fixes a stack-buffer-overflow when running some Vulkan CTS tests.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16083>
2022-04-22 09:18:15 +00:00
Juan A. Suarez Romero 39cebe24ae gallium: move get_canonical_format hook to pipe_screen
pipe_context shouldn't have functions that return values because this
prevent multithreading.

Move this hook to pipe_screen.

Fixes: 606e42027e ("gallium: add hook on getting canonical format")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16078>
2022-04-22 08:51:56 +00:00
Boris Brezillon e293691a99 dzn: Get rid of the render pass logic
The core provides generic render-pass -> dynamic-rendering wrappers,
so let's rely on them instead of implementing our own logic.

Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>
2022-04-22 01:07:51 -07:00
Boris Brezillon 2d0798440b dzn: Add support for dynamic rendering
This is how D3D12 works, so nothing really complicated here. We just
add a bunch of states to the render state, patch the pipeline building
logic to support dynamic rendering, and add new functions to

Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>
2022-04-22 01:07:49 -07:00
Boris Brezillon 076eac0e62 dzn: Inline dzn_cmd_buffer_clear_attachments()
It's only called from dzn_CmdClearAttachments(), so let's move the
code there.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>
2022-04-22 01:07:22 -07:00
Boris Brezillon 70b06e775b dzn: Move all render-related states to a substruct
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>
2022-04-22 01:07:22 -07:00
Boris Brezillon d3836df8d4 dzn: Set MAX_RTS to D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT
D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT == 8, so no functional change
here, it's just cleaner to use the D3D12 definition.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>
2022-04-22 01:07:22 -07:00
Boris Brezillon 39851688df dzn: Pass an image view to dzn_cmd_buffer_clear_attachment()
Let the caller extract the image view from the attachment index, so
we can make this function framebuffer-agnostic and re-use it in the
dynamic rendering path.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>
2022-04-22 01:07:22 -07:00
Boris Brezillon 3420110ee7 dzn: Advertise KHR_shader_draw_parameters
We already pass those parameters to shaders, so let's advertise the
feature.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>
2022-04-22 07:31:44 +00:00
Boris Brezillon 2eadd8dd16 dzn: Update the draw_id sysval when issuing indirect draws
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>
2022-04-22 07:31:44 +00:00
Boris Brezillon 02d8436bbd dzn: Simplify the triangle_fan_rewrite_index shader
We don't need the first_vertex argument when turning non-indexed
triangle-fan draws into indexed triangle-list ones, the firstVertex
argument can simply be passed as a vertexOffset.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>
2022-04-22 07:31:44 +00:00
Boris Brezillon 1cefda7cb4 dzn: Fix exec_buf_stride calculation
The stride depends on the indirect draw arguments which are different if
triangle-fan emulation is required.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>
2022-04-22 07:31:44 +00:00
Boris Brezillon 7673697256 microsoft/spirv_to_dxil: Add a draw_id field to vertex_runtime_data
So we can support the draw_id system value.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>
2022-04-22 07:31:44 +00:00
Samuel Pitoiset 5121e6dd7e radv: only apply enable_mrt_output_nan_fixup for 32-bit float MRTs
This is incorrect for 32-bit integer MRTs which are clamped to the
maximum value of the format, and returning 0 can break some shaders.

This fixes a rendering issue with RAGE2.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4329
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/16080>
2022-04-22 06:49:46 +00:00
Dylan Baker d839d37642 docs: update calendar for 22.1.0-rc2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16089>
2022-04-21 21:33:05 -07:00
Dylan Baker 5afa2cb0b3 docs: update calendar for 22.1.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16089>
2022-04-21 21:33:05 -07:00
Dylan Baker cdfece6123 docs: update calendar and link releases notes for 22.0.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16089>
2022-04-21 21:33:05 -07:00