Commit graph

193968 commits

Author SHA1 Message Date
Caio Oliveira
31dfb04fd3 intel/brw: Remove long register file names
The long names were originally meant to map to the HW encoding but
nowadays the actual encoding values depend on gfx version, whether
instruction is 3src, etc.

Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
6bdf2de4d2 intel/brw: Remove unused ARF values and helpers
These were used by old Gfx versions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
72b687abb4 intel/brw: Make BAD_FILE the zero value for brw_reg_file
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
e8f921678a intel/brw: Explicitly map brw_reg_file into hardware values
For now this is a no-op, but will be useful when changing the enum
to values that don't match the hardware.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
e7179232c9 intel/brw: Move encoding of Gfx11 3-src inside the inst helpers
Create specific helper for register file encoding and handle it there.
Use ad-hoc structs to let the macro take optional named arguments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
d31c8bfb6f intel/brw: Remove more uses of variable length arrays
In these cases there's a clear bound we can use.  In C++ this is a
compiler extension and not compatible with zero initializing a
regular struct -- which will happen in a later change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
86c20e2910 intel/brw: Use a helper for common VEC pattern
In the helper, instead of using the Variable Length Array, use a
fixed size array to NIR_MAX_VEC_COMPONENTS.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
abc535a3b4 intel/brw: Remove unused variable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:13 +00:00
Lepton Wu
72506ac8c7 egl/android: Fix wrong pipe format for RGB_565
We were actually using PIPE_FORMAT_B5G6R5_UNORM for HAL_PIXEL_FORMAT_RGB_565
since Android support was added to Mesa. This restores the original behavior.

Fixes: 273e54391a ("egl/android: Remove hard-coded color-channel data")

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Lepton Wu <lepton@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30827>
2024-08-25 21:01:15 +00:00
Karol Herbst
e9d908206b vtn: ignore volatile on functions for now
Not sure if we have to do something about it here, but maybe at some point
we do?

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30739>
2024-08-25 14:11:32 +00:00
Karol Herbst
eef1af8128 rusticl/device: limit CL_DEVICE_IMAGE_MAX_BUFFER_SIZE more aggressively
We can't exceed c_int::MAX, because the CTS casts to ints in a few places.

We also need to take into account max pixel size when restricting to
max_mem_alloc as this cap is pixel based, not byte based.

Cc: mesa-stable

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30739>
2024-08-25 14:11:32 +00:00
Konstantin Seurer
81e3930ec0 nir/print: Add a helper for generating debug info
Prints the shader to a string and assigns source locations based on
that.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903>
2024-08-25 10:26:33 +00:00
Konstantin Seurer
4423c50c1b spirv: Emit nir_debug_info_instr for OpLine
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903>
2024-08-25 10:26:33 +00:00
Konstantin Seurer
ce24486ee4 nir: Introduce nir_debug_info_instr
Adds a new instruction type that stores metadata that might be useful
for debugging purposes. Passes must ignore these instructions when
making decisions.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903>
2024-08-25 10:26:33 +00:00
David Heidelberg
a70968c62f freedreno: update night expectations
Acked-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30830>
2024-08-25 04:26:03 +00:00
Mauro Rossi
7b32df696e nvk: Fix regression observed on Kepler
vkcube, vkgears and vkmark are crashing with the following error/segfault:

$ NVK_I_WANT_A_BROKEN_VULKAN_DRIVER=1 vkcube
WARNING: NVK is not a conformant Vulkan implementation, testing use only.
Selected GPU 0: GeForce GT 640 (NVK GK107), type: DiscreteGpu
ERROR: couldn't get DataFile for op ldc_nv
Segmentation fault (core dumped)

Handling nir_intrinsic_ldc_nv as per nir_intrinsic_load_ubo in Converter::getFile()
allows to run vkcube, vkgears and vkmark on Nvidia GT640

