Commit graph

184546 commits

Author SHA1 Message Date
Karol Herbst
9b5bcbb60f rusticl/icd: move retain() and release()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
2024-02-14 14:15:38 +00:00
Karol Herbst
45b9fdb4e5 rusticl/icd: move refcnt() and get rid of needless atomic ops
The old impl used `get_arc` which internally calls into
`Arc::increment_strong_count` in order to protect against Arc::drop
deallocating our objects. We could also just not do that :)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
2024-02-14 14:15:38 +00:00
Karol Herbst
7564b81749 rusticl/icd: move get_ref_vec_from_arr into the Rusticl type
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
2024-02-14 14:15:38 +00:00
Karol Herbst
46227bf44c rusticl/api: allow CLObjectBase to be placed anywhere
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
2024-02-14 14:15:38 +00:00
Karol Herbst
6d8b0a53c6 rusticl/util: support nested structs in offset_of!
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
2024-02-14 14:15:38 +00:00
Karol Herbst
0287aa4b34 rust/api: add RustTypes enum
We want to move away from a 1:1 mapping between CL and Rusticl types, so
that we can differentiate better between different memory types.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
2024-02-14 14:15:38 +00:00
Lionel Landwerlin
e54638ddf5 anv: fix buffer marker cache flush issues on MTL
For some yet unknown reason the CS L3 coherency setting is different
on MTL than DG2.

Fixes issues in tests from the subgroup :

  dEQP-VK.api.buffer_marker.*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c8e122a738 ("anv: Implement rudimentary VK_AMD_buffer_marker support")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27613>
2024-02-14 13:45:46 +00:00
Matt Turner
88d0c6c26a meson: Limit intel_vk_rt to x86_64
Fixes: a512c2a8b5 ("meson: enforce build of intel-clc with anv/iris")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10610
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27608>
2024-02-14 13:08:55 +00:00
Lionel Landwerlin
34078b67ed anv: don't allocate aux padded BOs with host pointers
We can't allocate additional space with host pointers anyway. These
are already allocated pieces of memory by the application.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 646a7c864d ("anv: re-introduce BO CCS allocations")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10608
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27612>
2024-02-14 11:51:33 +00:00
Lionel Landwerlin
feb7cf82dc anv: remove redundant asserts
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/27611>
2024-02-14 11:07:10 +00:00
Iago Toral Quiroga
cc7934a89b broadcom/compiler: fix lane selection for subgroups in fragment shaders
It seems the hardware behavior for this is as per-spec and we are
supposed to identify as active entire quads. Particularly, there
are some derivative tests with dynamic control flow that use
subgroup ballot and require this.

However, we still need to exclude terminted lanes (OpTerminate). For
that, we keep track of the sample mask at the start of a fagment
shader start and compare it with the current sample mask.

Fixes: ('broadcom/compiler: support subgroup reduction operations from fragment shaders')
Fixes: dEQP-VK.glsl.derivate.dynamic_loop.*
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27409>
2024-02-14 08:02:41 +01:00
Mark Janes
2143da6d5a intel/dev: improve meson invocation for intel_device_info gen
Review for related code-generation commits advised that the use of an
--outdir parameter was undesirable.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27557>
2024-02-13 19:38:36 +00:00
Mark Janes
f95b87a3dc intel/tools: load json device info in drm_shim
Enable drm_shim to parse a serialized intel_device_info structure from
json.  When overriding the gpu hardware, drm_shim provides the stubbed
intel_device_info structure to mesa through an unused ioctl.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27557>
2024-02-13 19:38:36 +00:00
Mark Janes
56da473b6f intel/dev/tools: add json as an output format for intel_dev_info
intel_dev_info prints out struct intel_device_info in a user-friendly
format.  Json format enables this information to be used as input for
tools.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27557>
2024-02-13 19:38:36 +00:00
Mark Janes
1f725a222a intel/dev: implement json serialization for intel_device_info
Generate intel_device_serialize.c from a mako template, providing
functions to dump and parse intel_device_info.

