Commit Graph

161636 Commits

Author SHA1 Message Date
Yonggang Luo 574b4c547f meson: add dep_valgrind dependency for 'dxil_compiler'
The error when include simple_mtx.h in glsl_types.h:
../src/microsoft/compiler/dxil_function.c
In file included from ../src/compiler/glsl_types.h:37,
                 from ../src/compiler/nir_types.h:36,
                 from ../src/compiler/nir/nir.h:44,
                 from ../src/microsoft/compiler/dxil_signature.h:28,
                 from ../src/microsoft/compiler/dxil_module.h:37,
                 from ../src/microsoft/compiler/dxil_function.h:48,
                 from ../src/microsoft/compiler/dxil_function.c:24:
../src/util/simple_mtx.h:37:12: fatal error: valgrind.h: No such file or directory
   37 | #  include <valgrind.h>

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19154>
2022-10-20 01:32:47 +00:00
Jesse Natalie 0fad769c13 d3d12: Release sharing contract in flush_frontbuffer
Just a leak I happened to notice.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Jesse Natalie 035db6f011 d3d12: Use ID3D12DeviceConfiguration for root signature serialization
If we were able to create a device factory from a DLL-local D3D12Core,
we want to use that one to do root signature serialization, instead of
going to the globally-configured D3D12Core.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Jesse Natalie 6a1268cc4f d3d12: Attempt to use the Agility SDK
The ideal would be to use a D3D12Core.dll next to the GL DLL, via
ID3D12SDKConfiguration1, but this requires a new D3D12.dll to be
present on the machine, which only very new OSes will currently have.
For older OSes, we can at least try to use ID3D12SDKConfiguration to
set a global Agility SDK override, but that only works in developer
mode and requires the DLL to be at a relative path from the app EXE,
so only try that if we have environment variables telling us to do so.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Jesse Natalie d21f0cb5b9 d3d12: Support device factories in addition to global device creation
As explained in a comment, a device factory allows modification of state
like debug layer enablement without touching global state / triggering
device removal on a singleton device, and can even create devices that are
not singletons if the driver supports that.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Jesse Natalie cb9a58c103 d3d12: Store the d3d12 module reference on the screen
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Jesse Natalie ff102db76c d3d12: Move some things from screen late-init to early-init
The GLSL singleton ref was too late, and we could end up with an un-paired
dec-ref if screen init failed. Also the transfer slab init was in the wrong
init function, so we'd re-init that struct if the screen was re-initialized.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Jesse Natalie 1868391732 deps: Update DirectX-Headers req to 1.606.4
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18305>
2022-10-20 00:30:21 +00:00
Iván Briano 91085bf337 anv: enable rayTraversalPrimitiveCulling feature
It is mandatory if VK_KHR_ray_query is supported.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19152>
2022-10-20 00:03:55 +00:00
Iván Briano d9747169b6 anv: support VK_PIPELINE_CREATE_RAY_TRACING_SKIP_*
VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR and
VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR, when specified,
make TraceRay behave as if the corresponding shader flags were set, but
without affecting the value of IncomingRayFlags in shaders.

v2 (Lionel): Improve comments

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19152>
2022-10-20 00:03:55 +00:00
Samuel Pitoiset 3aa41349a7 ac/llvm: add missing nir_intrinsic_bindless_image_atomic_{fmin,fmax}
Fix various atomic operations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19134>
2022-10-19 23:42:26 +00:00
LingMan ada1076f98 rusticl/api: Interpret `lengths` as a slice of Option<NonZeroUsize>
So far `lengths` as been interpreted as a slice of usize. However, 0 is specified as a sentinel
value signalling that the corresponding string is nul terminated. Since checking for sentinel
values is frequently forgotten, Option types should be preferred if possible.

Option<NonZeroUsize> is layout compatible with usize. The None variant is then represented as 0,
which is exaclty what we need here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
LingMan 5c16065169 rusticl/api: Don't check the program source for nul bytes needlessly
At this point we already know that the Vec we've constructed cannot contain a nul byte. Avoid the
needless scan.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
LingMan 0d31bc5ac3 rusticl/api: Shrink unsafe block
There's only two unsafe operations left here, so shrink the unsafe block to make them obvious.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
LingMan 677c871a0a rusticl/api: Factor pushing to the Vec out of the if
Both branches do the same here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
LingMan d64b9ea483 rusticl/api: Fix creating a program if a nul byte is within the specified string length
The code assumed that if the length of a string was specified and greater than zero, the string
would not contain a nul byte.
Legal or not, there are apparently applications which violate that assumption. Since the spec
doesn't say anything about this case, take the likely most compatible route and treat a nul byte as
terminating the string early.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7408
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
LingMan 9de42613bf rusticl/api: Drop UTF-8 conversion of input source
The spec doesn't define any charset for the source code. While the vast majority of inputs are
likely to be ASCII (which a subset of UTF-8), it is better not to make assumptions.
As a nice side effect this should be a minor speedup.

