`MKVEC.v2i8` only has explicit lane selection for `src0` and `src1`.
`src` is implicitly read as `.b01`, so having a byte swizzle on `src2`
results in an instruction that cannot be encoded.
This fixes a failure in OpenCL-CTS when running `test_relationals
shuffle_copy`:
```
Invalid swizzle:
r0 = MKVEC.v2i8 r0^.b0, r0^.b3, r0^.b0
invalid_instruction: Assertion `!"Invalid instruction"' failed.
```
Fixes: bc7053a ("pan/bi: Add a lowering pass for MKVEC and SWZ")
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41109>
This has already been fixed. We still want to always use new context
with multi instance VCNs to utilize all instances, so the kernel bug
being present or not won't change the decision there.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41796>
OpenCL-CTS `test_basic vload_private` fails with the following
assertion:
```
src/compiler/nir/nir_lower_explicit_io.c:1649: lower_explicit_io_deref:
Assertion `addr->bit_size == deref->def.bit_size' failed.
```
Use `nir_address_format_32bit_offset_as_64bit` when the shader has
64-bit pointers. The scratch offset is still 32-bit, but the NIR address
value now matches the 64-bit derefs being lowered.
Fixes: 01e6a0555c ("pan/compiler: Rework scratch memory strategy")
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41769>
When setting texture state words for load op clears simply inherit
them from the image view for a given attachment. The only piece of
information that needs updating is the offset relative to the view
index, because unknown at image creation time.
Fix dEQP-GLES:
dEQP-GLES3.functional.texture.specification.texsubimage2d*
Fixes: e08916677 ("pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.")
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41797>
OpenCL-CTS `test_relationals relational_any` fails on Panfrost with an
assertion:
```
src/panfrost/compiler/pan_nir_lower_bool_to_bitsize.c:296:
lower_alu_instr: Assertion `alu->def.bit_size > 1' failed.
```
Bool to bitsize pass handles 2, 3 and 4-wide boolean reduction, but does
not handle 8 and 16, which fall-through to the default case, producing
1-bit bools.
Fixes: 5de5987678 ("nir,panfrost: Move lower_bool_to_bitsize to
panfrost")
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41770>
Threaded submit relies on DRM syncobj wait ioctls blocking until the
GPU signals completion. Under drm-shim there is no real GPU, so
SYNCOBJ_WAIT returns immediately, creating a race between the submit
thread and vkQueueWaitIdle that leads to use-after-free crashes.
Detect if we are running under drm-shim by checking the DRM version
description, skip enabling threaded submit in that case.
Assisted-by: Cursor Agent (Opus 4.6)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
So far with drm-shim we were always emulating V3D 4.2.
Now we always emulate V3D 7.1, but we allow selecting 4.2 through an
envvar: `V3D_GPU_ID=(42|71)`
Borrowed from etnaviv.
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
When using drm-shim there is no primary node for the driver. This is
fine, and hence we only mark that we don't have primary device.
This fixes using v3dv with drm-shim.
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
This allows using drm-shim for an emulated driver in AMD GPU host.
Otherwise we need to set MESA_LOADER_DRIVER_OVERRIDE to the emulated
driver in order to make it working.
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
Also, fix texel rate for G1-Pro variant 1.
And mention G1-Ultra, G1-Premium and G1-Pro in the release notes.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41639>
Both RRA and RMV used the PCI bus slot index in the trace device_id
field. On a typical single-GPU system, this resulted in "Device ID =
0000" displayed in RRA and RMV when traces were opened.
Match RGP dump, which reports device ids correctly.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41788>
The game tries to use anisotropic filtering deep in some control flow
while updating a procedural displacement map, our sampling hardware
does not check the channel enable mask before calculating the
derivatives for each subspan, which causes it to get garbage for any
subspans that have partially disabled lanes.
This workaround converts any sample messages in fragment shaders that
have divergent control flow into a sample_d message with the derivatives
zero'd by software if some of the lanes are disabled.
Closes: #12796
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41716>
Using derivatives in control flow that is not uniform across a subspan
will produce "undefined behavior" in GLSL.
On Intel hardware, this means the sampler will just always compute the
derivatives from whatever values are in each lane of a subspan in the
raw payload, regardless if some have been disabled and contain garbage.
Unfortunately, some applications seem to expect the sampler to ignore
disabled lanes in these cases instead of computing their derivatives
anyway from garbage, so for those we need a pass that finds any sample
messages in divergent control flow and converts them to a sample_d with
the derivatives zero'd by software if one or more lanes required to
calculate them have been disabled.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41716>
The previous implementation assumed that VS would have exactly two
executables, the HW variant position shader and the HW variant varying
shader, and that non-VS shaders would only have one executable per
variant. These assumptions are violated by avalon (which only has one
IDVS executable), by SW VS (which is a second VS variant, for three
total variants) and GS rast variants (which execute as a VS on the
hardware and so have two executables pre-avalon).
The new logic allows VS-staged variants to occur as a variant in any API
shader stage, and gives them either one or two executable indices
depending on whether the secondary is used.
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Fixes: ff9907927f (panvk: Add basic infrastructure for shader variants)
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41631>
The source and destination clipping were performed in the wrong order.
We should first clip the source rectangle against the source buffer
bounds, then clip the destination rectangle against the destination
buffer bounds (including scissor).
Fixed the webgl 2.0.0 test case:
conformance2/rendering/blitframebuffer-filter-outofbounds.html
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41718>
v2: - remove a few useless helpers
- rename some variables
- use some more nir with immediate codes (Emma)
v3: - use 64 bit integer ops
- optimize generated code
v4: - fix typo (Emma)
- Use boolean for available (Emma)
- simplify some calculations (Emma)
- replace "if" in timestamp code and bool conversion
with "bcsel" (Emma)
- clean up some variable names
v5: - remove iadd3 (Konstantin)
Assisted-by: Copilot (Auto mode)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
We don't actually need to copy the vertex attributes because if no
TCS shader was given by the user TES simply is pointed to the VS
output in LDS that has the same layout the TCS shader would provide.
v2: with the lowering of the relevant intrinsics in place
use nir_create_passthrough_tcs_impl to create the passthrough
shader (like suggested by Mareco and Emma)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
With memcpy lowering and fix for infinite optimize loop on 4x16 packs,
passes `dEQP-VK.spirv_assembly.instruction.compute.untyped_pointers.*`.
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41695>
Zink implementation splits `maxPerStageDescriptorStorageBuffers` between
atomic buffers and `MaxShaderStorageBlocks` causing CTS tests to fail
because there is not enough SSBO blocks.
Also updated 'maxPerStageResources' for the current limits.
Fixes the following tests:
* KHR-GLES31.core.program_interface_query.ssb-types
* KHR-GLES31.core.compute_shader.pipeline-compute-chain
* KHR-GLES31.core.shader_storage_buffer_object.advanced-indirectAddressing-case1-cs
* KHR-GLES31.core.shader_storage_buffer_object.advanced-usage-sync-cs
* KHR-GLES31.core.shader_storage_buffer_object.advanced-indirectAddressing-case2-cs
Signed-off-by: Arjob Mukherjee <arjob.mukherjee@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41708>
Changes are the result of two issues:
- In library form, workgroup size is not lowered. Only once the
pre-compiles are distinct variants with entry-points can we
lower uses of the workgroup size input.
- Some unimplemented instructions like `ufind_msb` would make their
way through to the final shader, if they are generated by other
algebraic optimizations. `nir_opt_algebraic` needs to be run in a
loop to ensure they are eliminated.
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41568>
Defines a more general purpose version of `poly_unroll_restart`
named `poly_unroll_geometry`, which allows unrolling without an
input index buffer by separating the input and output index sizes.
This allows it to be used for additional use cases, such as
unrolling triangle fans or changing index types, where the draw
may not necessarily be indexed or the input and output index types
are not the same.
`poly_unroll_restart` remains as an alias with the same declaration
as before.
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41568>
Until now the BLT engine only handled same-format blits. Teach it to
convert between the UNORM formats it can represent, so format-converting
blits no longer fall back to the 3D blitter.
The supported formats are A8R8G8B8, X8R8G8B8, A4R4G4B4, A1R5G5B5,
R5G6B5, R8G8, R8 and A2R10G10B10.
The BLT format names are BGRA-based, matching the PE-internal byte order,
so an identity swizzle is correct for all of these except A2R10G10B10.
That one the PE keeps in RGBA order, so pipe R lands in the BLT B position
and vice versa. blt_conversion_needs_channel_swap() captures this and
find_blt_conversion() derives the per-image swizzle.
SRGB variants share the BLT format of their UNORM sibling. For example
R8G8B8A8_UNORM and R8G8B8A8_SRGB both map to BLT_FORMAT_A8R8G8B8, and
the sRGB handling is carried separately via img->srgb.
No regressions in dEQP-GLES3.functional.fbo.blit.conversion.*.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39879>
Add sRGB field to blt_imginfo and use it to conditionally set the
BLT_SRC_IMAGE_CONFIG_SRGB and BLT_DEST_IMAGE_CONFIG_SRGB bits in
the BLT config register setup.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39879>