Commit Graph

147040 Commits

Author SHA1 Message Date
Alejandro Piñeiro 3f3820a3a5 v3d: remove static v3d_start_binning
v3dx(start_binning) is just a call to that method, so let's just use
it directly.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13754>
2021-11-11 14:04:22 +01:00
Alejandro Piñeiro 2a65db2458 v3d: remove unused include
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13754>
2021-11-11 14:04:16 +01:00
Andreas Baierl ee41e1bbd2 lima: Fix drawing wide lines
GLES2.0 spec allows parts of wide lines and points to be drawn even if
their center is outside the viewport.
Therefore 0x2000 in PLBU_CMD_PRIMITIVE_SETUP has to be set for points.
This is already our default setting as it seems to have no negative
effect when this bit is always set. Points work as expected but lines
don't. It's hard to RE it, because the affected deqp tests also fail
with the blob.

To respect this behaviour for lines and solve another 2 tests, we need
to do a workaround and temporarily extend the viewport by half of the
line width. The scissor rectangle is still equal with the initial
viewport.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12971>
2021-11-11 11:25:58 +00:00
Samuel Pitoiset 3e7bac80ce ac/rgp: add support for dumping SPM data
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13704>
2021-11-11 10:05:49 +00:00
Samuel Pitoiset e928f475cc ac: add initial SPM support
SPM is hardware feature that allows us to dump performance counters
at a sampling interval to a buffer. It is used by RGP to report cache
counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13704>
2021-11-11 10:05:49 +00:00
Neil Roberts bdaf185889 v3d: Update prim_counts when prims generated query in flight without TF
In order to implement GL_PRIMITIVES_GENERATED, v3d allocates a small
resource and adds a command to the job to store the prim counts to it.
However it was only doing this when TF was enabled which meant that if
the query was used with a geometry shader but no TF then the query would
always be zero. This patch makes the driver keep track of how many
PRIMITIVES_GENERATED queries are in flight and then enable writing the
prim count if its more than zero.

Fix dEQP-GLES31.functional.geometry_shading.query.primitives_generated_*

v2: Update CI expectations and references to fixed tests in commit log.
v3: - Add comment that GL_PRIMITIVES_GENERATED query is included because
      OES_geometry_shader, but it is not part of OpenGL ES 3.1. (Iago)
    - Update Fixes to commit introducing geometry shaders. (Iago)

Fixes: a1b7c084 ("v3d: fix primitive queries for geometry shaders")
Signed-off-by: Neil Roberts <nroberts@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13712>
2021-11-11 08:02:04 +00:00
Vinson Lee 4a38ed822a virgl: Allocate qdws after virgl_init_context to avoid leak.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable qdws going out of scope leaks the storage it
points to.

Fixes: 9a7d6a110e ("virgl/drm: explicit context initialization")
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13609>
2021-11-11 01:51:35 +00:00
Vinson Lee 1ca90f8752 microsoft/spirv_to_dxil: Fix non-Windows build.
../src/microsoft/spirv_to_dxil/dxil_validation.cpp: In function ‘bool validate_dxil(dxil_spirv_object*)’:
../src/microsoft/spirv_to_dxil/dxil_validation.cpp:129:12: error: ‘stderr’ was not declared in this scope
  129 |    fprintf(stderr, "DXIL validation only available in Windows.\n");
      |            ^~~~~~