`CString`s can't currently be pushed to, so use a `Vec` as intermediate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
LingMan 4de48a5dd5 rusticl/api: Use iterators in create_program_with_source
This replaces several instances of unsafe pointer arithmetic and dereferencing with a single unsafe
creation of a slice, which we then use normal iterators on.
The spec mandates that a null pointer is to be interpreted as if a slice filled with zeros had been
given. That case is represented by an infinite iterator returning only zero.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
2022-10-19 23:32:50 +00:00
Pavel Ondračka 1e9e561811 r300: fix generation of invalid swizzles in regalloc
rc_adjust_channels is inteded for moving the swizzles to a new channels
when rewriting the writemask of an instruction. However for readers one
needs to keep the swizzles in the old channels but rather convert to the
new values, so use the proper helper rc_rewrite_swizzle.

With the new swizzle fixed, we should properly detect that it would be
invalid and thus we can select the proper register class to prevent the
writemask rewrite in the regalloc.

Documentation was added to rc_adjust_channels to make it more clear what
it actually does.

Fixes a bunch of dEQP tests.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7521
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19158>
2022-10-19 22:49:23 +00:00
Pedro J. Estébanez 842a0c6ef1 nir2dxil: Use native helper lane intrinsic on SM >= 6.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19170>
2022-10-19 22:25:51 +00:00
Bas Nieuwenhuizen 1252d63cc2 aco: Pre-split result of bvh64_intersect_ray_amd.
Avoids  later moves with extractions from the vector.

Reduces VALU operation in the raytrace loop by ~6%, increasing
the RT performance in Q2RTX on a 6800 XT by about ~1.3%.

Suggested by Georg.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19148>
2022-10-19 21:44:48 +00:00
Dylan Baker c6aca79f63 util/indicies: convert u_unfilled_gen.py to write a file
Which avoids meson needing to wrap the generator to capture the output,
and makes it faster

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19058>
2022-10-19 20:21:08 +00:00
Dylan Baker 090e71e0bf util/indicies: use itertools.product in u_unfilled_gen.py
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19058>
2022-10-19 20:21:08 +00:00
Dylan Baker a72d8425ea util/indicies: simplify some of u_indicies_gen.py
v2:
  - Give variable more descriptive name to avoid shadowing

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>

and avoid shadowing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19058>
2022-10-19 20:21:08 +00:00
Dylan Baker 1e523f2339 util/indicies: write a file with u_indicies_gen.py
This avoids meson creating a wrapper to redirect stdout, and makes the
generator faster

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19058>
2022-10-19 20:21:08 +00:00
Dylan Baker addd4d71fa util/indicies: use itertools.product instead of deeply nested loops
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19058>
2022-10-19 20:21:08 +00:00
Dylan Baker 55042a1fb9 util/indicies: move common static functions to private header
less duplication is good

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19058>
2022-10-19 20:21:08 +00:00
Dylan Baker 5819d259cf docs: Extend calendar entries for 22.2 by 2 releases.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19172>
2022-10-19 20:16:00 +00:00
Dylan Baker 51236cb178 docs: update calendar and link releases notes for 22.2.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19172>
2022-10-19 20:16:00 +00:00
Dylan Baker 7887f76997 docs: Add sha256 sum for 22.2.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19172>
2022-10-19 20:16:00 +00:00
Dylan Baker 4ad1a81cd8 docs: add release notes for 22.2.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19172>
2022-10-19 20:16:00 +00:00
Ruijing Dong f939b31157 frontends/va: fixed an av1 decoding image corruption issue.
problem:
When playing back some clips with loop restoration parameters
enabled, the display image could be corrupted.

solution:
correct loop restoration unit size logic in vaapi interface.

CC: 22.2 <mesa-stable>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19146>
2022-10-19 20:03:23 +00:00
Mike Blumenkrantz 5b49f8b025 zink: add ci flake
fixes #7442

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19160>
2022-10-19 19:43:04 +00:00
Mark Collins 029d4cbf42 tu: Clean up variable usage in `tu6_draw_common`
Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19107>
2022-10-19 19:00:42 +00:00
Mark Collins 9248ce2978 tu: Only write `A6XX_PC_PRIMITIVE_CNTL_0` if changed
Increases the score in the `draw` test in `vkoverhead` to 71809
from 67170 on a HDK 888.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19107>
2022-10-19 19:00:42 +00:00
Alyssa Rosenzweig 3de9c42908 gallium: Default to PIPE_CAP_MIXED_COLORBUFFER_FORMATS
There are three tiers of drivers:

