Commit Graph

145667 Commits

Author SHA1 Message Date
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
Gert Wollny 1468cd82de r600/dri-tweak: Disable ARB_shader_image_load_store for "Tomb Raider 2013"
When "Depth of Field" is set to Ultra, a compute shader is emitted that
results in Hardware hangs when OpenGL > 4.3 is available.

If the option is enabled, the game will hang at the menu screen so that
it is no longer possible to simply change the option back. To avoid this
disable the extension for this game until the shader emission can be fixed.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6857

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17728>
2022-07-24 19:32:10 +00:00
Gert Wollny a3dda55c0a r600ß/sfn: Don't fall through with VS outputs
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>
2022-07-24 18:39:13 +00:00
Gert Wollny 8166be0e83 r600: don't clone the nir shader, just use it
The nir shader passed in with the shader state has to be released by
the backe-end, so don't clone it, just use it.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>
2022-07-24 18:39:13 +00:00
Gert Wollny 97d4e98501 r600: Delete possible old NIR variant when translating from TGSI
With shader variants it may happen that we already translated a TGSI
shader for the current selector, so delete the old nir shader if we
already had one.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>
2022-07-24 18:39:13 +00:00
Gert Wollny 92feb77bbb r600/sfn: lower the right shader variant
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>
2022-07-24 18:39:13 +00:00
Gert Wollny 99e4a23290 r600/sfn: make sure the memory pool is released after shader translation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>
2022-07-24 18:39:13 +00:00
Constantine Shablya 85c3cea96f anv: set image_read_without_format NIR option on Vulkan 1.3
VK_KHR_format_feature_flags2 is core and implicitly enabled in 1.3.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17442>
2022-07-24 17:27:10 +00:00
Konstantin Seurer 2861d1ff8a radv: Fix out of bounds access in RTPSO creation
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17723>
2022-07-24 14:59:44 +00:00
Hyunjun Ko 0c787d57e6 tu: increase maxPushConstantsSize to 256.
Now there are two paths for push constants.

When it's range is under 128b, we can use shared consts.
When it's over 128b, we can instead do loading data through
regular path, which is same as the previous way.

Now we can satisfy emulations like vkd3d that requires 256b for
its root signatures and we think it fairly maps to push constants
rather than inline uniform blocks that requires one indirection.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15503>
2022-07-24 09:03:47 +00:00
Hyunjun Ko e1f2cabc5e turnip: Change to use shared consts for PushConstants
Follow the way blob is doing for PushConstants though it supports only
128b, same as previous.

v1. Rename tu_push_constant_range.count into dwords to redue confusion.
( Danylo Piliaiev <dpiliaiev@igalia.com> )

v2. Enable shared constants only if necessary.

v3. Merge the two draw states TU_DRAW_STATE_SHADER_GEOM_CONST and
TU_DRAW_STATE_FS_CONST as shared constants are used.

Note that this leaves tu_push_constant_range in tu_shader so we could
use it again in the following patch.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15503>
2022-07-24 09:03:47 +00:00
Hyunjun Ko ce8e8051af turnip: clean up unused parameters for user consts.
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15503>
2022-07-24 09:03:47 +00:00
Hyunjun Ko e6556b72fb ir3: handle shared consts.
Adds a shared consts base offset and a size of it(dwords) to ir3_compiler
since they might be depending on gpu generations. (Danylo Piliaiev <dpiliaiev@igalia.com> )

Adds a flag to present whether shared consts are enabled to
ir3_shader_options and then it sets to ir3_const_state when creating
an ir3 variant. Although this state is not per-shader state, this is
necessary when figureing out real constlens.

v1. Define a hw quirk for geometry shared const files and use it when
calculating const length.

v2. Don't hardcode when calculating a safe const length.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15503>
2022-07-24 09:03:47 +00:00
Hyunjun Ko b35c4bd050 ir3: change maximum size of const files.
According to the observation on a630/a650/a660, max_const_pipeline has
to be 512 when all geometry stages are present. Otherwise a gpu hang
happens. Acoordingly maximum safe size for each stage should be under
(max_const_pipeline / 5 (stages)).

Only when VS and FS stages are present, the limit is 640.

