Commit Graph

159406 Commits

Author SHA1 Message Date
Erik Faye-Lund 9909eff0c8 zink: expose demote when supported
This enables GL_EXT_demote_to_helper_invocation on Zink.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
2022-09-05 22:48:54 +00:00
Mike Blumenkrantz 1a271948fc zink: hook up demote extension
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
2022-09-05 22:48:54 +00:00
Erik Faye-Lund e2d7fa943d zink: add ntv support for is_helper_invocation
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
2022-09-05 22:48:54 +00:00
Erik Faye-Lund 7a48657a06 zink: add spirv_builder support for is_helper_invocation
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
2022-09-05 22:48:54 +00:00
Erik Faye-Lund 332ff54425 zink: add ntv support for demote
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
2022-09-05 22:48:54 +00:00
Mike Blumenkrantz 1bff203533 zink: add spirv builder function for demote
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
2022-09-05 22:48:54 +00:00
Alejandro Piñeiro 944b08e597 v3dv/bo: reduce DEFAULT_MAX_BO_CACHE_SIZE to 64
The best way to tune this value is to test Vulkan
applications. Current somewhat big value (512), was obtained by
testing only vkQuake2. Additionally at that time the bo cache was the
first performance oriented improvement we implemented.

After more improvements were included, and retested with more
applications, the conclusion is that we can reduce the value. More
info on the issue that closes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7090

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18398>
2022-09-05 22:25:09 +00:00
Alessandro Astone a68e2b810c Android.mk: Provide a custom entry name to ensure meson checks succeed
When meson tests for the compability of some linker flags, not having
the default entry symbol "_start" defined makes the check fail for
a warning unrelated to the linker flag meson is testing.

Since these tests normally just try to compile a C program with a main,
use "main" as the ficticious entry point.

Specifically, this makes "-Wl,--build-id=sha1" recognised as valid
and allows its use for drivers that rely on it.

This is a temporary workaround that is required until Android.mk is
changed to support both shared libraries and executables.

Cc: "22.0" "22.1" "22.2" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17715>
2022-09-05 22:10:07 +00:00
Alessandro Astone 554b19b616 Android.mk: Filter out --build-id=md5 linker flag
To avoid conflicts with meson-generated --build-id linker option