Fixes: dc99d9b2 ("nvk,nak: Switch to nir_intrinsic_ldc_nv")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30832>
2024-08-24 22:15:45 +02:00
Karol Herbst
74dafa3c79 ac/llvm: fix umul_high
LLVM optimizes umul_hi with a constant to v_mul_hi_i32_i24_e32 which isn't
always what we need here. This causes miscalculations. To prevent LLVM to
apply this optimization, we insert a optimization barrier.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11761
Suggested-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30810>
2024-08-24 16:10:20 +00:00
Juan A. Suarez Romero
2162cf7476 v3d/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30823>
2024-08-24 14:54:23 +00:00
Valentine Burley
aeba937762 nvk: Advertise VK_EXT_legacy_vertex_attributes
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30817>
2024-08-24 03:55:37 +00:00
Faith Ekstrand
fef77e1d4c nvk: Treat NULL vertex/index buffer pointers as null descriptors
Previously, we trusted the caller to set the size to zero for null
descriptors.  However, device-generated commands allows specifying a
zero device address with a non-zero size.  We may as well handle this
case directly in the MME and keep our command emit shader simple.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:57 +00:00
Faith Ekstrand
f83e573c1a nvk: Use the new dispatch helper for queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:57 +00:00
Faith Ekstrand
105bdf2e36 nvk: Add a helper for dispatching compute shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Faith Ekstrand
83feed1d22 nvk: Refactor compute shader dispatch
This splits state flushing from QMD/root upload.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Faith Ekstrand
db0c2aa796 nvk: Expose a new nvk_compile_nir_shader() helper
This helper is intended for internal driver shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Faith Ekstrand
cdef36c422 nvk: Disable conditional rendering around CopyQueryPoolResults
Fixes: 57c38a5669 ("nvk: Implement CopyQueryPoolResults with a compute shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Dylan Baker
24d9cea5ff mesa/program: remove memcpy where src == dst
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30802>
2024-08-23 21:45:34 +00:00
Rob Clark
76e350671f freedreno/a6xx: Sysmem clear fixes
Handled signed/unsigned channel clamping.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11676
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30794>
2024-08-23 17:55:46 +00:00
Mike Lothian
2cf590dd60 Revert "device_select: shortcut EnumeratePhysicalDevice* for count-only calls"
This reverts commit 86bb1036e2.

This is causing crashes in the Vulkan backend of Chromium

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11769
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30820>
2024-08-23 17:22:54 +00:00
Eric R. Smith
9e04c0a818 panfrost: add support for image2DMSArray on bifrost
On bifrost we only can use 3 coordinates for images, but
image2DMSArray needs 4 (x, y, sample#, and array index).
We work around this by making the image nr_samples times
higher than the original image, using the Y coordinate to
address the sample plane. This limits the maximum image
height (to 4K pixels instead of 64K pixels in the 16 sample
case) but at least allows us to use the images.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
3173b2c9b7 panfrost: implement image2dms support for valhall
On valhall, the sample index should go in the R component
of the image load/store/lea instruction. This provides a
straightforward way to implement image2DMS and
image2DMSArray image load and store for valhall.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
657591728a panfrost: move lower_image_ms to after lower_atomics
The nir_lower_image_atomics_to_global pass can create some image
load/stores, so we need to do the multisample image load/store
lowering after this.

Also, the pass only actually works on bifrost and below, so skip it
for valhall.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
346ec90fdd panfrost: move pan_arch definition out of genxml to pan_props.h
The pan_arch function is useful elsewhere, and doesn't rely on
anything else within genxml/gen_macros.h.

It's useful, for example, to find the architecture from the
GPU id in bifrost_compile.c, where before we were using ad-hoc
shifting.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
1fd00e4270 panfrost: Add b2i16 conversion to table
This is needed by the newer image2dMS code.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
chyyran
8c68eeb890 spirv_to_dxil: add missing SPIR-V capabilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30776>
2024-08-23 16:36:59 +00:00
Mike Blumenkrantz
0e73926c20 device-select: block xserver+zink reordering via xcb
this is broken

Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30816>
2024-08-23 16:00:47 +00:00
Nanley Chery
23658920d1 anv,iris: Skip tex invalidate for clear conversion
The hardware's clear color conversion feature requires invalidating the
texture cache for every fast clear. We're no longer using the hardware
feature, so we longer need the invalidation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Nanley Chery
7b9400b7f7 intel/blorp: Don't use clear color conversion on gfx12
Instead of using the clear color conversion feature by the hardware, use
software to write out the converted clear color pixel.

When testing a patch which moves a state cache invalidate to occur after
fast clears instead of before, this prevents the following failures on
tgl/zink:

* piglit.spec.arb_texture_cube_map_array.arb_texture_cube_map_array-cubemap
* piglit.spec.ext_framebuffer_object.fbo-generatemipmap-formats

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Nanley Chery
b404ca0eb0 intel: Don't use HW clear color conversion on gfx11
The hardware's clear color conversion feature unfortunately requires
invalidating the texture cache for every fast clear. To avoid the
performance penalty that comes with the invalidation, avoid using the
hardware feature and write out the converted clear color pixel
ourselves.

When testing a patch which moves a state cache invalidate to occur after
fast clears instead of before, this prevents the following failures on
icl/zink:

* piglit.fast_color_clear.fcc-read-after-clear sample tex
* piglit.spec.arb_clear_texture.arb_clear_texture-cube

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Nanley Chery
dfcd93d12f intel/isl: Fix packing of SINT formats
Prevents the next patch from failing many multisampled, signed integer
rendering tests. For example:

 dEQP-VK.renderpass2.suballocation.multisample_resolve.r8_sint.samples_4

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Boris Brezillon
fba1c3c721 panvk: Prepare cmd_meta for Valhall
We don't have an RSD descriptor on Valhall, and the vertex
attributes are part of the driver descriptor set, which we
re-emit anyway.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
713f5c3600 panvk: Prepare the cmd_desc_state logic for Valhall
Quite a few things are common to Valhall/Bifrost. Specialize what's
different, and move the move to the root driver directory.

We don't compile it on v10 as this requires the cmd_buffer bits
that are not yet defined.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
c257bf5142 panvk: Conditionally register an host address when tracking user memory
When PANVK_DEBUG=dump, all internal buffers get dumped, but not the user
ones, because they don't have a host address attached to them. Let's
register one when mappings dump is enabled.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
b7e0f14959 panvk: Move panvk_debug_adjust_bo_flags() to panvk_device.h
We will need it for the CSF backend.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
b1db49d078 panvk: Allow more descriptor sets on Valhall
The hardware limit on Valhall is 16 descriptor tables, but we reserve
one for our internal descriptors (dummy sampler, vertex attributes and
dynamic buffers), which leaves us with 15 user descriptor sets.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
5571a4cdaa panvk: Make panvk_queue_finish() a per-arch function
The JM implementation of queue_finish() is simple enough to be inlined,
but that won't be the case of the CSF implementation. So let's make
this function per-arch so we can move it to panvk_vX_queue.c.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Boris Brezillon
09682bc5b0 panvk: Prepare panvk_cmd_pool for CSF
We will have a new BO pool for CS buffers in the CSF backend.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Boris Brezillon
598a8d9d11 panvk: Collect allocated push sets at the command level
It makes the reset of command buffers a tad simpler, and it allows
re-cycling push sets.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Boris Brezillon
5b1cddf35f panvk: Prepare the blend logic for Valhall
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Rebecca Mckeever
c1b3db966a panvk: Move the VkEvent logic to the jm folder and make it per-arch
The CSF implementation will be completely different.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Mary Guillemard
27beadcbdb panvk: Extend the shader logic to support Valhall
Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00