v1. Align max_const_safe to 4 vec4's.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15503>
2022-07-24 09:03:47 +00:00
Marek Olšák 3e94d498b3 gallium: add pipe_blit_info::dst_sample, update u_blitter to write that sample
A new radeonsi blit test will use it to upload different sample values
into MSAA textures.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17694>
2022-07-23 18:21:31 +00:00
Pierre-Eric Pelloux-Prayer af7c2ff842 radeonsi: check last_dirty_buf_counter and dirty_tex_counter
Check both counters in draw and compute, otherwise compute dispatches may
miss buffers invalidation.
This fixes the test case from https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/702
(both with and without GALLIUM_THREAD=0).

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17394>
2022-07-23 18:03:22 +00:00
Mihai Preda da9feae735 gallivm: push LLVM version guard into assert
The asserts that check the pointer element type can't be used on LLVM >= 15.
Instead of using precompiler #if, use boolean shortcut in assert.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Mihai Preda f0fda08739 gallivm: add lp_build_struct_get() variants that take the LLVM type
This is needed for LLVM-15 opaque pointers.
The new variants taking the type are named with the suffix "2", using
the same naming pattern LLVM (e.g. LLVMBuildGEP2 vs. LLVMBuildGEP).

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Mihai Preda 8c4aef2abb gallivm: refactor a bit the cache access in view of LLVM opaque pointers
LLVM 15 requires transition to opaque pointers; factorize a bit the cache
memthods to help this transition.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Mihai Preda b549394992 gallivm: fix a few llvm non-opaque pointers
As LLVM 15 transitions to opaque pointers, we need to update
the deprecated methods dealing with non-opaque pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Jesse Natalie bdf91b25d9 dzn: Retrieve validator version
For platforms where there's no validator available, leave the field zero-initialized
to let the DXIL backend choose whatever target validator version it wants.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie ef7635b1cb d3d12: Retrieve validator version
For platforms where there's no validator available, leave the field zero-initialized
to let the DXIL backend choose whatever target validator version it wants.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie b8328c9664 microsoft/compiler: Blacklist DXIL validator 1.6 from 20348 SDK
This version claims to support validator version 1.6, but doesn't
actually have the 1.6 changes (PSV v2, PSV resource v1, barycentrics).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 8fcd506178 microsoft/compiler: Add a getter for a validator version from DXIL.dll
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 46335debf6 microsoft/compiler: Support DXIL validator 1.7
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 4abe781a0b microsoft/compiler: Support DXIL validator 1.6
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 9dbaece312 microsoft/compiler: DXIL validator 1.6 uses a new PSV resource struct
This is a huge pain because it's an array, meaning that accessing
an entry in the array now depends on the validator version to use
the right element stride.

We could always just store the v1 and downconvert if needed... but
this isn't *that* bad that I felt I had to do it that way.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie d9e575d4d7 microsoft/compiler: DXIL validator 1.6 uses a new PSV struct version
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 4d257929da microsoft/compiler: Set the barycentrics flag for attribute_at_vertex
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 271c8d7a8c microsoft/compiler: DXIL validator 1.6 counts UAVs differently
Instead of counting the number of UAV arrays, it counts the
number of actual UAVs declared. This is more correct, but we
need to do the same accounting to set the 64 UAVs flag.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 494af9db04 microsoft/compiler: Correctly compute dynamic indexing I/O masks
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 31d09d2f77 microsoft/compiler: Compute correct usage masks
This starts actually updating the always-read/never-written
masks while processing the shader. Note that we follow DXC's
lead here and treat "always read" as "sometimes read."

This isn't strictly required, but might help drivers out.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie c26b28f711 microsoft/compiler: Support DXIL validator version 1.5
This version of the validator starts adding usage masks into
the DXIL, which then are expected to match the PSV and signature
data. The usage masks are "correct" meaning that the never-writes
mask no longer includes bits outside of components 0-3.

A future change will actually compute useful masks.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 170d428887 microsoft/compiler: Lower I/O to scalar
A future change will start computing component masks while
processing I/O instructions, and only having to compute
a mask for one component per instruction simplifies things.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 80d35739ff microsoft/compiler: Ensure 4-component position writes via NIR
We're about to lower I/O to scalar, which means we'll end up with
multiple writes to position, and none of them has enough info to
fill in the blanks.

This causes a test that previously crashed on WARP (due to
StoreOutput with an undef not being handled) to fail more
gracefully - but that failure means that the test spends
forever just outputting errors, so explicitly skip it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 252c3c409d microsoft/compiler: Split signature processing into two parts
First, preprocess the signatures, strictly based on the variables
in the nir shader. Then, later, after the actual shader contents
have been processed, we emit the metadata.