* Drivers that support MRT and support mixed colorbuffer formats. All modern
  hardware fits this as it becomes a spec requirement.
* Drivers that do not support MRT. Then this CAP is a no-op, so we might as well
  set it by default even here (this commit trivially enables the CAP for lima,
  vc4, etanviv).
* Drivers that support MRT but do not support mixed colorbuffer formats! Very
  little hardware fits this category as it doesn't suffice for MRT in most APIs.
  Unfortunately we have a few drivers that are in this category, preventing us
  from bulldozing the CAP altogether.

Given that the CAP only exists for a few legacy drivers, default it to being
enabled to avoid new drivers falling into the trap of forgetting to enable it.
Failing to set this CAP causes failures in
dEQP-GLES3.functional.fbo.completeness.*

Drivers which still do not set this CAP: nv30, r300 (older than r500), virgl in
some cases. r300/r400 is due to a hardware requirement as Emma points out.

v2: Advertise the cap on lima like the commit message claims (delete the special
case).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19079>
2022-10-19 18:06:51 +00:00
Vinson Lee 8939d477ac zink: Remove duplicate variable zm.
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In
zm = zm = create_shader_module_for_stage_optimal(ctx, screen, prog->shaders[i], prog, i, state),
zm is written twice with the same value.

Fixes: 325c703624 ("zink: add 'optimal_keys' handling for shader keys")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19086>
2022-10-19 17:44:09 +00:00
Karmjit Mahil 3873ef47f7 pvr: Remove outdated comments.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19110>
2022-10-19 16:07:26 +00:00
Karmjit Mahil 849c2e14ab pvr: Handle pipeline barrier vk_sync.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19110>
2022-10-19 16:07:26 +00:00
Karmjit Mahil d19835e43c pvr: Fix overflow before widen warning for rgn headers size calculation.
This fixes CID 1515968.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19136>
2022-10-19 15:24:53 +00:00
Karmjit Mahil 6a35563de0 pvr: Fix possible seg fault on csb copy.
When copying the secondary command buffer's deferred control stream
to the main stream we have to first allocate space in the main
stream. In case the allocation failed we were attempting to
memcpy() to a NULL destination causing a NULL dereference.

This fixes CID 1515977.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19136>
2022-10-19 15:24:53 +00:00
Rob Clark f9eb0c13a0 freedreno/a6xx: Drop max_scissor tracking
We don't actually really use this on a6xx, since SQE can early-exit IB2
when there are no more remaining primitives in the bin.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark 2ad637f52a freedreno/a6xx: Update caps
We should be doing all the 64b lowering.. I think that should be enough
to get us at least glsl400.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark dc70a940d4 freedreno/a6xx: Fix primitives-generated query
RBBM_PRIMCTR_7 is pre-clipped, whereas RBBM_PRIMCTR_8 is after clipping.
I believe we want pre-clipping, and this is what tu does.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark f26631c6de freedreno/a6xx: Fix MAX_GEOMETRY_OUTPUT_VERTICES cap
Limited by the size of PC_PRIMITIVE_CNTL_5.GS_VERTICES_OUT

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark b96e8050d6 freedreno/ir3: Lower all the 64b
Just need to enable some existing lowering.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark 1b38d233fc freedreno/ir3: Fix clipvertex with GS+tess
If we have both GS and tess, GS is the stage we should run lower_clip_vs
on.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark 0f6f671824 freedreno/a6xx: Remove unused param
Minor cleanup, make it more clear that we aren't actually emitting in
IB2.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19100>
2022-10-19 12:23:40 +00:00
Rob Clark 533b87dff0 mesa/st: ARB_vertex_attrib_64bit depend on glsl>=410
It is possible to expose ARB_gpu_shader_fp64 without supporting
ARB_vertex_attrib_64bit.  The supported GLSL version should tell
us if 64b vertex attribs are also supported or not.

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/19100>
2022-10-19 12:23:40 +00:00
Rob Clark 1aeca308a2 docs: Update freedreno features
Another manual re-sync with reality.

There are a few extension, notably GL_ARB_texture_compression_bptc,
which are exposed but mesamatrix doesn't show as supported.  I can't
really figure out why.

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/19100>
2022-10-19 12:23:40 +00:00