Commit Graph

898 Commits

Author SHA1 Message Date
Samuel Pitoiset 9ea4029f9f Revert "radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets.""
The most famous RADV revert over the past months. This was an issue
in RADV and not an use-after-free (descriptor set layouts can be
destroyed almost at any time).

This reverts commit b775aaff1e.

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/14621>
2022-02-07 08:24:36 +01:00
Samuel Pitoiset 66f7289d56 radv: add reference counting for descriptor set layouts
The spec states that descriptor set layouts can be destroyed almost
at any time:

   "VkDescriptorSetLayout objects may be accessed by commands that
    operate on descriptor sets allocated using that layout, and those
    descriptor sets must not be updated with vkUpdateDescriptorSets
    after the descriptor set layout has been destroyed. Otherwise,
    descriptor set layouts can be destroyed any time they are not in
    use by an API command."

Based on ANV.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5893
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/14621>
2022-02-07 08:24:36 +01:00
Samuel Pitoiset 52c850445e radv: stop setting streamout state when a new pipeline is bound
It's required to have a valid graphics bound pipeline with XFB when
vkCmdBeginTransformFeedbackKHR() is called. This removes extra work
when binding a pipeline.

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/14610>
2022-02-03 07:57:07 +00:00
Samuel Pitoiset a0e8b774fc radv: stop checking if pipelines are NULL during draws/dispatches
This can't happen.

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/14617>
2022-01-24 11:15:00 +00:00
Samuel Pitoiset 447cddd455 radv: fix copying VRS rates if the ds attachment uses mips
While the VRS image can't have mips (and no layers because still not
supported by RADV), applications might still want to bind a
depth/stencil attachment where the base level isn't 0.

Found by inspection.

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/14518>
2022-01-24 08:06:38 +00:00
Samuel Pitoiset 86909babc9 radv: fix copying VRS rates to HTILE if the depth/stencil is cleared
If the application binds a fragment shading rate attachment to a
subpass and also clears the depth stencil attachment, the VRS rates
would have been reinitialized to 1x1 with fast clears. It makes more
sense to clear and then copy instead of the opposite.

Found by inspection.

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/14518>
2022-01-24 08:06:38 +00:00
Samuel Pitoiset 49c1b40290 radv: only clear VRS_HTILE_ENCODING on GFX10.3+
On older chips like GFX9, bit 19 is RB_ALIGNED.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5859
Fixes: 9c746157ae ("radv: reset VRS if the current subpass doesn't have a VRS attachment")
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/14530>
2022-01-13 12:57:39 +00:00
Samuel Pitoiset 9cd8908c03 radv: fix computing the fb size in presence of dynamic VRS attachment
This fixes
dEQP-VK.fragment_shading_rate.dynamic_rendering.attachment_rate.*.

Fixes: e914a6710f ("radv: Expose the VK_KHR_dynamic_rendering extension.")
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/14421>
2022-01-12 11:16:31 +00:00
Samuel Pitoiset 9c746157ae radv: reset VRS if the current subpass doesn't have a VRS attachment
With a scenario like:
BeginRP(DS + VRS att)
Draw()
EndRP()
BeginRP(same DS)
Draw()
EndRP()

The second draw shouldn't use VRS but it did because the VRS bit
is always set during DS surface initialization if a surface can use VRS.
So, it would have been using the previous copied VRS rates.

Found by inspection.

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/14443>
2022-01-12 10:22:29 +00:00
Samuel Pitoiset ec4dcd53db radv: stop checking if dynamic states changed
This is costly for the CPU and might hurt "good" applications that
already avoid that like DXVK/vkd3d-proton.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5009
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/12441>
2022-01-12 09:48:29 +00:00
Timur Kristóf d34d0f38e1 radv: Support VRS for mesh shaders.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14193>
2022-01-04 17:46:02 +00:00
Samuel Pitoiset d659c2ef9c radv: save the vertex prolog to the trace BO for debugging
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13376>
2022-01-04 07:50:07 +00:00
Timur Kristóf f2dd1fbc63 radv: Implement NV_mesh_shader draw calls.
The NV indirect command buffer format is not supported by
the hardware, so we have to emit several copy packets to
make it work.