Fixes: 37c366e283 ("microsoft/spirv_to_dxil: Add DXIL validation to spirv2dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13736>
2021-11-11 01:37:16 +00:00
Emma Anholt 07aaef5721 freedreno/a6xx: Inline remaining fd6_tex_const_0() call.
Less indirection and fixups for figuring out what's going on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 7230058e8a freedreno/a6xx: Drop an unused tile_mode arg.
I added this in ebaeddcbb3 ("freedreno/a6xx: Rewrite the format table
format/swap helpers.")  but it had already become unused through some
bugfixing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt a9057d45a4 freedreno/a6xx: Clean up sysmem fb read patching using fd6_view.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt c90220e449 freedreno/a6xx: Use fd6_view for non-buffer image descriptors, too.
This deletes a whole lot of code, but there's a modest drawoverhead perf
loss:

drawoverhead 1-image change -6.48856% +/- 4.28269% (n=50)
drawoverhead 8-image change -5.29195% +/- 2.62549% (n=90)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 533e486923 freedreno/a6xx: Switch to relying on fd6_view for our texture descriptors.
Having checked the deltas between fdl6_view and what we did before, switch
over to fdl6_view now.

No statistically significant difference on no-hw drawoverhead 8-texture
change (n=50) with the texture cache disabled from this and the previous
commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 84377785a4 freedreno/a6xx: Create a fd6_view at sampler view update time.
The goal is to share the same code as turnip for descriptor setup. This
just calls it and cross-checks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 5b3a6ff9f7 freedreno: Set layer_first on (2D) resource imports.
Prevents getting a weird layer stride if you ask for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 94e4cd4d83 freedreno/fdl6: Skip redundant setting of TILE_ALL for NV12.
We already respect the tile_all flag above, and it should be set in tu.
Fixes a mismatch between fdl6_view_init() and gallium.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 2e6810a06a util/format: Add G8_B8R8_420_UNORM to match Vulkan.
turnip was playing fast and loose with the name, using the R8_G8B8 format
name but actually setting the descriptors up to read G8_B8R8 like Vulkan
(sensibly) wants.  This caused trouble when trying to make freedreno and
turnip share code.  By having both orderings as format names, we can share
the descriptor code and also confuse readers less.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 271b6cb981 util: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.
The only user, turnip, was actually treating it as this layout, matching
vulkan's specification of how the planes map to RGB values.  (Y=G means
that Cb=B and Cr=R).

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Caio Oliveira 6eb86efe91 util/ra: Fix deserialization of register sets
Set ra_class::regset and ra_class::index  when deserializing.

Fixes: 95d41a3525 ("ra: Use struct ra_class in the public API.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>
2021-11-10 22:57:57 +00:00
Caio Oliveira ac416ce07b util/ra: Add simple test for register set serialization
Marked as DISABLED since it currently fails.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>
2021-11-10 22:57:57 +00:00
Eric Engestrom 37b51d5140 docs: update calendar for 21.3.0-rc5
Add another release candidate as we're not ready for 21.3.0 final just yet.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13744>
2021-11-10 22:13:56 +00:00
Emma Anholt 8f5a0bd9b4 ci/bare-metal: Close serial and join serial threads before exit.
This should fix the intermittent (~1/week) cheza failure where python
complains that a thread tried to do stdio while the main thread has
exited.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13462>
2021-11-10 20:36:57 +00:00
Emma Anholt 4cdbe3f2b9 ci/etnaviv: Add more texturing flakes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13462>
2021-11-10 20:36:57 +00:00
Emma Anholt 13e23b54ba ci/etnaviv: Mark the rest of uniform_api.random as flaky.
Another 3 new flakes happened on my last run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13462>
2021-11-10 20:36:57 +00:00
Jesse Natalie 5451bb03c7 mesa/main: Fix use of alloca() without #include "c99_alloca.h"
Fixes: c216f193 ("mesa: use alloca in search_resource_hash")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13735>
2021-11-10 19:07:38 +00:00
Emma Anholt 549924d53e freedreno: Fix constant-index assumptions in IBO loads.
The encoder already sets up our IBO accesses as potentially nonuniform, so
we just need to be careful to not try to force the IBO index into an
immediate.

Fixes assertion failures in piglit arb_shader_image_load_store-invalid
(intermittent due to
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/597), which
had some interesting actual failures hidden behind it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>
2021-11-10 17:48:59 +00:00
Emma Anholt 9e04f97d8e freedreno: Fix the uniform/nonuniform handling for cat5 bindful modes.
We can see from the dynamically_uniform (compiler doesn't know if you're
uniform or not) vs uniform (compiler can see it's uniform) case in the
blob which is which.  Now that we have the right names, also use the
nonunif flag for encoding the actual non-uniform mode (previously, we were
always setting it always in a way that meant uniform).

I verified this behavior back to a418 with samplers.  The a3xx blob I have
only does GLES3, so we don't have the opaque_type_indexing tests to see.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>
2021-11-10 17:48:59 +00:00
Lionel Landwerlin 46c37c8600 anv: don't forget to add scratch buffer to BO list
We reference the scratch BO using a bindless index in the command
streamer instructions, but we forgot to add them to the BO list.

v2: Make use of pipeline reloc list (Jason)

v3: Don't add NULL BOs to the reloc list (Lionel)

v4: Don't add BOs twice to reloc list when dealing with addresses
    (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: eeeea5cb87 ("anv: Add support for scratch on XeHP")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13544>
2021-11-10 17:22:15 +00:00
James Park e0de7aa4d7 aco: Work around MSVC restrict in c99_compat.h
Future LLVM header leads to __declspec(__restrict), which is invalid.
Just undefine the restrict macro to keep __declspec(restrict).

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13505>
2021-11-10 16:37:51 +00:00
Niklas Haas a697dde553 wsi/x11: support depth 30 visuals
There's only really one format that makes sense here, since there's no
sRGB equivalent for 10-bit packed formats.

It's possible that this results in flipped colors, if 10-bit visuals
exist that have the channels in the opposite order. (They don't seem to,
on my end)

Perhaps a more principled solution would also compare the exact r/g/b
bitmasks. But for now, this works.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3537
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9450>
2021-11-10 15:53:11 +00:00
Vinson Lee 794a9cf3d6 vulkan/wsi: Unlock before return on error path.
Fix defect reported by Coverity Scan.

Missing unlock (LOCK)
missing_unlock: Returning without unlocking wsi->wait_mutex.

Fixes: 4885e63a6d ("vulkan/wsi: implement missing wsi_register_device_event")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13698>
2021-11-10 13:22:24 +00:00
Iago Toral Quiroga 3a95e25e84 v3dv,v3d: don't store swizzle pointer in shader/pipeline keys
We had been storing pointers to a driver owned swizzle table
rather than storing the actual swizzle value in various shader
and pipeline keys on both GL and Vulkan drivers.

This doesn't look very robust, particularly since we also
compute sha1 hashes from these values and we may store these
hashes to disk (for the disk cache).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13738>
2021-11-10 11:24:26 +00:00
James Park 183e705a15 vulkan, radv: Support backslash in ICD paths
Vulkan loader wants backslash for paths on Windows. Need to jump through
hoops because Meson does not support backslashes in commands.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13461>
2021-11-10 09:48:41 +00:00
Samuel Pitoiset 379fab74d2 radv/sqtt: fix GPU hangs when capturing from the compute queue
S_008D20_FINISH_DONE is a mask of queues and 1 means "wait on the gfx
queue until the value is not 0" which can never happen when the driver
captures from compute. Instead, use the full mask of possible queues.

Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13694>
2021-11-10 08:24:54 +01:00
Mike Blumenkrantz 4dfb5818ed zink: update gfx pipeline shader module pointer even if the program is unchanged
this is used for pipeline comparisons, so it has to always be accurate

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
2021-11-10 01:15:39 +00:00
Mike Blumenkrantz bfa81c1e8c zink: be more consistent about applying module hash for gfx pipeline
this was a little spaghetti-ish: the module hash was sometimes being applied
during module update, sometimes in draw during program create, and then also
it was removed when a shader unbind would cause the program to no longer be reachable

now things are more consistent:
* keep removing module hash when program becomes unreachable
* only apply module hash in draw during updates there

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
2021-11-10 01:15:39 +00:00
Mike Blumenkrantz 937a841b57 zink: ci updates
these don't spend forever in llvmpipe optimization passes anymore

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
2021-11-10 01:15:39 +00:00
Mike Blumenkrantz 2ac23b4d58 zink: always inline uniforms when running on a cpu driver
the overhead from creating new inlined shader variants is likely to be less than
the time required to fully optimize and run those variants, so just
inline 100% of the time to cut down shader runs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
2021-11-10 01:15:39 +00:00
Mike Blumenkrantz a8d90c8ed5 zink: implement cs uniform inlining
this implements shader variants for compute

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
2021-11-10 01:15:39 +00:00
Mike Blumenkrantz 06f2054cb5 zink: radv ci updates for 1dshadow stuff
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13583>
2021-11-09 23:59:04 +00:00
Mike Blumenkrantz 64e0ca15d6 zink: add 1DShadow sampler handling for drivers (radv) that don't support it
some drivers won't create zs textures in any shape but 2D. this can be
handled instead by using 2D textures and then performing shader rewrites to
convert shadow samplers for 1D and 1DArray types to 2D/array

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13583>
2021-11-09 23:59:04 +00:00
Ryan Houdek 0ae1231879 util/xmlconfig: Allow DT_UNKNOWN files
Some filesystems don't fill in d_type in dirent. Resulting in
DT_UNKNOWN. Pass this entry through to the next step and use stat on the
full filepath to determine if it is a file.

sshfs is known to not fill d_type.
This resolves an issue where driconf living on an sshfs path wasn't
working.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13697>
2021-11-09 23:25:32 +00:00
Jason Ekstrand e614789588 anv: Also disallow CCS_E for multi-LOD images
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4616
Fixes: e3101c96bb ("anv/image: Disable multi-layer CCS_E on TGL+")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13680>
2021-11-09 23:05:53 +00:00
Mike Blumenkrantz 62983f276b zink: add another compiler pass to convert 64bit vertex attribs
gallium always provides uint types, so rewrite the shader to load a 64bit
attrib and then cast back to whatever it was before

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13566>
2021-11-09 21:51:06 +00:00
Mike Blumenkrantz 39bdb00d77 zink: simplify 64bit vertex attrib lowering
this was a cool myfirstcompilerpass.exe but there's easier ways to do
things like this

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13566>
2021-11-09 21:51:06 +00:00
Mike Blumenkrantz 854fd242fa zink: declare int/float size caps inline with type usage
this is much more accurate than trying to use shader info

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13566>
2021-11-09 21:51:05 +00:00
Bas Nieuwenhuizen 17aa2be4c9 ci: Add RADV to Android CI.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>
2021-11-09 20:51:14 +00:00
Bas Nieuwenhuizen aad80e47d8 util: Add support for clang::fallthrough.
Looks like the __attribute__ version doesn't work for C++ in the
Android build. Only found now because we don't enable
-Wimplicit-fallthrough by default project wide for C++. Only
ACO enables it.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>
2021-11-09 20:51:14 +00:00
Bas Nieuwenhuizen 966c171d88 amd/addrlib: Ignore self-assign warnings.
There was a preference to not fix addrlib to make syncing with
upstream easier.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>
2021-11-09 20:51:14 +00:00
Bas Nieuwenhuizen 22673a980f meson: Check arguments before adding.
-static-libstdc++ doesn't exist on the Android NDK, casuing all
later has_argument calls to return false even though the compiler
supports that argument.

Fixes: 3aee462781 "meson: add windows compiler checks and libraries"
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>
2021-11-09 20:51:14 +00:00