This lets shader processing rely on the pre-processed data (e.g.
the row -> ID mapping needed for large VS inputs) while also allowing
the signature data to rely on data gathered during the shader traversal
(e.g. which components are actually used).

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie e4c927545d microsoft/compiler: Emit metadata based on long-lived signature data
Instead of using the short-lived semantic structure (that's used to
fill out the long-lived signature and PSV data), use the long-lived
ones. This is staging so we can hold off on emitting the metadata
until later.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie 6af22121cf microsoft/compiler: Add a max validator version
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie c8f63e07da microsoft/compiler: Add a max shader model option
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Jesse Natalie d216d32756 nir_lower_io_to_scalar: Support arrayed (per-vertex) I/O
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>
2022-07-23 14:48:17 +00:00
Gert Wollny 36c000484d r600: don't dump shader info to files on debug
This was useful to bring up the NIR backend, but is not needed
anymore.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny dcfb047e11 r600/sfn: Fix streamout with non-zero component write
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny d92ce8566b r600/sfn: Fix used of local shared write mask
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny ca1c78e885 r600/sfn: Fix emmision of LDS instructions
Assert to catch more possible erros with LDS fecth/read
groups.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 8a7d34e3bd r600/sfn: Fix the kcache failure handling
Instead of starting a new block when the kcache handling failed,
try to continue scheduling instructions until kcache allocation
fails for all ready instruction.
With that we avoid a CF split withing an LDS fetch/read group.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 8db31e0fe6 r600/sfn: count LDS queue pop reads separately in assembler
Otherwise the check whether the fetches and reads are balanced
could fail.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 233f246bdf r600/sfn: lower undef to zero
It's what the backend would do anyway, so let's do it in nir and
give the optimizer some chance to profit from possible improvements.

Fixes a bad shader with "The Raven Remastered"

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 982effcd4e r600/sfn: fix storing shader output array locations
When lowering gl_Clipertex the driver_location may no longer correspond
to the array index, so fill the array by counting the array index up
according to outputs that need to be handled by the state setup.

Fixes: 3340c7ce35
    r600/sfn: lower CLIPVERTEX to clip planes

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 2e03dd1bef r600/sfn: clean up some commented out code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Vinson Lee 6b3af02a6f r600/sfn: Initialize TestShaderFromString member m_instr_factory.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member m_instr_factory is not
initialized in this constructor nor in any functions that it calls.

Fixes: 79ca456b48 ("r600/sfn: rewrite NIR backend")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17584>
2022-07-23 05:36:34 +00:00
Ryan Neph 1f28d221d9 venus: add support for VK_KHR_dynamic_rendering
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17668>
2022-07-23 01:14:22 +00:00
Ryan Neph 6f5289df53 venus: refactor VkCommandBufferBeginInfo fixups to function
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17668>
2022-07-23 01:14:22 +00:00
Icecream95 d6c574f423 panfrost: Allow NULL streamout targets
Fixes Piglit test
arb_enhanced_layouts-transform-feedback-layout-qualifiers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 a0851f1cc4 panfrost: Don't unbind recently bound streamout targets
When unbinding extra targets, start after the last new target.

Fixes: 5ff7973560 ("panfrost: Import streamout data structures")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 a8dbf61b46 panfrost: Add a debug option for checking overflows on pool uploads
PAN_MESA_DEBUG=overflow will place objects as close as possible to a
protected region at the end of the buffer, so that overflows segfault.

Caught the bugs in all four of the preceding commits.

v2: memset the BO to 0xbb to catch code expecting zeroed allocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 537f67f053 panfrost: Correctly calculate prefetch suppresion varying index
The xfb_base is a base index, it makes no sense to multiply that with
the number of streamout targets. Use addition instead to fix a buffer
overflow.

Fixes: 557633b142 ("panfrost: Suppress Bifrost prefetching")
Reported-by: Luc Ma <onion0709@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 37ab45079d panfrost: Clear the GENERAL varying buffer field if unused
Otherwise the indirect draw shader can read uninitialised data for the
stride, and the position varying buffer may be outside the heap BO.

The next commit fixes a bug that masked this one.

Fixes: 2e6d94c198 ("panfrost: Add helpers to support indirect draws")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 379ae6d823 panfrost: Emit the correct number of attributes
create_vertex_elements_state is sometimes called with a too large
num_elements argument, for example with util_blitter, which causes a
buffer overflow.

There is no documentation to forbid this practice, so don't rely on
so->num_elements being correct and instead use the vertex shader
attribute count, which matches the value used to allocate the
descriptors.

Use attributes_read_count rather than attribute_count because the
latter also includes images and PAN_VERTEX_ID/PAN_INSTANCE_ID.