Otherwise it works by emulating the number of launched
MS workgroups by setting the number of "input vertices".

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13580>
2021-12-31 13:05:09 +00:00
Timur Kristóf 7ae425c5d4 radv: Add support for mesh shading pipelines in the command buffer.
- Prefetch mesh shaders
- Flush mesh shader descriptors
- Assert that input assembly, etc. are ignored.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13580>
2021-12-31 13:05:09 +00:00
Samuel Pitoiset 34151f9be9 radv: fix clears with value of "1" and different DCC signedness
For example, if the driver clears a view of SINT with 127 and the image
format is UNORM, the hw fills "1" instead of the clear value
(127.0f / 255.0f). This CB feature is GFX9+ only.

This should fix test_typed_srv_cast_clear from vkd3d-proton once it
correctly sets the MUTABLE flag (which is still buggy as of c0a3fa8a).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5676
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/14228>
2021-12-28 16:35:51 +00:00
Samuel Pitoiset b775aaff1e radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets."
Uplay needs this to avoid a crash because it does an use-after-free
of a descriptor set layout. This was initially introduced by Bas to
workaround a similar issue with Baldur's Gate 3, it seems needed again.

Cc: 21.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5789
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/14318>
2021-12-28 15:56:55 +01:00
Samuel Pitoiset ac8afe3f44 radv: fix dynamic rendering global scissor
Make sure to clamp the global scissor to the render area.

This fixes dEQP-VK.draw.dynamic_rendering.*oversized.

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/14170>
2021-12-17 16:51:00 +00:00
Samuel Pitoiset 9a388beda7 radv: ignore dynamic inheritance if the render pass isn't NULL
From the Vulkan spec:

    "If the pNext chain of VkCommandBufferInheritanceInfo includes a
     VkCommandBufferInheritanceRenderingInfoKHR structure, then that
     structure controls parameters of dynamic render pass instances
     that the VkCommandBuffer can be executed within. If
     VkCommandBufferInheritanceInfo::renderPass is not VK_NULL_HANDLE,
     or VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not
     specified in VkCommandBufferBeginInfo::flags, parameters of this
     structure are ignored."

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/14109>
2021-12-13 10:48:44 +00:00
Samuel Pitoiset 841949e50b radv: fix dynamic rendering inheritance if the subpass index isn't 0
The driver will always create only one subpass in the render pass
for inheritance but the subpass index isn't always zero.

This fixes dEQP-VK.multiview.dynamic_rendering.secondary_cmd_buffer*.

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/14109>
2021-12-13 10:48:44 +00:00
Samuel Pitoiset e2ad92eb22 radv: do not perform depth/stencil resolves for suspended render pass
From the Vulkan spec:

    "Store and resolve operations are only performed at the end of a
     render pass instance that does not specify the
     VK_RENDERING_SUSPENDING_BIT_KHR flag."

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/14112>
2021-12-10 22:03:00 +00:00
Samuel Pitoiset d2612bb424 radv: fix resume/suspend render pass with depth/stencil attachment
Shouldn't clear on resume.

This fixes dEQP-VK.dynamic_rendering.*resuming.

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/14113>
2021-12-08 09:06:27 +00:00
Samuel Pitoiset 31ad50d989 radv: fix dynamic rendering with VRS
The structure type was wrong. This fixes a bunch failures in
dEQP-VK.fragment_shading_rate.dynamic_rendering.*.

