Alyssa Rosenzweig [Wed, 27 Apr 2022 16:10:37 +0000 (12:10 -0400)]
panfrost: Use row_stride even for linear resources
In that case, they match up.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:48:47 +0000 (11:48 -0400)]
panfrost: Adapt get_param for row strides
Let's preserve the old behaviour -- this is UABI, we need to be bug for bug
compatible.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:37:40 +0000 (11:37 -0400)]
panfrost: Use row stride to calculate slice size
This expresses what's actually happening. Equivalent to the old calculation due
to some cancellation.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:24:57 +0000 (11:24 -0400)]
panfrost: Rename away from bytes_per_pixel
This name is wrong for block-compressed formats. The code worked out anyway, but
rename it for clarity.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:23:37 +0000 (11:23 -0400)]
panfrost: Use row stride for explicit layouts
Line strides don't make sense for linear images, so use row strides instead in
the API. Then update the layout code accordingly.
Note: we need to preserve the old UABI (bug for bug compatibility), so we still
use legacy strides externally. But now we use row strides internally, which is
better than using both everywhere.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 16:25:11 +0000 (12:25 -0400)]
panfrost: Add helpers to work with legacy strides
Unfortunately, the botched nonlinear "line strides" have become ingrained in the
UABI. We need to be work with them. Add safe helpers to convert to/from the
legacy strides.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:20:54 +0000 (11:20 -0400)]
panvk: Report row_stride in GetImageSubresourceLayout
...Rather than line_stride. For linear images, these are equivalent. For
nonlinear images, rowPitch is implementation-defined. So this isn't strictly a
bug fix, but it gets rid of the nonsense nonlinear line_stride.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:40:44 +0000 (11:40 -0400)]
panvk: Remove unused layout structs
PanVK switched to the common Panfrost layout code, but these duplicate structs
stuck around. Garbage collect them to prevent confusion.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Alyssa Rosenzweig [Wed, 27 Apr 2022 15:31:39 +0000 (11:31 -0400)]
pan/decode: Print row strides, not line strides
I.e. what's actually passed to the hardware, in case of compression or tiling.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
Karmjit Mahil [Mon, 14 Feb 2022 14:27:33 +0000 (14:27 +0000)]
pvr: Add compute update kernel in vkCmdDispatch().
We upload a new data section whenever a patched variant is
needed. They will be freed at command buffer destruction since
the uploads are linked.
Co-authored-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
Karmjit Mahil [Mon, 14 Feb 2022 14:13:19 +0000 (14:13 +0000)]
pvr: Add compute update shared kernel in vkCmdDispatch().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
Karmjit Mahil [Mon, 14 Feb 2022 13:49:30 +0000 (13:49 +0000)]
pvr: Add initial implementation of vkCmdDispatch().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
Karmjit Mahil [Thu, 24 Mar 2022 17:05:45 +0000 (17:05 +0000)]
pvr: Add PVR_WORKGROUP_DIMENSIONS define.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
Lionel Landwerlin [Tue, 3 May 2022 09:19:43 +0000 (12:19 +0300)]
anv: fix invalid utrace memcpy l3 config on gfx < 11
device->l3_config is only valid on Gfx11+
This only fixes using GPU_TRACE=1
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes:
02a4d622ed0 ("anv: expose a couple of emit helper to build utrace buffer copies")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16291>
Mike Blumenkrantz [Mon, 2 May 2022 15:15:40 +0000 (11:15 -0400)]
llvmpipe: disable compute statistics queries if queries are disabled
cc: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
Mike Blumenkrantz [Mon, 2 May 2022 15:14:26 +0000 (11:14 -0400)]
llvmpipe: remove misleading query comment
u_blitter already handles this
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
Mike Blumenkrantz [Mon, 2 May 2022 15:14:06 +0000 (11:14 -0400)]
llvmpipe: disable statistic queries during draw if queries are disabled
cc: mesa-stable
fixes (zink):
spec@ext_transform_feedback@generatemipmap prims_generated
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
Pierre-Eric Pelloux-Prayer [Fri, 29 Apr 2022 14:40:09 +0000 (16:40 +0200)]
radeonsi: generate unique shader name in si_get_nir_shader
This function modifies the NIR shader, so when using NIR_DEBUG=print and
nir_viewer all the variants are displayed using the original name.
With this change, we get the original shader (eg: GLSL3), and then each
variant gets its own name (GLSL3-xxxxxxxx) - and is displayed in its
own tab in nir_viewer.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16247>
Pierre-Eric Pelloux-Prayer [Fri, 29 Apr 2022 14:39:43 +0000 (16:39 +0200)]
radeonsi: don't always strip NIR debug infos
When using NIR_DEBUG=print, always having shader names help debugging.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16247>
Joshua Ashton [Wed, 16 Mar 2022 18:07:04 +0000 (18:07 +0000)]
aco: Use movk for AddressHi bits in vertex prolog
Eliminates a useless extra dword by transforming
s_mov_b32 s47, 0xffff8000 ;
beaf03ff ffff8000
to
s_movk_i32 s47, 0x8000 ;
b02f8000
which does the same thing.
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15415>
Daniel Schürmann [Fri, 29 Apr 2022 15:05:10 +0000 (17:05 +0200)]
aco/ra: fix live-range splits of phi definitions
It could happen that at the time of a live-range split,
a phi was not yet placed in the new instruction vector,
and thus, instead of renamed, a new phi was created.
Fixes: dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i8vec2
Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16248>
Konstantin Seurer [Mon, 2 May 2022 07:33:45 +0000 (09:33 +0200)]
ac/nir: Do not set cursor in try_extract_additions
Fixes: 61ac5ac ("radv,ac/nir: lower global access to _amd global access intrinsics")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16270>
Samuel Pitoiset [Fri, 29 Apr 2022 16:24:32 +0000 (18:24 +0200)]
radv: use 3D views for 3D internal operations on GFX6-8
Instead of binding 2D images views and relying on BASE_ARRAY.
This cleanups the internal driver operations for 3D.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16272>
Timothy Arceri [Thu, 28 Apr 2022 03:24:06 +0000 (13:24 +1000)]
nir: fix sorting before assigning varying driver locations
We need to make sure we also properly sort varyings sharing a single
slot otherwise we can end up assigning earlier components to the next
slot if we have already processed later components.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6392
Fixes:
1e93b0caa10d ("mesa/st: add support for NIR as possible driver IR")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16208>
Emma Anholt [Thu, 28 Apr 2022 18:38:46 +0000 (11:38 -0700)]
util: Add some unit tests of the half-float conversions.
Make sure that we're handling nans/infs correctly, in particular only
generating quiet nans when given a quiet nan. This catches the previous
qNaN fix.
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16233>
Chia-I Wu [Thu, 28 Apr 2022 21:25:36 +0000 (14:25 -0700)]
util: Keep quiet NaNs quiet when converting to half float.
We don't want to be throwing exceptions and changing float values later by
emitting a signaling binary16 nan.
If we don't do this, then when we convert back to f32 in NIR constant
expression evaluation, the signaling NaN can end up giving NaN for
fmax(NaN, 0.0), instead of 0.0.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5933
Cc: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16233>
Lionel Landwerlin [Fri, 22 Apr 2022 21:13:07 +0000 (00:13 +0300)]
iris: use new kernel uAPI to compute video memory
v2: Use os_get_available_system_memory() when kernel memory region
uAPI is not available (Lionel)
Cc: 22.1 <mesa-stable>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-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/16210>
Jason Ekstrand [Wed, 27 Apr 2022 22:28:26 +0000 (17:28 -0500)]
panvk: Add address/range helpers for panvk_buffer
The range helper is taken from ANV; the gpu_ptr one is original. This
also fixes a few more bugs where we weren't adding offsets in properly.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16216>
Alyssa Rosenzweig [Wed, 27 Apr 2022 23:14:37 +0000 (19:14 -0400)]
panvk: Only write depth when depth test enabled
Fixes dEQP-VK.pipeline.depth.format.*_test_disabled.depth_write_enabled
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
Alyssa Rosenzweig [Wed, 27 Apr 2022 19:44:38 +0000 (15:44 -0400)]
panvk: Lower image deref atomics
Fixes dEQP-VK.image.atomic_operations.*
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
Alyssa Rosenzweig [Mon, 25 Apr 2022 21:40:34 +0000 (17:40 -0400)]
pan/bi: Handle texture offset + index
Fixes dEQP-VK.glsl.opaque_type_indexing.sampler.uniform.vertex.sampler1d
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
Alyssa Rosenzweig [Mon, 25 Apr 2022 20:29:15 +0000 (16:29 -0400)]
panvk: Allocate stack for each thread
Rather than a single stack for all threads to share -- that can't work! :-) We
use the same helper that the GLES driver does. Fixes anything using scratch or
spilling, including:
dEQP-VK.glsl.indexing.varying_array.vec3_static_write_dynamic_read
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
Alyssa Rosenzweig [Mon, 25 Apr 2022 20:07:12 +0000 (16:07 -0400)]
panvk: Lower global vars to local
Fixes dEQP-VK.glsl.indexing.varying_array.float_static_write_static_loop_read
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
Yiwei Zhang [Fri, 29 Apr 2022 22:58:41 +0000 (22:58 +0000)]
venus: log performance envs upon instance creation with debug init
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Change-Id: I8db93d6de28ac6a727c10fbaca94cffac092f8ea
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16256>
Yiwei Zhang [Fri, 29 Apr 2022 21:08:55 +0000 (21:08 +0000)]
venus: add VN_RELAX_BASE_SLEEP_US env var for tuning cpu utils
Cap the minimum to the current base sleep us 10.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16256>
Rob Clark [Sat, 30 Apr 2022 17:22:31 +0000 (10:22 -0700)]
drm-shim: Cleanup on device file close
Avoid leaking memory when the device file is closed, dropping bo
references and freeing the shim_fd.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Rob Clark [Fri, 29 Apr 2022 16:20:07 +0000 (09:20 -0700)]
freedreno/drm-shim: Better iova handling
We actually want to use util_vma to handle this. But fortunately core
drm-shim alredy does this for mem offset, we can just delete a bunch of
code and re-use that.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Rob Clark [Fri, 29 Apr 2022 16:17:47 +0000 (09:17 -0700)]
drm-shim: Add error handling for bo_init()
Don't assert, return an error. If we are fuzzing something using
drm-shim, we want to be more like the kernel and return an error
for OoM situation, rather than falling over.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Rob Clark [Thu, 28 Apr 2022 22:36:54 +0000 (15:36 -0700)]
drm-shim: Better mmap offsets
Using the bo pointer address as the offset doesn't go over well when
someone is fuzzing you. But we already have the mem_addr, we can simply
use that instead.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Rob Clark [Wed, 27 Apr 2022 23:16:27 +0000 (16:16 -0700)]
freedreno/drm-shim: Robustify error handling
We can't be so sloppy if we are using drm-shim for fuzzing.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Rob Clark [Wed, 27 Apr 2022 21:54:58 +0000 (14:54 -0700)]
freedreno/drm-shim: Update to latest uapi version
Needed for fuzzing virgl drm native context.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Rob Clark [Wed, 27 Apr 2022 21:53:19 +0000 (14:53 -0700)]
drm-shim: Add GET_UNIQUE support
Needed by drmOpenWithType(), which is used by virgl drm native context.
(We want to use drm-shim for fuzzing.)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
Iván Briano [Fri, 29 Apr 2022 21:54:46 +0000 (14:54 -0700)]
vulkan/wsi/wayland: Fix double free on error condition
If wsi_configure_native_image() fails, it will call
wsi_destroy_image_info() itself, so let's try to not call it again from
wsi_wl_swapchain_destroy().
Fixes the CTS tests:
dEQP-VK.wsi.wayland.swapchain.simulate_oom.*
Fixes:
b626a5be43d ("vulkan/wsi/wayland: Split image creation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16257>
Lionel Landwerlin [Mon, 2 May 2022 13:32:36 +0000 (16:32 +0300)]
vulkan/runtime: 0-out pipeline cache object
I'm running into crashes because cache->cache_object is uninitialized.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes:
591da9877900 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16275>
Caio Oliveira [Sat, 12 Mar 2022 07:17:38 +0000 (23:17 -0800)]
intel/compiler: In XeHP prefer <1;1,0> regions before compacting
Ken performed some tests with shader-db to evaluate the effects
```
Across all 145,848 shaders generated, the results were:
Total bytes compacted before: 3,326,224
Total bytes compacted after: 60,963,280
```
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15399>
Mike Blumenkrantz [Mon, 2 May 2022 15:34:08 +0000 (11:34 -0400)]
llvmpipe: add a ci flake
not able to repro locally
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16280>
Jesse Natalie [Wed, 27 Apr 2022 22:27:44 +0000 (15:27 -0700)]
d3d12: Destroy empty residency bo set during early-return
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 19:49:03 +0000 (12:49 -0700)]
d3d12: Fix a couple over-releases from incorrect take-ownership flag
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 19:48:20 +0000 (12:48 -0700)]
d3d12: Fix leaks in map with do-not-wait
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 20:58:31 +0000 (13:58 -0700)]
d3d12: Use a pipe_reference in d3d12_bo
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 23:24:04 +0000 (16:24 -0700)]
u_primconvert: Handle take_index_buffer_ownership
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 23:03:16 +0000 (16:03 -0700)]
u_primconvert: Refactor to remove recursion from util_primconvert_draw_vbo
This prevents having unused copies of pipe_draw_info and
pipe_draw_start_count_bias on the stack, and makes it easier to do
things once for a multi-draw, which will matter in the next patch.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 23:25:13 +0000 (16:25 -0700)]
u_debug_stack: Lock around stack dumps to prevent interleaving
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 19:47:50 +0000 (12:47 -0700)]
u_debug_symbol: Allow re-init of DbgHelp to work around already-initialized issues
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 19:47:43 +0000 (12:47 -0700)]
u_debug_symbol: Use correct sizeof for DbgHelp
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 19:41:12 +0000 (12:41 -0700)]
u_debug_refcnt: Don't loop for initial refcounts if the initial value is huge
Some components use very large refcounts to bypass atomics in single-threaded
cases, and this produces near-infinite loops when these resources are created.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Tue, 26 Apr 2022 19:36:09 +0000 (12:36 -0700)]
bin: Add a script for filtering/sorting refcount logs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
Jesse Natalie [Thu, 28 Apr 2022 22:48:45 +0000 (15:48 -0700)]
mesa: Ensure ARB programs end in a newline
If the last line of an ARB program has a comment, the program will
fail to parse, because the lexer only considers a comment valid if
it ends in a newline, not EOF. The parser then fails on the '#'.
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16230>
Jesse Natalie [Fri, 29 Apr 2022 20:14:34 +0000 (13:14 -0700)]
d3d12: Correctly key off of polygon stipple enable cap
Apparently we were only keying off the presence of a real stipple pattern
being set, and completely ignoring when the app does glDisable().
Add in the actual enable bit as an additional discriminator to determine
if we should be doing polygon stippling.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16254>
Alyssa Rosenzweig [Mon, 2 May 2022 14:55:33 +0000 (10:55 -0400)]
pan/va: Add non-IDVS VAR_TEX instructions
Used in blit shaders.
Icecream95 supplied the test cases.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Alyssa Rosenzweig [Mon, 2 May 2022 14:58:43 +0000 (10:58 -0400)]
pan/va: Add VAR_TEX_BUF_GRADIENT instruction
Probably useful for ... something.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Icecream95 [Fri, 25 Mar 2022 21:37:56 +0000 (10:37 +1300)]
pan/va: Improve texture instructions
[Alyssa: Related improvements.]
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Icecream95 [Fri, 25 Mar 2022 21:40:17 +0000 (10:40 +1300)]
pan/va: Add absneg modifier to V2F32_TO_V2F16
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Icecream95 [Fri, 25 Mar 2022 21:35:48 +0000 (10:35 +1300)]
pan/va: Add SEG_ADD/SEG_SUB operation
[Alyssa: Fixes to the instruction.]
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Icecream95 [Fri, 25 Mar 2022 21:34:44 +0000 (10:34 +1300)]
pan/va: Add more transcendental operations
TODO: Make the secondary opcode field wider so that FATAN_ASSIST can
be split into two instructions
[Alyssa: Fixes to the hardware behaviour.]
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Icecream95 [Fri, 25 Mar 2022 21:32:13 +0000 (10:32 +1300)]
pan/va: Improvements to LEA_TEX instructions
[Alyssa: Fixes to match hardware.]
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Alyssa Rosenzweig [Wed, 30 Mar 2022 14:27:16 +0000 (10:27 -0400)]
pan/va: Mark NOT instructions as deprecated
The inverters on the bitwise ops should be used instead.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Alyssa Rosenzweig [Wed, 30 Mar 2022 14:13:14 +0000 (10:13 -0400)]
pan/va: Add missing TABLE (SFU) instructions
Equivalent to their Bifrost predecessors.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Alyssa Rosenzweig [Mon, 2 May 2022 15:10:37 +0000 (11:10 -0400)]
pan/va: Generalize message? check for asm
Allows passing more uniforms in more places. We'll use this in a test case in a
moment.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15588>
Alyssa Rosenzweig [Mon, 2 May 2022 13:19:41 +0000 (09:19 -0400)]
panfrost: Flip point coords in hardware
On Bifrost, this is very easy: there's an RSD bit to Y-flip gl_PointCoord. It
should map perfectly to the Gallium bit. With this change, we no longer use
lower_pntc_ytransform on Bifrost, saving a bit of ALU when reading point
coordinates.
On Valhall, this is quite hard: the bit is in the framebuffer descriptor now!
That means it can't be changed in a batch. This is expected to be ok: on GLES
and VK, the origin is controlled only by the framebuffer orientation. It's a
bigger problem on big GL, where GL_POINT_SPRITE_COORD_ORIGIN can be set freely.
To cope, a tri-state data structure is used for the state tracking. This has a
failure case on Valhall: every draw toggling the coord origin. However, the
intention of the ORIGIN state bit is smoothing over coordinate system
differences; it should never /actually/ change once set. Until we see an app
doing something so stupid, I don't think we should worry about.
We need all the Valhall tri-state infrastructure for handling provoking vertices
on big GL anyway.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 20:32:01 +0000 (16:32 -0400)]
panfrost: Lower user clip planes
Since we don't export the relevant CAP, the state tracker calls
nir_lower_clip_vs for us. However, for some reason we're still responsible for
calling nir_lower_clip_fs. Now that we have sane shader key infrastructure,
let's do so.
Fixes the floor rendering wrong in the title screen of Neverball.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 18:50:00 +0000 (14:50 -0400)]
panfrost: Lower point sprites on Bifrost
Use the common pass. This only should trigger when drawing points, so we need
some extra tracking to ensure this.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 19:46:00 +0000 (15:46 -0400)]
panfrost: Refactor variant rebind code
For point sprite lowering on Bifrost and Valhall.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 18:29:55 +0000 (14:29 -0400)]
panfrost: Refactor variant selection code
Extract the "compile a new variant" routine from the "select and bind a variant"
routine. This allows us to simplify the control flow, eliminating the `compiled`
boolean on the shader structure.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 16:37:59 +0000 (12:37 -0400)]
panfrost: Simplify shader key architecture
Rather than clever key compare/initialize code, let's make the shader keys plain
old data. This makes it easier both to extend and to optimize the shader keys.
Keys are compared with a simple memcmp(). I considered a hash table but I don't
think we have enough variants (or large enough keys) to justify the overhead.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 18:13:46 +0000 (14:13 -0400)]
panfrost: Use s->info.stage instead of tgsi stage
Now that we have the NIR handy.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 18:01:41 +0000 (14:01 -0400)]
panfrost: Don't subclass pipe_compute_state
Just copy the bit we need so the NIR doesn't hang around. This is simpler.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 17:58:19 +0000 (13:58 -0400)]
panfrost: Call tgsi_to_nir earlier
This ensures we always have NIR available in the shader state. It also saves a
(trivial) amount of recomputation if multiple TGSI variants are needed.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Tue, 26 Apr 2022 16:17:02 +0000 (12:17 -0400)]
panfrost: Remove ancient unused code
Leftover scraps.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
Alyssa Rosenzweig [Wed, 27 Apr 2022 22:57:04 +0000 (18:57 -0400)]
panvk: Emit fragment RSDs even with no shader
In Vulkan, it's possible to create a pipeline with no fragment shader that's
still expected to rasterize. This is useful for depth/stencil side effects, and
is closely related to the "fragment shader required" optimization we do in the
GLES driver. Refactor the RSD emit code to handle this case.
Fixes dEQP-VK.pipeline.stencil.nocolor.*
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
Alyssa Rosenzweig [Wed, 27 Apr 2022 22:54:49 +0000 (18:54 -0400)]
panvk: Gate rasterization on !discard, not fs req
The "fragment shader required?" computed state is about fragment shader side
effects. There may be no fragment shader required but depth/stencil side effects
meaning that rasterization is nonoptional. What actually gates rasterization is
the rasterizer discard bit. Use that instead.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
Alyssa Rosenzweig [Wed, 27 Apr 2022 22:56:36 +0000 (18:56 -0400)]
panvk: Streamline no shader RSD case
Noticed by inspection.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
Alyssa Rosenzweig [Mon, 25 Apr 2022 19:11:34 +0000 (15:11 -0400)]
panfrost: Only flip point sprites for GL
Fixes dEQP-VK.glsl.builtin_var.simple.pointcoord
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
Alyssa Rosenzweig [Mon, 25 Apr 2022 16:36:47 +0000 (12:36 -0400)]
panvk: Use correct point size limits
As determined by Icecream95. Fixes:
dEQP-VK.rasterization.primitive_size.points.point_size_*
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
Alyssa Rosenzweig [Mon, 25 Apr 2022 16:24:04 +0000 (12:24 -0400)]
panvk: Ignore point size for !points
Otherwise wide lines break. The alternative approach is to eliminate the points
writes when not drawing points since we do have topology information at compile
time. I'm admittedly stuck in my GL mindset. That's the approach we'll need for
Valhall anyway.
Fixes dEQP-VK.rasterization.interpolation.basic.lines_wide
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
Icecream95 [Fri, 29 Apr 2022 20:36:40 +0000 (08:36 +1200)]
pan/bi: Use texture index instead of sampler for message preloading
The VAR_TEX definition in ISA.xml only has a field for texture_index,
so trying to read sampler_index will return zero; read from
texture_index instead, and rename other fields for consistency.
The texture and sampler indices must be equal for VAR_TEX to be used,
so either name could be used for the field.
Fixes the wrong textures being used in Thief.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6219
Fixes:
eb1479bda22 ("pan/bi: Support message preloading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16255>
Gert Wollny [Sun, 1 May 2022 20:49:01 +0000 (22:49 +0200)]
r600: Allow eight bit, three channel formats for vertex buffers
While using three component texture formats results in CTs failures,
three component vertex attributes are fine, and not allowing them
results in significant performance regressisons.
Fixes:
e41958e344cb4b15d01008140a1ee08817104334
r600: Disable eight bit three channel formats
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6399
v2: rename function to is_buffer_format_supported (Emma)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16267>
Lionel Landwerlin [Wed, 6 Apr 2022 19:56:00 +0000 (22:56 +0300)]
anv: limit clflush usage
Discrete platforms don't have LLC, but on those, we mmap our buffers
with WC. So we shouldn't need to clflush there.
Anv already had a boolean field on the physical device to know whether
we need to use clflush(), based off the memory heaps available. So use
that instead.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15780>
Lionel Landwerlin [Thu, 7 Apr 2022 08:20:52 +0000 (11:20 +0300)]
anv: fix clflush usage on utrace copy batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes:
cc5843a573bd ("anv: implement u_trace support")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15780>
Pierre-Eric Pelloux-Prayer [Fri, 29 Apr 2022 15:51:11 +0000 (17:51 +0200)]
radeonsi: fix VS kill_outputs handling
981bd8cbe2d moved outputs removing handling to NIR, but instead of
applying it only to the last stage before the FS this now applies
it to both the GS and the VS.
This commit fixes this by clearing the kill_outputs field for
the VS when using a ES-GS shader.
Fixes:
981bd8cbe2d ("radeonsi: apply key.ge.opt.kill_{outputs,pointsize,clipdistance} in NIR")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16249>
Rhys Perry [Wed, 27 Apr 2022 14:29:34 +0000 (15:29 +0100)]
radv: consider radix sort shaders to be internal/meta
Cleans up RADV_DEBUG=shaders
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16198>
Iago Toral Quiroga [Tue, 26 Apr 2022 07:28:59 +0000 (09:28 +0200)]
v3dv: ignore barriers for image layout transitions from undefined layouts
Layout transitions are not relevant to us, we only care about barriers
that involve a sync point between read/write actions on the image across
GPU jobs.
Image transitions from undefined layout can only happen before the image
is ever used by the GPU, which means they are never relevant to our
implementation.
This improves performance in vkQuake.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16235>
Iago Toral Quiroga [Tue, 26 Apr 2022 07:07:54 +0000 (09:07 +0200)]
v3dv: document Vulkan requirements for signaling operations
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16235>
Iago Toral Quiroga [Thu, 21 Apr 2022 09:08:48 +0000 (11:08 +0200)]
v3dv: don't emit final noop job if we don't have anything to signal
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16235>
Iago Toral Quiroga [Tue, 19 Apr 2022 06:45:22 +0000 (08:45 +0200)]
v3dv: drop obsolete comment
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16235>
Iago Toral Quiroga [Wed, 13 Apr 2022 08:40:54 +0000 (10:40 +0200)]
v3dv: ignore no-op barriers
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16235>
Alyssa Rosenzweig [Sun, 1 May 2022 22:27:56 +0000 (18:27 -0400)]
agx: Lower mediump flat shading
This isn't supported by the hardware. Fixes
dEQP-GLES2.functional.shaders.constants.float_uniform_vertex
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>
Alyssa Rosenzweig [Sun, 1 May 2022 21:51:09 +0000 (17:51 -0400)]
agx: Remove nir_register support
We don't use it anymore, now that we can handle SSA form. Gets rid of
the most gross hack in the compiler.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>
Alyssa Rosenzweig [Sun, 1 May 2022 21:47:22 +0000 (17:47 -0400)]
agx: Remove has_liveness
Given we do no metadata tracking, this is an accident waiting to happen.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>
Alyssa Rosenzweig [Sun, 1 May 2022 21:12:17 +0000 (17:12 -0400)]
agx: Update RA comment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>