Commit Graph

145667 Commits

Author SHA1 Message Date
Connor Abbott 89263fde20 tu: Use common vk_image struct
This eliminates some boilerplate, and will be necessary to use the
common render pass implementation for debugging purposes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott cb0f414b2a tu: Add support for suspending and resuming renderpasses
This is unfortunately very complicated because we have to stitch
together the state of the suspended passes after the fact, with primary
command buffers at submit time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 0a4c86fc44 util/trace: Fix u_trace_*_iterator with no tracepoints
If u_trace is empty then there are no chunks, and we didn't account for
that case.

This fixes tracing some dynamic rendering tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 3aa20a4409 tu: Split out some state into a separate struct
These bits of state will have to be treated specially when
suspending/resuming a render pass, because they will need to be tracked
across command buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 9689433eee tu: Update more state with secondaries
Some of these are actually bugfixes, some like the drawcall information
are just for autotune so they are just performance fixes. However this
came from an audit into what state is used in CmdEndRenderPass().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 79c7c6e492 tu: Remove has_subpass_predication
The workaround this was used for was removed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott ed125e6cca tu: Initial support for dynamic rendering
Support for suspend/resume will be added later. This just sets up
the internal render pass, and adds support to pipeline creation and
secondary inheritance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 22be08a21e tu: Remove usage of RenderPassBeginInfo
More preparation for using this with dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott cf391db4c6 tu: Move tu_render_pass definition up
So that we can embed one in tu_cmd_buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 2b8b5259c7 tu: Disable GMEM for multiview inside tu_render_pass_gmem_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott c42e7aa46c tu: Move TU_DONT_CARE_AS_LOAD into attachment_set_ops()
So that we can share it with dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 907b892bb2 tu: Rewrite tess factor emission
Emit it at EndRenderPass time, if the renderpass has tessellation. This
avoids all the special handling for secondaries, will work with
suspended/resumed render passes, and will handle secondaries that
contain render passes which will be allowed with dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott c5be444500 tu: Treat CP_WAIT_FOR_ME as a cache invalidate
The workaround for draws that need a CP_WAIT_FOR_ME didn't work if the
barrier before the draw is in a separate command buffer from the draw.
The barrier would add a pending CP_WAIT_FOR_ME, but it would get dropped
on the floor at the end of the command buffer and the draw wouldn't have
a pending CP_WAIT_FOR_ME so it wouldn't emit one. We don't know in the
barrier if the destination is a draw with the workaround, so we have two
options:

- Emit any pending CP_WAIT_FOR_ME at the end of the command buffer (and
  before secondaries) in case there is a workaround draw later. This
  will emit an extra CP_WAIT_FOR_ME at the end of the command buffer in
  case there is an indirect command barrier.
- Always assume at the beginning of the command buffer that there is a
  pending CP_WAIT_FOR_ME. This will emit an extra CP_WAIT_FOR_ME before
  the first workaround-requiring draw in the command buffer, in case
  there was a barrier earlier.

The only draws requiring a workaround are currently
vkCmdDraw*IndirectCount(), which we assume are rarer than indirect
command barriers, so we implement the second option. This entails
treating it as a cache invalidate.

This fixes some upcoming dynamic rendering CTS tests that do
vkCmdDrawIndirectCount() in a secondary but put the barrier for it in
the primary.

Fixes: 37939e9c54 ("turnip: Fix the lack of WFM before indirect draws")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott d2ad4c739c tu/lrz: Do not use framebuffer when inheriting LRZ
The only thing it's used for is to get the image view, and we can't rely
on it existing anyway. With dynamic rendering, we only have the format
of the attachments and sample count, so moving forward we can't rely on
anything other than that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Georg Lehmann df4b5914cd nir/fold_16bit_tex_image: Default to only_fold_all.
No driver doesn't use this option.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17757>
2022-07-27 18:57:12 +00:00
Georg Lehmann dd3e9be413 radeonsi: Stop using nir_legalize_16bit_sampler_srcs.
This pass is problematic because it truncates sources when there are type
mismatches. With the right nir_fold_16bit_tex_image options we can ensure
that there is never a mismatch.