Fixes: 7f3aba37d2 ("radv: Support Begin/EndRendering.")
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/14106>
2021-12-07 17:30:47 +00:00
Samuel Pitoiset 92d84f189c radv: constify radv_vs_input_state() in more places
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/13857>
2021-12-07 14:27:29 +00:00
Samuel Pitoiset b83caef6d2 radv: constify radv_vertex_binding in CmdSetVertexInputEXT()
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/13857>
2021-12-07 14:27:29 +00:00
Samuel Pitoiset 45f181c482 radv: move a comment at the right place in CmdBindVertexBuffers2EXT()
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/13857>
2021-12-07 14:27:29 +00:00
Bas Nieuwenhuizen 483a08d552 radv: Support dynamic rendering inheritance info.
Straightforward, just converting to a renderpass as well. Note that
we now own the renderpass so I also added a bool to check if we own
it so we can destroy it after recording.

Doing the destruction at destroy & reset time, as reset can be called
during recording, and destroy all the time.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13721>
2021-12-05 17:21:32 +00:00
Bas Nieuwenhuizen 7f3aba37d2 radv: Support Begin/EndRendering.
This is just the naive implementation that create a new renderpass
and then destroys it at the end.

I do it this way because in meta operations we are still creating
temporary subpasses for a renderpass for e.g. the resolve.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13721>
2021-12-05 17:21:32 +00:00
Samuel Pitoiset 3fa2220838 radv: upload shader binaries of a pipeline contiguously in memory
RGP expects shaders to be contiguous in memory, otherwise it explodes
because we have to generate huge captures with lot of holes.

This reduces capture sizes of Cyberpunk 2077 from ~3.5GiB to ~180MiB.

This should also help for future pipeline libraries.

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/13690>
2021-12-02 07:17:04 +00:00
Bas Nieuwenhuizen 577a0a7352 radv: Don't emit framebuffer state if there is no renderpass active.
The framebuffer state could still be dirty from when the previous
renderpass was bound.