intel_device_info.py declares python objects representing all type
declarations associated with intel_device_info.  It is used as a data
source for intel_device_serialize_c.py

intel_device_serialize_c.py emits a c++ file with routines to dump
or load all struct members to/from json.  The json format is a direct
translation of the c structure, with 2 exceptions:

 - When parsing json, the no_hw member is always set to true to
   indicate that the driver's intel_device_info does not correspond to
   the current platform.

 - When dumping to json, devinfo_type_sha1 is calculated to be a
   checksum which changes whenever intel_device_info is updated.  This
   checksum is encoded in json.  When parsing json, the driver verifies
   that the checksum matches before loading data into
   intel_device_info.  This verifies compatibility.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27557>
2024-02-13 19:38:36 +00:00
Casey Bowman
d124542b55 anv: Override VendorID for Hitman 3
XeSS workaround is required for Hitman 3 to launch for Intel cards.

The following was observed during launch, coming from libxess.dll:
"Intel Plugin Extension ERROR: INTC_LoadExtensionsLibrary failed"

Signed-off-by: Casey Bowman <casey.g.bowman@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27477>
2024-02-13 19:02:24 +00:00
Mark Janes
e56f810316 intel/tools: add intel device meson dependencies
idep_intel_dev ensures that headers are generated before dependent
source files are compiled.  Some tools have been building without that
dependency, and encounter intermittent compilation errors on
sufficiently parallel builds.

Any target which depends on idep_intel_dev will link with
libintel_dev.  Redundant link instructions can be removed.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10604
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27600>
2024-02-13 18:37:19 +00:00
Jesse Natalie
161a90abbd dzn: Add a driconf option to disable dzn for specific apps and use it for RDR2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
2024-02-13 17:53:42 +00:00
Jesse Natalie
660c7fe6a7 dzn: Fix tessellation shader insertion into PSO desc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
2024-02-13 17:53:42 +00:00
Jesse Natalie
d5131e5f86 dzn: Simultaneous-access is mutually exclusive with MSAA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
2024-02-13 17:53:42 +00:00
Jesse Natalie
32c6caffd7 spirv2dxil: Trivial fixes for tessellation shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
2024-02-13 17:53:42 +00:00
Jesse Natalie
a3c45306e2 spirv2dxil: Remove dead branches early during shader compilation
Apparently spiregg can produce not-taken branches that somehow try
to access textures that aren't actually declared. These branches
need to be trimmed before any texture lowering is done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
2024-02-13 17:53:42 +00:00
Jesse Natalie
a8758afabd microsoft/compiler: Relax assert for SPIR-V barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
2024-02-13 17:53:42 +00:00
Erik Faye-Lund
b6b980a904 mesa/main: work around chrome/firefox bug
Due to flawed logic, Chromium and Firefox thinks EXT_texture_storage
allows using GL_BGRA8_EXT for *all* texturing, including things like
glTexSubImage2D, which it does not.

However, this bug was introduced in Chromium back in 2016, and there's
also a lot of Electron apps that bundle outdated versions of Chromium.
This means it's going to be a *mess* to fix this properly while staying
within the spec.

I've opened a ticket with Khronos to consider changing the spec to make
this legal, because it seems most other OpenGL implementations allow it.

But in the mean time, let's complain a bit, but accept the behavior.
This way people can at least run browsers with hardware acceleration
again. If we decide to change the spec, we can remove this wording.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10550
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27521>
2024-02-13 17:08:27 +00:00
Erik Faye-Lund
d0cc0e74dd mesa/main: mark GL_BGRA8_EXT as color-renderable
While this is not quite as clear as in the previous commit, I still
believe this is the case, but in a bit of an indirect way:

1. EXT_texture_storage defines that GL_BGRA8_EXT is allowed to be used
   in certain sitations if *either* EXT_texture_format_BGRA8888 *or*
   APPLE_texture_format_BGRA8888 is supported.

2. Surprisingly, EXT_texture_format_BGRA8888 (which we do support) does
   not even mention GL_BGRA8_EXT, only GL_BGRA_EXT.