Other changes: bias is affected by A16 https://reviews.llvm.org/D111754
And enable G16 as we recently confirmed that it's fully independent from A16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17757>
2022-07-27 18:57:12 +00:00
Danylo Piliaiev 365466a10c zink/turnip: Add comments to already triaged failures for tu baseline
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17762>
2022-07-27 17:58:38 +00:00
Chia-I Wu 8001c78d49 ir3: set UL flag before ir3_lower_subgroups
ir3_legalize_relative, extracted from ir3_legalize, assumes a0 is loaded
first in each block if there is any user in the block.
ir3_lower_subgroups breaks the assumption.  We need to do
ir3_legalize_relative first.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6902
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17720>
2022-07-27 17:08:03 +00:00
Brian Paul 7023cab093 llvmpipe: fix texcoord analysis regression
The texcoord component can be specifed by the src registers swizzle
or the variable's location_frac field.

Signed-off-by: Brian Paul <brianp@vmware.com>
Fixes: 90d011de8e ("llvmpipe: fix texcoord analysis in llvmpipe_nir_fn_is_linear_compat()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6889
Reviewed-by: Emma Anholt <emma@anholt.net>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17743>
2022-07-27 15:51:27 +00:00
Georg Lehmann 22d860fe4a aco/ir: Add swapped opcode for v_cmp_u/v_cmp_o.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 8f7ceff774 aco/ir: Add v_cmp_class to get_cmp_info.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 578d0a1934 aco/ir: Add vcmpx opcode to get_cmp_info.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 369b8c031a aco/ir: Fix swapped nle.
Cc: mesa-stable

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 9c727b958e aco/ir: Add integer get_cmp_info.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 590b93ae65 aco/ir: Generalize (un)ordered_swapped.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Sarah Walker f286cab27b pvr: Move BRN 44079, 48492 and 66011 code into pvrsrvkm specific directory
The new kernel mode driver will provide the relevant information directly to
userspace, so this code is only required for pvrsrvkm.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17595>
2022-07-27 10:13:19 +00:00
Jordan Justen fa79020ba9 anv: Fix PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES with large BAR
Reported-by: Dave Airlie <airlied@redhat.com>
Fixes: fae88d8791 ("anv: make use of the new smallbar uAPI")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6937
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17761>
2022-07-27 09:44:38 +00:00
Timur Kristóf 11e51f7211 radv: Use NIR-based NGG lowering with LLVM.
Also cleanup some unused code.

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/12792>
2022-07-27 09:06:24 +00:00
Timur Kristóf 45ed22c87e radv: Properly set LDS size for LLVM NGG shaders.
Update the esgs_ring_size after ac_nir_lower_ngg.

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/12792>
2022-07-27 09:06:24 +00:00
Timur Kristóf d3dcd294c0 radv/llvm: Remove incorrect hardcoded workgroup size from NGG GS.
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/12792>
2022-07-27 09:06:24 +00:00
Timur Kristóf 7e7d6d8c73 ac/llvm: Implement GDS atomic add NIR intrinsic.
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/12792>
2022-07-27 09:06:24 +00:00
Manuel Stoeckl 19f62b4303 dri: add [ax]bgr16161616 to format lookup tables
Note: The format __DRI_IMAGE_FORMAT_ABGR16161616 was already
in the dri2_format_table, but had been hidden from outside view,
for lack of an official DRM fourcc. Since its fourcc has now been
assigned, it is safe to reveal the format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14580>
2022-07-27 07:27:10 +00:00
Manuel Stoeckl 7e554e11a1 dri: fix incorrect fourcc for R16G16B16A16_UNORM format
The DRM fourcc for this format is DRM_FORMAT_ABGR16161616 = 'AB48', not
__DRI_IMAGE_FOURCC_RGBA16161616 = 'RA48'. This should have no outward
effect for clients, since the format does not get revealed by
dri2_query_dma_buf_formats, and is otherwise only used within the
library.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14580>
2022-07-27 07:27:10 +00:00
Manuel Stoeckl d8eff20b9b gbm: add GBM_FORMAT_[AX]BGR16161616
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14580>
2022-07-27 07:27:10 +00:00
Marek Olšák bc85e79bba ac/gpu_info: require amdgpu DRM 3.15.0 (kernel 4.12) from July 2017
to match the radeon requirement

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 9f6a64b1c3 gallium/radeon: require radeon DRM 2.50.0 (kernel 4.12) from July 2017
This is the latest radeon DRM version.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 8426cf9132 ac/gpu_info: remove unused has_unaligned_shader_loads
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák f3f00f77ad ac/gpu_info: remove amdgpu_gpu_info parameter from ac_query_gpu_info
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 41888505fc ac/gpu_info: use drm_amdgpu_device_info instead of amdgpu_gpu_info
These fields are identical but the latter is from libdrm.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák abd188ec1c radeonsi: remove workarounds for radeon DRM < 2.45.0
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák b2455e1ccb gallium/radeon: require radeon DRM 2.45.0 from April 2016
This removes most non-radeonsi workarounds.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 3657cdafd6 amd: require amdgpu DRM 3.2.0 from April 2016
This removes an early bug workaround.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák ff19666a0d ac/gpu_info: remove redundant vcn_encode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 89113c0338 ac/gpu_info: remove redundant vce_encode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 9cbbdc6583 ac/gpu_info: remove redundant uvd_encode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 2972ceccfd ac/gpu_info: remove redundant jpeg_decode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák a0d2e16c91 ac/gpu_info: remove redundant uvd_decode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 12c5d64fae ac/gpu_info: remove vram_size and gtt_size in favor of *_kb variants
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 983223de5d ac/gpu_info: use the kernel-reported GFX IP version to set gfx_level
hopefully this won't break the world.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 6504d7172c ac/gpu_info: use hw_ip::ip_discovery_version to set IP versions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 9552da66cc ac/gpu_info: rework and extend device info to be more informative
This is the result with AMD_DEBUG=info:

Device info:
    name = NAVI23
    marketing_name = AMD Radeon RX 6600
    num_se = 2
    num_rb = 8
    num_cu = 28
    max_gpu_freq = 2750 MHz
    max_gflops = 9856 GFLOPS
    l0_cache_size = 16 KB
    l1_cache_size = 128 KB
    l2_cache_size = 2048 KB
    l3_cache_size = 32 MB
    memory_channels = 8 (TCC blocks)
    memory_size = 8 GB (8192 MB)
    memory_freq = 14 GHz
    memory_bus_width = 128 bits
    memory_bandwidth = 224 GB/s
    clock_crystal_freq = 100000 KHz
    IP GFX     10.3 	queues:1
    IP COMP    10.3 	queues:4
    IP SDMA     5.2 	queues:2
    IP VCN_DEC  3.0 	queues:1
    IP VCN_ENC  3.0 	queues:1
    IP VCN_JPG  3.0 	queues:1

It might not be 100% correct with other chips.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák dd6b001775 ac/gpu_info: remove tabs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák f218c3d795 ac/gpu_info: rename info fields to num_cu, memory_bus_width, memory_freq_mhz
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Dave Airlie 38a2a2da3e llvmpipe: keep context list and use to track resource usage.
Just check across all contexts if a resource is referenced.

Fixes: 6bbbe15a78 ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17702>
2022-07-27 01:09:34 +00:00
Dave Airlie a680fd078c llvmpipe: make last_fence a screen/rast object not a context one.
When a flush happens the per-context setup is used to hold the fence
for the last scene sent to the rasterizer. However when multiple
contexts are in use, this fence won't get returned to be blocked on.

Instead move the last fence to the rasterizer object, and return
that instead as it should be valid across contexts.

Fixes gtk4 bugs on llvmpipe since overlapping vertex/fragment.

Fixes: 6bbbe15a78 ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17702>
2022-07-27 01:09:34 +00:00
Iago Toral Quiroga 903a75245b v3dv: only check binning sync for semaphores for the first CL job
Semaphore waits in a command buffer only affect the first jobs we execute
in each hardware queue since jobs in the same queue are serialized against
each other. Binning syncs in particular, only affect CL jobs.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17594>
2022-07-27 00:00:54 +00:00
Iago Toral Quiroga 2ca4a51679 v3d,v3dv: add a common v3d_hw_prim_type helper
We had this replicated in both drivers.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17594>
2022-07-27 00:00:54 +00:00
Iago Toral Quiroga e812cbe847 v3dv: remove unnecesary FIXME comment
We only want to cleant BCL barrier flags if we consume a BCL barrier.
For example, if the client records a barrier for an index buffer
it should apply to the next draw call that uses an index buffer
which may not be the current draw call but one coming after it.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17594>
2022-07-27 00:00:54 +00:00
Mike Blumenkrantz 4cfa777e39 zink: enable unordered blit/resolve ops
can't do swapchain or u_blitter ops, but these should be fine

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz 731d7be375 zink: make get_cmdbuf() public
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz ca03e35821 zink: expand unordered_exec
track read+write

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz b1781ec9ab zink: move buffer/image functions down in file
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz 84b8242262 zink: promote image/buffer copy operations to unordered
if the src and dst for these operations can both be promoted, then the
entire operation can be promoted to potentially avoid splitting renderpasses

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz a8c368b0dc zink: add a second resource param to get_cmdbuf() for unordered promotion
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz d9276ca6d0 zink: rework unordered_exec handling
previously this would opportunistically promote barriers to the unordered
cmdbuf only if a renderpass was active or there was no access, which
was the wrong approach

instead, opportunistically promote barriers to the unordered cmdbuf
any time it's possible to do so, which is when one of these conditions is true:
* when there is no access to the resource on the current cmdbuf
* when the only access to the resource is in the unordered cmdbuf

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz f0f0611f40 zink: explicitly unset unordered_exec when resource can't be unordered
ensure that subsequent commands can't be promoted

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz e5c4c33fa6 zink: zink_resource::unordered_barrier -> unordered_exec
this is a bit more clear

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz a41ea582c4 zink: add ZINK_DEBUG=noreorder
this will be useful for debugging

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz f42212983c zink: convert ZINK_DEBUG to enum
more readable/debuggable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Mike Blumenkrantz 4a3cea6730 zink: stop ORing unordered barrier access
this doesn't make any sense and is confusing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
2022-07-26 21:34:59 +00:00
Jordan Justen 2863e720f0 intel/dev: Determine the amount of free vram using small BAR uapi
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16739>
2022-07-26 20:34:02 +00:00
Jordan Justen acc6457ff4 intel/dev: Use i915 region probed_cpu_visible_size when non-zero
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16739>
2022-07-26 20:34:02 +00:00
Jordan Justen ab4939dfff iris/bufmgr: Add I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS for vram mappable buffers
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16739>
2022-07-26 20:34:02 +00:00
Lionel Landwerlin fae88d8791 anv: make use of the new smallbar uAPI
Instead of having 2 VkMemoryType pointing to the same VkMemoryHeap, we
have each VkMemoryType with VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT (one
host visible, the other not) point to its own VkMemoryHeap. For the
local heap that is host visible, we'll use the
I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS flag at GEM BO creation.

When the smallbar uAPI is not available we fallback to a single heap
and do not use I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS.

v2: Handle probed_cpu_visible_size == probed_size (Matthew)

v3:
 * Jordan: Use region info from devinfo

v4: Also make the vram host visible heap as local (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16739>
2022-07-26 20:34:02 +00:00
Mike Blumenkrantz fc1eec0a27 lavapipe: fix shader access stage conversion from mesa -> pipe
ok ok but this time it's fixed and works I promise

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17758>
2022-07-26 20:21:50 +00:00
Gert Wollny bbe8400949 r600/sb: fall back to unoptimized shader if RA fails
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17755>
2022-07-26 20:14:14 +00:00
Benjamin Cheng 1c06565026 radv: expose disjoint image support
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:58 +00:00
Benjamin Cheng 27a24cb382 radv: implement disjoint memory for multiplane images
For descriptor binding, we need to allow up to three buffers to be
referenced by any image.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:58 +00:00
Benjamin Cheng 6a77ecbe6f radv: consolidate descriptor set buffer counts
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:57 +00:00
Benjamin Cheng 72625bea5f radv: refactor image binding into struct
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:57 +00:00
Mike Blumenkrantz 62044403a9 util/blitter: respect PIPE_TEXTURE_RECT
if this isn't supported, don't use rect-related sampling

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17714>
2022-07-26 19:30:44 +00:00
Emma Anholt 00efd4cc38 ci/virgl: Make the VM-based virgl tests report to #virgl-ci, too.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17730>
2022-07-26 18:59:45 +00:00
Emma Anholt bd8740da77 gallivm: Optimize single-invocation SSBO stores.
The CTS does a lot of 1x1x1 compute shaders (all that stuff like
dEQP-GLES31.functional.shaders.builtin_functions.precision.mul.highp_compute.scalar)
which finish with store_ssbos.  Instead of doing the invocation loop in
that case (which LLVM has to later unroll), just emit the single
invocation's store.

Fixes timeouts running
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.36, which does
a spectacular number of SSBO stores in a long 1x1x1 compute shader.
Reduces runtime of on llvmpipe from 66s to 29s locally, and virgl from
1:38 to 43s.  virgl
dEQP-GLES31.functional.ssbo.layout.random.nested_structs_arrays_instance_arrays.22
goes down to 7 seconds.

Fixes: #6797
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17730>
2022-07-26 18:59:45 +00:00
Emma Anholt 8d41f8f384 gallivm: Refactor a bit of UBO/SSBO range checking.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17730>
2022-07-26 18:59:45 +00:00
Kenneth Graunke 03df494ea4 mesa: Mark render-to-texture as unsafe if there's no pipe_resource
Let's be slightly more defensive here.  If a texture image doesn't have
an associated pipe_resource allocated, then render_texture() will pass
that along to _mesa_update_renderbuffer_surface(), which will crash on a
NULL pointer dereference.  So, if there isn't a pipe_resource, then we
should just skip this altogteher.

Today, this isn't an issue, because each gl_texture_image always
allocates a pipe_resource up front.  On a branch of mine, I prototyped
some improvements to the compressed texture fallback handling, where it
would defer resource allocation, examine the source image's block data,
and dynamically select a format based on that, then allocate it later.

With that prototype in place, we saw crashes the Android "My Talking
Tom" series of games, which appear to be attaching ASTC textures to a
framebuffer color attachment.  That FBO would be incomplete anyway, as
ASTC textures aren't renderable, but we got into a situation where the
render-to-texture code was crashing due to the lack of pt before it
could properly signal that it was incomplete and bailing.

Technically, we don't need this now, but I figure that being defensive
won't hurt and this would probably save whoever encounters such an issue
in the future a bunch of frustrating debugging.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17508>
2022-07-26 18:38:43 +00:00
Danylo Piliaiev 4ba129cd86 tu: Do not dereference descriptorSetLayout in push descriptors tmpl
Fixes crash when capturing with RenderDoc.

From VK spec:

 descriptorSetLayout [...] This parameter is ignored if templateType
 is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17751>
2022-07-26 18:18:48 +00:00
Jason Ekstrand 2f00a04f3b vulkan: Include self-dep info in rendering continues
Fixes: 3a204d5cf3 ("vulkan/render_pass: Add a better helper for render pass inheritance")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17748>
2022-07-26 17:47:20 +00:00
Jason Ekstrand d2bd089b78 vulkan: Append subpass structures to VkRenderingInfo last
If we don't append subpass->self_dep_info last, other __vk_append_struct()
calls will update its pNext chain which lives in the subpass which
should be treated as immutable.  This is easily fixable by just making
it the last thing we append to the chain.

Fixes: 7e11cdc77a ("vulkan/render_pass: Pass sample locations to barriers")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17748>
2022-07-26 17:47:20 +00:00
Ian Romanick f7f232385f intel/fs: Use canonical form for "work around" tags
Trivial.  Also clean up some weird whitespace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17605>
2022-07-26 17:25:19 +00:00
Ian Romanick 377246318a intel/fs: Eliminate "masked" and "per slot offset" URB messages
All of this information can be inferred from the sources.

v2: Fix "error: unused variable 'opcode'" detected by marge-bot.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17605>
2022-07-26 17:25:19 +00:00
Ian Romanick b21b901b46 intel/fs: Don't pass flags to lower_urb_read_logical_send or lower_urb_write_logical_send
...because the flags can be inferred from the sources.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17605>
2022-07-26 17:25:19 +00:00
Ian Romanick 1b17f8fc5a intel/fs: Make logical URB read instructions more like other logical instructions
No shader-db changes on any Intel platform

Fossil-db results:

Tiger Lake
Instructions in all programs: 156926440 -> 156926470 (+0.0%)
Instructions hurt: 15

Cycles in all programs: 7513099349 -> 7513099402 (+0.0%)
Cycles hurt: 15

Ice Lake and Skylake had similar results. (Ice Lake shown)
Cycles in all programs: 9099036492 -> 9099036489 (-0.0%)
Cycles helped: 1

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17605>
2022-07-26 17:25:19 +00:00
Ian Romanick 349a040f68 intel/fs: Make logical URB write instructions more like other logical instructions
The changes to fs_visitor::validate() helped track down a place where I
initially forgot to convert a message to the new sources layout.  This
had caused a different validation failure in
dEQP-GLES31.functional.tessellation.tesscoord.triangles_equal_spacing,
but this were not detected until after SENDs were lowered.

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
total instructions in shared programs: 19951145 -> 19951133 (<.01%)
instructions in affected programs: 2429 -> 2417 (-0.49%)
helped: 8 / HURT: 0

total cycles in shared programs: 858904152 -> 858862331 (<.01%)
cycles in affected programs: 5702652 -> 5660831 (-0.73%)
helped: 2138 / HURT: 1255

Broadwell
total cycles in shared programs: 904869459 -> 904835501 (<.01%)
cycles in affected programs: 7686744 -> 7652786 (-0.44%)
helped: 2861 / HURT: 2050

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
Instructions in all programs: 141442369 -> 141442032 (-0.0%)
Instructions helped: 337

Cycles in all programs: 9099270231 -> 9099036492 (-0.0%)
Cycles helped: 40661
Cycles hurt: 28606

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17605>
2022-07-26 17:25:18 +00:00
Georg Lehmann 5dab077824 aco: Add a note about G16 without A16 to README-ISA.md.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Georg Lehmann 7fa9b25c2f radv: Fold 16bit tex sources.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Georg Lehmann f5f73db846 aco: Support 16bit sources for texture ops.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Georg Lehmann c1cf0688c9 aco: Add G16 opcodes.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Connor Abbott 19a2353446 tu: Fix resolving d32s8 into s8 on fast path
The code assumed that if the source was d32s8 then the destination would
also be d32s8, in particular that depth_base_addr/stencil_base_addr
would also be filled out. Move the destination and source handling into
two different ifs with different conditions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17684>
2022-07-26 15:00:01 +00:00
Connor Abbott d426ee6a99 tu: Support resolving D24S8 -> S8
This was missed when we added support for VK_KHR_depth_stencil_resolve.
There is a similar feature where the stencil aspect of a D24S8 can be
copied "tightly" in CopyImageToBuffer, but it used the texture swizzle
and so required the 3d path. To get it to work with the 2D path, which
is required for resolves, we have to instead use the A8_UNORM format,
which works for texture sampling even for tiled images. We also have to
reuse the pre-existing image views because subpass resolves work on
image views rather than images, whereas before the fixup was applied
while creating the image view. This means threading through the
corresponding "opposite" format through setup, src, and dst functions,
doing the fixup there (through some shared helpers), and then getting
every user to specify the right format. As a bonus, we no longer need to
force the 3d path for the CopyImageToBuffer and CopyBufferToImage
special cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17684>
2022-07-26 15:00:01 +00:00
Erik Faye-Lund e8b22afae9 llvmpipe: remove unused function
Fixes: a1846e3926 ("llvmpipe: merge all rasterizer-bind functions")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17735>
2022-07-26 08:12:17 +00:00
Chia-I Wu ba461f897b ir3: fix tess param allocation
primitive_param takes up 2 vec4's.  Remove an align that I don't
understand.

The align upset

  Test case 'dEQP-VK.subgroups.ballot_broadcast.graphics.subgroupbroadcast_vec4'..
  deqp-vk: ../src/freedreno/ir3/ir3_nir.c:1039:
  void ir3_setup_const_state(nir_shader *, struct ir3_shader_variant *, struct ir3_const_state *):
  Assertion `constoff <= ir3_max_const(v)' failed.

with an older version (android11-tests-dev branch) of deqp-vk.  This is
because ir3_nir_opt_preamble uses the function for the worst case but
the function fails to replace the align by the worst case.

No regression with dEQP-VK.*tess*.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
2022-07-26 01:04:56 +00:00
Chia-I Wu e3ba8a2f07 ir3: increment constoff right after it is assigned
Minor improvement to readability.  No real change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
2022-07-26 01:04:56 +00:00
Chia-I Wu 4ae2966616 ir3: remove unused patch_vertices_in
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
2022-07-26 01:04:56 +00:00
Chia-I Wu 74c96af71d ir3: fix output_loc size
It was off-by-one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
2022-07-26 01:04:56 +00:00
Chia-I Wu 9c106f3ee7 ir3: copy req_local_mem for MESA_SHADER_KERNEL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
2022-07-26 01:04:56 +00:00
Chia-I Wu 76ea28b9d0 ir3: update ir3_const_state comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
2022-07-26 01:04:56 +00:00
Jason Ekstrand 23220c86d9 lavapipe: Use the vk_graphics_pipeline_state
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17669>
2022-07-26 00:45:26 +00:00
Jason Ekstrand 33092faef1 lavapipe: Use shader_info::uses_sample_shading
This is more accurate because it's computed directly in spirv_to_nir and
takes even unused SampleID and SamplePos builtings into account.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17669>
2022-07-26 00:45:26 +00:00
Mike Blumenkrantz 27c97dc0d1 lavapipe: advertise VK_EXT_multisampled_render_to_single_sampled
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz f2d5ff1c3a lavapipe: VK_EXT_multisampled_render_to_single_sampled
this works by doing a replicate at renderpass start and an in-place
resolve on renderpass end

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz d2990b6599 vulkan: hook up VK_EXT_multisampled_render_to_single_sampled
this adds support for the extension to common renderpass

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz f1ae6523b1 llvmpipe: add a shortcut for blitter resolves
if this is only going to do a sample0 resolve, the functionality is
equivalent to just copying the first sample, and in llvmpipe terms,
this just means doing a direct copy at offset=0

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz 6064d838e7 lavapipe: fix stencil clears
this uses the value from the stencil attachment

Fixes: 8068c68b1f ("lavapipe: Delete render passes")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz f2f517b315 llvmpipe: allow resource_copy_region to perform replicate operations
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz 8563a95bd7 llvmpipe: remove weird clamping for format support with sample counts
this breaks u_blitter

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
2022-07-26 00:02:26 +00:00
Mike Blumenkrantz 725cdfb0ad lavapipe: set image access on pipeline bind, not descriptor bind
this is where the access originates, so set it here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17739>
2022-07-25 22:08:53 +00:00
Mike Blumenkrantz a18708e5ce lavapipe: use 64bit masks for shader access
ensure that all descriptors are tracked for this

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17739>
2022-07-25 22:08:53 +00:00
Mike Blumenkrantz 2fd930f95b lavapipe: use correct offset calculation for flagging ssbo/image write access
var->data.binding has no relation to the actual index of the resource,
which must be separately calculated based on the layout

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17739>
2022-07-25 22:08:53 +00:00
Mike Blumenkrantz 825e5f6482 lavapipe: make binding/layout helper functions static inline
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17739>
2022-07-25 22:08:53 +00:00
Adam Jackson 295a8b4464 mesa: Remove Purgeable fields from texture/buffer/renderbuffer objects
These are unused since !17425.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17745>
2022-07-25 16:28:40 -04:00
Erik Faye-Lund ba2146f93f gallium/hud: do not use texture-rect for font
RECT textures used to be required to be supported by drivers. But since
the state-tracker learned how to lower these to 2D textures, some
drivers no longer support them.

While we have lowering in place for this, lowering it involves some
needless overhead. So let's just use a 2D texture instead of a RECT
texture.

Because having two versions and switching between them is more
complicated than it needs to be, let's just always use a 2D texture.
Similarly, let's just always multiply the reciprocal here, so we don't
have to test for PIPE_CAP_TGSI_DIV first.

Cc: mesa-stable
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17707>
2022-07-25 18:12:05 +00:00
Mike Blumenkrantz 7ef76dec73 lavapipe: move vertex input dynamic states into vertex input block
these states were erroneously assigned to the pre-rasterization stage
for pipeline libraries when they instead belong to the vertex input stage

cc: mesa-stable

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17738>
2022-07-25 17:26:43 +00:00
Mike Blumenkrantz fbb4b90d7d zink: add a ci flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17722>
2022-07-25 16:38:25 +00:00
Mike Blumenkrantz 5e600afa33 lavapipe: remove some skips
these should all be fast enough now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17722>
2022-07-25 16:38:25 +00:00
Mike Blumenkrantz d23a9380dd lavapipe: implement extreme uniform inlining
this adds a mangled variation on nir_inline_uniforms that enables inlining
from any uniform buffer in order to try inlining every possible load

if the shader is too small or the ssa_alloc delta from inlining is too small,
then inlining is disabled for that shader to avoid pointlessly churning
the same shaders for no gain

with certain types of shaders, the speedup is astronomical

before:
dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays (4750.76s)

after:
dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays (0.505s)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17722>
2022-07-25 16:38:25 +00:00
David Heidelberg 1a244e1394 ci/freedreno: 3 pixel change in Raven restricted trace
Acked-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17732>
2022-07-25 18:14:40 +02:00
Adam Jackson 2b3b7b692b wsi/x11: Synchronously check for error from xcb_present_pixmap
Yes this is a round trip, but X_PresentPixmap is not itself a blocking
operation, it just instructs the server to do the next presentation at
some time. More importantly, if _we_ don't catch the presentation error,
xlib's error queue will, and the calling code is certainly not prepared
to handle errors from Present.

Forcing the round trip here is also a bit more correct semantically.
This is the end of the Vulkan client part of the present queue, and the
X_PresentPixmap request transfers the queue operation to the server, so
we should not return until we are sure the handoff has happened.

Fixes some flakiness with piglit@glx-visuals-* with zink+radv.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17685>
2022-07-25 10:54:46 -04:00
Erik Faye-Lund 747913377f zink: fix EXT_color_write_enable check
Checking for the extension isn't enough, we also need to check for the
feature-bit.

Fixes: 49a20e0981 ("zink: start a unified driver workarounds struct")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17709>
2022-07-25 15:57:42 +02:00
Erik Faye-Lund 32b9e639b7 zink: warn about missing image2DViewOf3D feature
While we're at it, let's store zink_screen in a temp varaible for reuse.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17709>
2022-07-25 15:57:37 +02:00
Boyuan Zhang fef2004b11 radeonsi/vcn/enc: enable cabac entropy mode
Set cabac entropy mode if enabled.

v2: add extra check on radeon driver side, disable cabac if profile is
baseline or extended.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16113>
2022-07-25 13:17:18 +00:00
Boyuan Zhang dea360dcf9 frontends/va: get entropy mode info for h264 encode
Get entropy mode and cabac init idc from VAAPI interface.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16113>
2022-07-25 13:17:18 +00:00
Boyuan Zhang ea9e8e776a vl: add cabac init idc for h264 encode
Add interface to store cabac init idc value.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16113>
2022-07-25 13:17:18 +00:00
Rajnesh Kanwal e13a450bf2 pvr: Add support for input attachment descriptor.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal b562d29196 pvr: Add support for storage and uniform texel descriptor.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal 08c867972f pvr: Add support for image descriptor.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal ecfea72c73 pvr: Add support for combined image and sampler descriptor.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal 290b9a953a pvr: Add support for sampler descriptor.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal 1bf883a8ae pvr: Move binding related checks in common code.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal f044676dbb pvr: Implement vkCreateBufferView and vkDestroyBufferView.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal 8ef42c25a6 pvr: Use common vk_buffer implementation.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Rajnesh Kanwal 405a407d42 pvr: Init and store default sampler in pvr_device.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17719>
2022-07-25 11:57:48 +01:00
Erik Faye-Lund dbc8290656 llvmpipe: clean up bresenham implementation
This moves some common code into shared locations, limits the scope of
some variables, switches some booleans for bools, and cleans up some
whitespace.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17653>
2022-07-25 12:39:47 +02:00
Erik Faye-Lund 8f99bab70c llvmpipe: consolidate legacy_points and multisample state
This just makes the code a bit easier to follow.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17653>
2022-07-25 12:39:47 +02:00
Erik Faye-Lund a1846e3926 llvmpipe: merge all rasterizer-bind functions
This makes it more obivous when what state changes, and they are always
just called in order.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17653>
2022-07-25 12:39:42 +02:00
Mike Blumenkrantz 4ff28bd5d8 lavapipe: accurately set image/ssbo access based on shader usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15286>
2022-07-25 01:57:49 +00:00
Dave Airlie 878784dbec crocus: fix leak in query code.
Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17731>
2022-07-25 01:34:11 +00:00
Mike Blumenkrantz ad09694cba lavapipe: EXT_non_seamless_cube_map
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17711>
2022-07-25 00:50:14 +00:00
Mike Blumenkrantz a2f97bd88a zink: avoid crashing when bindless texture updates aren't used
some apps trigger the texture update path far in advance of when the
texture will be used, so don't crash and wait to do the update

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17665>
2022-07-25 00:11:54 +00:00
Mike Blumenkrantz 992cd1ae2b zink: assert !rp_changed after renderpass has started
avoid weirdness

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17665>
2022-07-25 00:11:54 +00:00
Mike Blumenkrantz c24c5972a8 zink: only flag fbfetch as rp update if fbfetch wasn't already configured
otherwise this is probably just a swapchain acquire which needs to update
the descriptor during begin_renderpass

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17665>
2022-07-25 00:11:54 +00:00