Fixes: 5632359959 ("radv: Remove the skipping of framebuffer emission if we don't have a framebuffer.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5702
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13969>
2021-12-02 00:35:28 +00:00
Samuel Pitoiset 8f00f19da5 radv: fix resetting the entire vertex input dynamic state
If there is holes, eg. the application firsts set vertex attributes
0 and 1, then vertex attributes 0 and 7, the format of vertex attribute
1 is still the previous one, while it should be FORMAT_INVALID to avoid
a GPU hang.

This fixes a GPU hang with Yuzu.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5627
Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13856>
2021-11-30 15:10:39 +00:00
Samuel Pitoiset 3bbc226d7a radv: configure the number of SGPRs/VGPRs directly from the arguments
Instead of copying the values to radv_shader_info.

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/13542>
2021-11-29 10:10:06 +00:00
Samuel Pitoiset 52b4185012 radv: switch the remaining stages/access to VK_PIPELINE_STAGE_2/VK_ACCESS_2
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/13549>
2021-11-26 13:41:23 +00:00
Samuel Pitoiset 936ac58b77 radv: add support for new pipeline stages and access masks
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/13549>
2021-11-26 13:41:22 +00:00
Samuel Pitoiset 8df17163c7 radv: implement vkCmdWaitEvents2KHR()/vkCmdPipelineBarrier2KHR()
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/13549>
2021-11-26 13:41:22 +00:00
Samuel Pitoiset 57575974fd radv: implement vkCmdWriteBufferMarker2AMD()
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/13549>
2021-11-26 13:41:22 +00:00
Samuel Pitoiset cff81c863b radv: implement vkCmd{Reset,Set}Event2KHR()
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/13549>
2021-11-26 13:41:22 +00:00
Samuel Pitoiset d18720897f radv: fix OOB access for inline push constants detected by UBSAN
src/amd/vulkan/radv_cmd_buffer.c:3232:75: runtime error: index 252 out
of bounds for type 'uint8_t [128]'

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13951>
2021-11-25 16:15:30 +00:00
Bas Nieuwenhuizen cf6a14de0c radv: Set RB+ registers correctly without framebuffer.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13699>
2021-11-24 18:22:10 +00:00
Bas Nieuwenhuizen 5632359959 radv: Remove the skipping of framebuffer emission if we don't have a framebuffer.
This was plain broken. The solution is to not require any framebuffer
changes. Silently skipping results in broken behavior. e.g:

(secondary cmdbuffer with no framebuffer)
ClearAttachment 2

translated into

bind attachment 2 as attachment 0 (skipped)
clear attachment 0
restore original bindings (skipped)

which results in clearing attachment 0, not what we wanted. It is
a small wonder CTS doesn't find it until VK_KHR_dynamic_rendering.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13699>
2021-11-24 18:22:10 +00:00
Samuel Pitoiset aee25471b9 radv: fix emitting VBO when vertex input dynamic state is used
In the following scenario:
    CmdBindPipeline()
    CmdBindVertexBuffers()
    CmdSetVertexInput()
    CmdDraw()
    CmdBindVertexBuffers()
    CmdSetVertexInput()
    CmdDraw()

The VBO won't be updated for the second draw because the state is
cleared when the dynamic state is emitted and the pipeline isn't dirty.

Found by inspection.

Cc: 21.3 mesa-stable
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/13855>
2021-11-23 08:39:13 +00:00
Samuel Pitoiset e94a899c0e radv: fix a sync issue on GFX9+ by clearing the upload BO fence
If the same cmdbuf is submitted more than once, they were waiting on
the same fence value. Fix this by clearing the value when beginning
a new command buffer.

This might fix spurious GPU hangs, especially on GFX9.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5401
Cc: 21.3 mesa-stable
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/13777>
2021-11-15 09:59:53 +01:00
James Park 0aaaee09a4 radv: Match function definitions to declarations
Fixes compiler errors for 32-bit Windows.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13749>
2021-11-12 09:46:10 +00:00
Samuel Pitoiset e04101c34e radv: only emit PGM_LO for the vertex prolog
Shaders are allocated in the 32-bit address space.

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/13551>
2021-11-09 10:13:38 +00:00
Samuel Pitoiset 984091531e radv: remove unused parameter in radv_emit_subpass_barrier()
It got introduced by "radv: optimize subpass barrier flushes for
imageless framebuffers" but never used in the final version.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13702>
2021-11-08 18:10:49 +00:00
Timur Kristóf b59614619b radv: Use MESA_VULKAN_SHADER_STAGES to make room for mesh/task.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13440>
2021-11-04 13:32:07 +00:00
Joshua Ashton af8fa2644e radv: Split off cmd_buffer variant of descriptor set template updates
Assumes cmd_buffer != NULL for this path to eliminate the checks in the generic code.

Benchmarks:

I made a microbenchmark based on Bas' vulkan microbench suite.

https://gitlab.freedesktop.org/bnieuwenhuizen/vulkan_microbench/-/merge_requests/1

In this benchmark, this improves vkDescriptorTemplateUpdate performance consistently by 36%.

-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
DescriptorTemplateUpdate       81.2 ns         81.2 ns      8573169

->

-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
DescriptorTemplateUpdate       52.9 ns         52.9 ns     13306065

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13342>
2021-11-04 05:50:54 +00:00
Joshua Ashton 4865cb6514 radv: Split off cmd_buffer variant of descriptor set updates
Assumes cmd_buffer != NULL for this path to eliminate the checks in the generic code.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13342>
2021-11-04 05:50:48 +00:00
Samuel Pitoiset e15e3a8e86 radv: optimize subpass barrier flushes for imageless framebuffers
The driver should always know the attachments at this point. This
should reduce the number of L2 cache flushes for imageless framebuffers.

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/13291>
2021-11-03 08:26:43 +01:00
Bas Nieuwenhuizen d66514aacc radv: Disable coherent L2 optimization on cards with noncoherent L2.
With high likelihood we are forgetting to set the noncoherent bits
somewhere but I don't have the HW to debug. To avoid user pain
disable this optimization on these GPUs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5505
Fixes: fd8210f27e ("radv: Try to do a better job of dealing with L2 coherent images.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13620>
2021-11-01 23:48:43 +00:00
Samuel Pitoiset 9b80f4d5f2 radv: rename radv_shader_variant to radv_shader
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/13548>
2021-11-01 20:04:45 +00:00