3. APPLE_texture_format_BGRA8888 on the other hand (which we *don't*
   support) *does* introduce GL_BGRA8_EXT, and is pretty clear about it
   being intended for rendering-purposes. But it's written against GLES
   1.1 instead of GLES 2 or later, so it doesn't explicitly add it to
   the required tables.

I think the above tells us that GL_BGRA8_EXT is *supposed* to be a
color-renderable format, even if the way we currently support it is
rather underspecified.

It should also be texture-filterable, for the same reason as in the
previous commit.

In the longer run, we should probably add support for
APPLE_texture_format_BGRA8888, which would make things a bit clearer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27521>
2024-02-13 17:08:27 +00:00
Erik Faye-Lund
2b2a6a238e mesa/main: mark GL_BGRA as color-renderable
The EXT_texture_format_BGRA8888-spec is quite clear that this format is
color-renderable, so let's mark it properly as such.

It should also be texture-filterable, because in the version of OpenGL
ES it was written against all texture-formats were filterable to begin
with.

While we're at it, use the non-EXT version of the enum; it's been in the
headers since OpenGL 1.2...

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27521>
2024-02-13 17:08:27 +00:00
Erik Faye-Lund
a7e8dc6835 mesa/main: fix _mesa_base_tex_format for BGRA
This function needs the GLES fix for all APIs now. And it should also
handle the sized internal format.

Fixes: 4de62731f4 ("mesa/main: add support for EXT_texture_storage")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27521>
2024-02-13 17:08:27 +00:00
Mike Blumenkrantz
b7e39657f6 zink: only add arrays to indirect non-tcs variables
these are already sized accurately

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27534>
2024-02-13 16:13:13 +00:00
Mike Blumenkrantz
9e2c7314f2 nir/lower_io: fix handling for compact arrays with indirect derefs
this logic relies on constant indexing for compact arrays, but this is
frequently not the case for compact array builtins (e.g., gl_TessLevelOuter).
the usual strategy of lowering to temps isn't viable in TCS, which means
io lowering has to be able to handle indirect access to these builtins
without crashing

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27534>
2024-02-13 16:13:13 +00:00
Lionel Landwerlin
a512c2a8b5 meson: enforce build of intel-clc with anv/iris
If we do a native build, regardless of the host architecture and we
build Anv or Iris, we need intel-clc. So force building that tool.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10601
Fixes: b52e25d3a8 ("anv: rewrite internal shaders using OpenCL")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27593>
2024-02-13 15:31:10 +00:00
José Roberto de Souza
d0fba810b3 intel: Fix intel_get_mesh_urb_config()
The round up in 'next_address_8kb = DIV_ROUND_UP(push_constant_kb, 8)'
was not decreasing the amount of URB available for Mesh and Task, what
could cause an over allocation of URB.

There was also no minimum entries enforcement for Mesh and Task, what
could cause 0 r.mesh_entries to be set in a case where tue_size_dw is
90% > than mue_size_dw. Same for r.task_entries when Task is enabled.

Also adding a few more asserts to help debug.

This fixes at least dEQP-VK.mesh_shader.ext.properties.mesh_payload_size
in LNL but it has potential to fixes other Mesh tests as well.

Cc: mesa-stable
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27555>
2024-02-13 15:06:32 +00:00
Samuel Pitoiset
32c1e45718 radv: fix emitting VS prologs for merged shaders compiled separately on GFX10+
RSRC1 isn't equal to the VS RSRC1 and both config registers need to
be re-emitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27574>
2024-02-13 14:01:42 +00:00
Samuel Pitoiset
6762307698 radv: cleanup radv_shader_combine_cfg_vs_tcs()
To match radv_shader_combine_cfg_vs_gs().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27574>
2024-02-13 14:01:42 +00:00
Georg Lehmann
6121497228 aco/gfx11+: limit hard clauses to 32 instructions
https://github.com/llvm/llvm-project/pull/81287