Cc: "22.0" "22.1" "22.2" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17715>
2022-09-05 22:10:07 +00:00
Yonggang Luo 5017e805bb util: Fixes comment about debug_get_option
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18242>
2022-09-05 13:34:17 +00:00
Timur Kristóf 4f11fba0c1 radv: Enable EXT_mesh_shader on RDNA2 with RADV_PERFTEST=ext_ms
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>
2022-09-05 13:09:29 +00:00
Timur Kristóf be56649fc6 radv: Implement EXT_mesh_shader draw calls.
There is a new packet DISPATCH_MESH_INDIRECT_MULTI which we use
for indirect mesh shader only draws. This packet allows using
a 3D dispatch (however firstTask doesn't work with this packet).

Otherwise everything else works the same way as
the NV_mesh_shader draw calls.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>
2022-09-05 13:09:29 +00:00
Timur Kristóf c7ff93a766 ac/nir/ngg: Add EXT_mesh_shader vertex/primitive count.
In EXT_mesh_shader the vertex and primitive counts are set using a
built-in SetMeshOutputsEXT function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>
2022-09-05 13:09:29 +00:00
Timur Kristóf 448d09d44a ac/nir/ngg: Add EXT_mesh_shader CullPrimitiveEXT output.
This is a per-primitive boolean output.
When set to 1, the primitive should be culled.

Implement this by using this boolean as the null primitive
flag for primitive exports.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>
2022-09-05 13:09:29 +00:00
Timur Kristóf 1f8f4570f0 ac/nir/ngg: Add EXT_mesh_shader primitive indices.
In EXT_mesh_shader the indices output is an array of vectors
which is indexed by the primitive index.

(They practically behave like a per-primitive output, although
technically the spec does not treat them as per-primitive.)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>
2022-09-05 13:09:29 +00:00
SoroushIMG 359713d174 zink: track min_samples state for per sample shading
Vulkan pipeline state sampleShadingEnable and minSampleShading are directly related to GL_SAMPLE_SHADING_ARB.
Track min_samples provided by st and include it in pipeline state.
This was seen as failures in cts cases where per sample shading along with sample interpolation qualifiers are tested:
dEQP-GL45-ES31.functional.shaders.multisample_interpolation.sample_qualifier.*

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18314>
2022-09-05 12:45:04 +00:00
Tomeu Vizoso 55e99a22f3 Revert "ci: set venus on lavapipe to manual due to flakes"
Issue should be fixed now.

This reverts commit a03ce740bb.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18414>
2022-09-05 14:13:03 +02:00
Tomeu Vizoso 0a2723e35d ci: Make sure that the Crosvm control socket has been removed
To avoid Crosvm bailing out at startup like this:

ERROR - dEQP error: [ERROR:src/main.rs:2826] invalid value "crosvm-14.sock": this socket path already exists

Closes: #7093

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18414>
2022-09-05 14:12:58 +02:00
Marek Olšák a6050a43ca ac/surface: disallow 256KB swizzle modes on gfx11 APUs
It doesn't work.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18340>
2022-09-05 08:59:59 +00:00
Marek Olšák aef7ea868f ac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock
and update amdgpu_drm.h

Fixes: 50238f4958 - amd/common: Remove redundant code for determining memory ops per clock
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7163

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18340>
2022-09-05 08:59:59 +00:00
Erik Faye-Lund c551bb32d1 zink: clamp miplodbias when creating sampler
The Vulkan spec states that it's illegal to pass a mipLodBias larger
than maxSamplerLodBias, but the gallium value here hasn't been clamped.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7140
Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18295>
2022-09-05 07:39:32 +00:00
Lionel Landwerlin 9194952e70 hasvk: expose VK_EXT_depth_clamp_zero_one
Simple enough to expose on hasvk.

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/18372>
2022-09-05 06:19:47 +00:00
Lionel Landwerlin a6de9dabf6 anv: enable EXT_depth_clamp_zero_one
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/18372>
2022-09-05 06:19:47 +00:00
Iago Toral Quiroga 70ea65490c v3dv: switch to common code for command buffer lifecycles
This gives us the capacity to recycle command buffers in the pool.
Based on a similar change done by Jason to Anvil.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18388>
2022-09-05 07:52:46 +02:00
Max Kellermann b830091cb6 gallium/u_threaded: fix offset calculation for draw_multi slots
This fixes a buffer corruption bug with glMultiDrawElementsEXT(): the
offset for the source index buffer is reset for each draw_multi slot,
copying only the first `dr` values to each slot's index buffer.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18189>
2022-09-04 21:16:12 -04:00
Max Kellermann 0a0fb7cbc6 gallium/u_threaded: add missing reference counts for draw_multi slots
If a glMultiDrawElementsEXT() call doesn't fit into a single slot, the
same pipe_resource pointer is copied into all following slots, the
completion of each will decrement the reference counter; however, it
was never incremented for all but the first slot.

This fixes a use-after-free bug with glMultiDrawElementsEXT().

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18189>
2022-09-04 21:15:57 -04:00
M Henning f90f04d501 nv/nir: Set ssbo CacheMode from intrinsic access
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18354>
2022-09-04 20:32:30 +00:00
Alyssa Rosenzweig 02babc834a asahi: Identify stencil test enable
There are a pair of flags controlling the stencil test. One enables
stencil testing in general, the other enables two-sided stencil. Compare
the identical "twosided" flag in src/imagination/csbgen/rogue_ppp.xml's
STATE_ISPCTL structure, at the samebit offset even. Evidently this word of
the "Rasterizer" is, in fact, a derivative of STATE_ISPCTL.

Fixes

   dEQP-GLES2.functional.fragment_ops.depth_stencil.*
   dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.*
   dEQP-GLES2.functional.fragment_ops.random.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig b891d60efa asahi: Fix depth/stencil buffers
There are a bunch of bits we need to set right to get depth/stencil
loads/stores working, including with independent settings for each. The
kernel "helps" us here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 7cb21eb595 asahi: Handle out-of-bounds clear_stencil
Just use the bottom 8-bits (we have only 8-bit stencil formats),
otherwise we fail an assertion in GenXML. In this case the wrapping
behaviour is ok.

Fixes:

   dEQP-GLES2.functional.depth_stencil_clear.depth_stencil
   dEQP-GLES2.functional.depth_stencil_clear.stencil

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 66f1164976 asahi: Add 1D and 1D Array enums
To finish out the enum.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 2bdb8ba3ce asahi: Correct SET_SHADER_EXTENDED disambig bit
This is still a guess, but a considerably firmer one as it now corrects
handles the clear pipelines emitted by Metal as well as the regular
vertex/fragment shader, and gets rid of the preshader special cases
seen there. Fixes decode of clear pipeline's preshaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 210f4aff1e asahi: Identify and use first level field of texture
As we recently discovered, the layout of level L of a mipmapped 2D image
of size WxH is /not/ the same as the layout of a non-mipmapped 2D image
of size minify(W, L) x minify(H, L). The difference occurs due to
subtleties of the "power of two" miptrees which can force a level to use
a larger tile size than it would have required at root level. To handle
this quirk correctly, the driver must not implement texture views with
address arithmetic -- it must supply instead the base width/height of a
texture and use first/last level fields on the texture descriptor to map
it. Similar issues occur when writing a particular level of a mipmapped
texture, which was handled correctly in the colour case but not the Z/S
case.

Fixes

   dEQP-GLES2.functional.texture.mipmap.cube.generate.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 1d72d3feb6 asahi: Fix "stride" for tiled textures
It doesn't exist, but there's a count of mip levels for writeable image
descs. Setting that appropriately matters at high mip levels.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 4442be1155 asahi: Fix nonmipmapped array textures
pot_level can be greater than the number of levels actually included --
don't overallocate. Fix the issue and add a representative unit test.
Fixes:

   dEQP-GLES2.functional.texture.size.cube.512x512_rgb888

Fixes: 6ff75da8aa ("ail: Introduce image layout module")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig a41d732784 asahi: Fix depth for cube maps
For cube maps, depth=1 in the hardware (but 6 in Gallium). Likewise for
cube map arrays, depth=n in the hardware (but 6n in Gallium). We need to
divide to compensate. This will be relevant for cube map arrays in the
future -- add the dimension XML for cube map arrays too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 99a5b11af5 asahi: Label batch flush reasons
This was helpful in identifying the bottleneck in Inochi2D (the clears).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig e66a901bc8 asahi: Relax assert in decoder
Seen == 0x8 with >4 render targets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 9542f95864 asahi: Trim garbage at end of set shader
Unfortunately the actual size of this data structure is unclear.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 279eaec278 asahi: Use util_blitter_clear
To avoid flush, use util_blitter_clear to clear with rectangles when
there is already content in the scene. This ~doubles the performance of
Inochi2D, which does frequent stencil clears in the middle of the screen
to implement masking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig fb7860ed24 asahi: Handle empty fragment shaders
When an empty fragment shader is used with Metal, the stop command is
still included but this special bit is set, suppressing tilebuffer
access. Failing to do so but using empty shaders for u_blitter depth
clears causes Glitch Lina:

   https://twitter.com/LinaAsahi/status/1537869064793575424

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig f8799c97b2 asahi: Export agx_blitter_save
So we can use it for clears.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 6b329b16f8 asahi: Make ctx->zs a pointer
When we save ZSA state with u_blitter, u_blitter just records the
pointer for the state. It doesn't copy it. That requires an extra
indirection on the context (as other drivers do) to fix restores of ZSA
state with u_blitter.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 968bbca578 asahi: Note some more unknowns in the XML
Lot of r/e waiting here...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 47831969c8 asahi: Split up unk 2b
Seems to be flags.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 5f57fe0bc9 asahi: Fix Indexed Draw command
Add the missing stub in the decoder for it, so we can decode indexed
draws instead of reading back garbage, and fill in some known unknowns
in the structure.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 10c9aceadf agx: Plumb through nir_op_txf
nir_op_txf maps to AGX's texture_load, which is encoded like
texture_sample. The one outstanding question with this commit is the
rules for the sample required ... in NIR and APIs (including Metal), txf
is samplerless, but the AGX instruction consumes a sampler. Hopefully
any sampler will do, though?

Passes dEQP-GLES3.functional.shaders.texture_functions.texelfetch.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 44d79d39b6 agx: Defeature indirect vbufs
vb_mask can include garbage vbufs, we can't rely on it. This will
prevent a regression when switching to u_blitter based clears. This is
also simpler and shrinks the VS shader key so all in all a good thing.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 0fccd564b6 agx: Don't hardcode uniform enums
Let the compiler number them for us, the numbers are meaningless.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00
Alyssa Rosenzweig 18bb64fd3a agx: Add more unit tests for float copyprop
Would have caught the bug fixed by the previous commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
2022-09-04 18:05:31 +00:00