Fixes: 76de3e691c ("panfrost: Merge attribute packing routines")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 fe613a8de9 panfrost: Only emit images when they are present
nr_images is the trigger for allocating double the number of buffers
for attributes. When there are no images, there is not always enough
space for ALIGN_POT(k, 2) to not move k out of bounds, so don't
execute the line in that case.

Fixes: dc85f65e05 ("panfrost: emit shader image attribute descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Mike Blumenkrantz 240835cfb0 zink: remove deqp fails for lavapipe
these are all broken tests, so ignore whatever results there were for now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17721>
2022-07-22 16:13:57 -04:00
Mike Blumenkrantz 65c1504045 lavapipe: propagate xfb info for pipeline library rasterization stages
Fixes: 202bbedc55 ("lavapipe: streamline xfb shader setup")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17716>
2022-07-22 19:27:49 +00:00
Ian Romanick 430d1a20eb spirv: Fix array length of buffers larger than INT32_MAX.
Like 90a8fb0355.

fossil-db results:

All Skylake and newer Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 141442369 -> 141442363 (-0.0%)
Instructions helped: 1

Cycles in all programs: 9099270231 -> 9099270187 (-0.0%)
Cycles helped: 1

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Emma Anholt 254076f3fc ci/crocus: Fix the commented YML for blender-demo-cube_diorama.
Fixes: c0930b552d ("ci/crocus: Disable the blender trace.")
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Ian Romanick 95e50d198f intel/vec4: Set lower_usub_sat
Reviewed-by: Emma Anholt <emma@anholt.net>
Closes: #6900
Fixes: 90a8fb03 ("nir/lower_io: Fix array length of buffers larger than INT32_MAX.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Emma Anholt f6c5b1d6c6 nir: Split usub_sat lowering flag from uadd_sat.
Intel vec4 would like to do uadd_sat, but use lowering for usub_sat.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Mike Blumenkrantz aed433833f anv: disable dev.i915.perf_stream_paranoid=0 warning
this is spammed constantly even if ANV isn't used

fixes #6731

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17661>
2022-07-22 17:24:04 +00:00
Nanley Chery bec82bb436 iris: Use fill_surface_states for compressed resources
In iris_create_surface, use the fill_surface_states helper function instead of
an open-coded solution for compressed resources.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
2022-07-22 16:33:37 +00:00
Nanley Chery 6c65e990b6 iris: Don't leak compressed resources in iris_create_surface
Before this patch, we were leaking compressed resources in iris_create_surface.
Specifically, when we failed to create an uncompressed ISL surface and view for
a compressed resource, we didn't unreference the resource pointer we referenced
into the pipe_surface.

Fix this by delaying the pipe_surface initialization code to after attempting
to create the uncompressed surface and view.

Cc: 22.1 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
2022-07-22 16:33:36 +00:00
Nanley Chery bca601ffe9 iris: Don't leak surface states for compressed resources
Before this patch, we were leaking surface states in iris_create_surface.
Specifically, when we failed to create an uncompressed ISL surface and view for
a compressed resource, we didn't free surface states we allocated for it.

Fix this by attempting to create the uncompressed surface and view before we
allocate the surface states.

Cc: 22.1 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
2022-07-22 16:33:36 +00:00
Eric Engestrom 96a79a5f3a vk/util: simplify extensions gen code
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17713>
2022-07-22 15:56:28 +00:00
Eric Engestrom e4199322ee vk/util: handful of pythonic cleanups
No functional changes.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17713>
2022-07-22 15:56:28 +00:00
Daniel Schürmann 5b196716cf radv/rt: simplify lower_rt_instructions()
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann f7c318901d radv/rt: fix nir_builder cursor in lower_rt_instructions()
Fixes: 207ce6d658 ('radv: Add helper to inline shaders into the main shader.')
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann c0945f70df radv/rt: Don't load ClosestHit SBT on every hit, but only once after traversal
Quake II RTX:
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 217592 -> 215956 (-0.75%)
Instrs: 39468 -> 39341 (-0.32%)
Latency: 761581 -> 746802 (-1.94%)
InvThroughput: 507721 -> 497870 (-1.94%)
Copies: 4621 -> 4585 (-0.78%)
Branches: 1598 -> 1584 (-0.88%)

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann c39cccec9c radv/rt: use stage ID as handle for general and closestHit shaders
This avoids some code duplication and divergence.

Quake II RTX:
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 218880 -> 217592 (-0.59%)
Instrs: 39692 -> 39468 (-0.56%)
Latency: 789091 -> 761581 (-3.49%)
InvThroughput: 526061 -> 507721 (-3.49%)
VClause: 1202 -> 1188 (-1.16%)
Copies: 4649 -> 4621 (-0.60%)
Branches: 1605 -> 1598 (-0.44%)

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann 3750663c72 radv/rt: use derefs for the traversal stack
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann 076ea8b35a radv: create RT traversal as separate shader
This will help in future to keep the main shader slim
when we have actual function calls.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann 8e056af399 radv: Only create noop-fs for graphics pipelines
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Tapani Pälli a6857ee43e anv: implement Wa_14015264727 for DG2
On DG2 we need to flush data cache before fast clear operation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17218>
2022-07-22 14:59:06 +00:00
Tapani Pälli da7a7c9bbc iris: implement Wa_14015264727 for DG2
On DG2 we need to flush data cache before fast clear operation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17218>
2022-07-22 14:59:06 +00:00
Jesse Natalie 9c5d8dcf6c d3d12: Remove state tracking implementation details from header
Now that the old state tracking code is removed, implementation details
no longer need to be leaked out of this single source file. Remove structs,
function declarations, 'd3d12_' prefixes, and add static when possible.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 74a811382f d3d12: Add a transition flag indicating that state accumulation is needed
Most call sites for transitions will only apply transitions to one or two
resources, and don't need to use the bo set, where each call is guaranteed
to insert the bo, only to walk the set immediately afterwards. Instead, they
can just append the barriers to the dynarray directly and skip the bo set.

Draws and dispatches still use the append approach, to accumulate the full
set of state needed for each subresource for the case where a single
[sub]resource is bound to the pipeline in multiple places.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie fa570bda08 d3d12: Optimize transition_subresource_states that covers a whole resource
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie a3813505ce d3d12: Extract core barrier logic
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie aa94e0b37c d3d12: Rename bind invalidate options to transition flags
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie c6f01d6c45 d3d12: Swap the remainder of state tracking to new method
Uses a set of d3d12_bo on the context to track which bos are pending
a transition instead of an intrusive linked list, since the bo may
need to be pending on multiple contexts at once.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 05d04c7a54 d3d12: Record a state fixup command list when necessary
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 70e7cb444e d3d12: Track a global resource state for non-simultaneous-access resources
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 6acab47d7f d3d12: Create/free context state entries
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie f972a57b0b d3d12: Treat depth/stencil as planar for plane count helper
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 6bc5df76d3 d3d12: Add a context state tracking structure
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 6a8070bcef d3d12: Notify contexts about deletion of bos
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 375e8b2f4b d3d12: Hold lock when removing resources from residency list
Also, remove them from the list before releasing the ID3D12Resource.

Fixes: 671deb54 ("d3d12: Add residency info to d3d12_bo")
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie b72ec453bd d3d12: Add a list of contexts alive for the current screen
When a resource is destroyed, we'll need to let the contexts know.
This is guarded by the submit mutex, because we'll already be holding
that for at least one place where we want to iterate this list, and
it's low-frequency enough that re-using it is simpler than adding more
locks and creating confusing lock ordering.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 17c3f4f3e1 d3d12: Give bos a unique identifier to be used for state tracking
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie bc9616129e d3d12: Move current resource state to new files
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 2016dec6a4 d3d12: Move desired resource state to new files
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie a277dbf1f4 d3d12: Add a blank d3d12_resource_state.h/cpp
This will host some code that's moving and ported to match style
with the rest of the driver, and other code that will be re-written.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Mike Blumenkrantz 6b07893b31 util/vbuf: handle multidraws
this moves the handling from cso_conext to vbuf, which reduces overhead
for draws that aren't rewritten

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17686>
2022-07-22 12:40:56 +00:00
Timothy Arceri 7c484b0c1c glsl: correctly track cross slot component packing
Otherwise we will mix and match mesa's custom cross slot packing
with arb_enhanced_layouts style packing and we won't correctly
handle the size of the vars needed for the mesa custom packing.

The code was working correctly if the shader interface had both
a matching input and output but when we only had one side of
the interface we were only marking a single slot location as
packed.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Fixes: e5122a5543 ("glsl: add a NIR based varying linker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6853
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17550>
2022-07-22 10:43:18 +00:00
Lucas Stach 00955a644e etnaviv: remove etna_align_up() function
It does the same thing as align() from u_math.h, no need to
have a etnaviv specific version.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17695>
2022-07-22 09:08:29 +00:00