Foz-DB Navi31:
Totals from 406 (0.52% of 78112) affected shaders:
Instrs: 585342 -> 585750 (+0.07%)
CodeSize: 3077856 -> 3079456 (+0.05%); split: -0.00%, +0.05%
Latency: 3263165 -> 3263326 (+0.00%); split: -0.00%, +0.01%
InvThroughput: 664092 -> 664114 (+0.00%); split: -0.00%, +0.00%
VClause: 11143 -> 11537 (+3.54%)
SClause: 11878 -> 11884 (+0.05%)
Copies: 39807 -> 39815 (+0.02%)

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27569>
2024-02-13 13:40:52 +00:00
Karol Herbst
3f7b344930 rusticl/mem: support GL_TEXTURE_BUFFER
Fixes: 2645003bdc ("rusticl: Create CL mem objects from GL")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27385>
2024-02-13 10:12:13 +00:00
Karol Herbst
117291332c rusticl/mem: properly handle buffers
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10505
Fixes: 2645003bdc ("rusticl: Create CL mem objects from GL")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27385>
2024-02-13 10:12:13 +00:00
Karol Herbst
727cddd338 nir/lower_cl_images: record image_buffers and msaa_images
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27385>
2024-02-13 10:12:13 +00:00
Tapani Pälli
29a6beb36e anv: revert cache flushing changes for indirect commands
This reverts commit d699600da1.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10600
Signed-off-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/27591>
2024-02-13 09:47:32 +00:00
Samuel Pitoiset
0c05bdf1c1 radv/ci: enable RADV_PERFTEST=shader_object on VEGA10
Renoir currently hangs in Mesa CI. Needs to be investigated.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27433>
2024-02-13 09:14:21 +00:00
Samuel Pitoiset
bead3f2ec3 radv: allow RADV_PERFTEST=shader_object on GFX9/VEGA10
It's passing VKCTS on VEGA10 but for some reasons RENOIR currently
hangs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27433>
2024-02-13 09:14:21 +00:00
Friedrich Vock
afab80bdb6 radv,driconf: Enable active AS leaf workaround for Jedi Survivor
Another game that can't get AS updates right.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27590>
2024-02-13 08:37:20 +00:00
Marek Olšák
14c85196fc mesa: use util_idalloc_alloc_range for _mesa_HashFindFreeKeyBlock
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27588>
2024-02-13 01:51:59 -05:00
Marek Olšák
ec65dfaabd mesa: fix incorrect _mesa_HashInsertLocked parameter in _mesa_EndList
This fixes random behavior when we turn on GL names reuse for display lists.
(ctx->Const.ForceGLNamesReuse)

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27588>
2024-02-13 01:51:59 -05:00
Marek Olšák
72a38b3792 st/mesa: remove !obj checking in _mesa_get_bufferobj_reference when it's useless
There is at least one case in a future commit where the compiler can't do
this automatically.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27587>
2024-02-13 04:39:13 +00:00
Marek Olšák
9747cf2c8f st/mesa: merge 3 unlikely blocks in _mesa_get_bufferobj_reference
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27587>
2024-02-13 04:39:13 +00:00
Marek Olšák
bfe6d389a0 mesa: remove _mesa_HashTable::InDeleteAll
It's not necessary if we don't remove entries from the hash table,
which we don't have to do because we are going to destroy it anyway.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27586>
2024-02-13 03:53:27 +00:00
Marek Olšák
8ca750a8b6 mesa: fold _mesa_HashDeleteAll into _mesa_DeleteHashTable
They are always called back-to-back. This is simpler.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27586>
2024-02-13 03:53:27 +00:00
Marek Olšák
d33bffd708 mesa: re-format main/hash.h, move inlines to the end, some code to main/hash.c
the assertions also didn't do anything

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27586>
2024-02-13 03:53:26 +00:00
Marek Olšák
cf2692fa24 mesa: clean up unnecessary _mesa_HashTable locked/unlocked wrappers
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27586>
2024-02-13 03:53:26 +00:00
Marek Olšák
70b65fe09b mesa: remove unused _mesa_HashTable code
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27586>
2024-02-13 03:53:26 +00:00