Rob Clark [Thu, 25 Feb 2021 18:04:50 +0000 (10:04 -0800)]
util: Add accessor for util_cpu_caps
In release builds, there should be no change, but in debug builds the
assert will help us catch undefined behavior resulting from using
util_cpu_caps before it is initialized.
With fix for u_half_test for MSVC from Jesse Natalie squashed in.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>
Rob Clark [Wed, 24 Feb 2021 21:59:15 +0000 (13:59 -0800)]
util/u_queue: Ensure num_cpu_mask_bits is valid
I noticed that we were hitting this before st_create_context() called
util_cpu_detect() and so num_cpu_mask_bits was zero. But there is no
harm in calling util_cpu_detect(), so lets just call it here to be safe.
Fixes:
d877451b48a ("util/u_queue: add UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>
Samuel Pitoiset [Fri, 26 Feb 2021 13:07:56 +0000 (14:07 +0100)]
ac/rgp: report the number of primitives per clock
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9303>
Samuel Pitoiset [Fri, 26 Feb 2021 13:01:19 +0000 (14:01 +0100)]
ac/rgp: report the number of memory operations per clock
So that RGP reports the memory type and the memory throughput.
Based on AMDVLK.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9303>
Samuel Pitoiset [Fri, 26 Feb 2021 12:55:55 +0000 (13:55 +0100)]
ac/rgp: report LDS size in CU mode on GFX10+
RGP expects that.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9303>
Samuel Pitoiset [Fri, 26 Feb 2021 09:22:12 +0000 (09:22 +0000)]
ac/rgp: recognize more memory types
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9303>
Samuel Pitoiset [Fri, 26 Feb 2021 09:18:07 +0000 (09:18 +0000)]
include/drm-uapi: bump AMDGPU headers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9303>
Gert Wollny [Mon, 4 Jan 2021 08:55:40 +0000 (09:55 +0100)]
r600/sfn: remove old cube texturing code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
Gert Wollny [Wed, 23 Dec 2020 21:42:45 +0000 (22:42 +0100)]
r600/sfn: use lowering pass for cube textures
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
Gert Wollny [Thu, 24 Dec 2020 15:48:00 +0000 (16:48 +0100)]
r600/sfn: use lower bool to int32 and lower int_tg4 only on shader clone
These changes should not be visible to shader variants that may go through
the optimization another time.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
Gert Wollny [Mon, 4 Jan 2021 08:47:38 +0000 (09:47 +0100)]
r600/sfn: fix gather with cube lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
Gert Wollny [Wed, 23 Dec 2020 21:42:26 +0000 (22:42 +0100)]
r600/sfn: add lowering pass for cube textures
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
Gert Wollny [Wed, 23 Dec 2020 21:42:07 +0000 (22:42 +0100)]
r600/sfn: Add support for cube_r600 instruction
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9302>
Rhys Perry [Fri, 26 Feb 2021 09:45:07 +0000 (09:45 +0000)]
aco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit
Since value-numbering no longer works across loops, we no longer need to
use v_readfirstlane_b32.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9288>
Rhys Perry [Thu, 25 Feb 2021 15:37:17 +0000 (15:37 +0000)]
aco: calculate all p_as_uniform and v_readfirstlane_b32 sources in WQM
We should avoid a situation where a v_readfirstlane_b32 is in WQM but it's
source is calculated in Exact.
Fixes hang when running Assassin's Creed: Valhalla benchmark.
fossil-db (GFX10.3):
Totals from 1021 (0.70% of 146267) affected shaders:
CodeSize: 7835228 -> 7842992 (+0.10%); split: -0.00%, +0.10%
Instrs: 1519208 -> 1521149 (+0.13%); split: -0.00%, +0.13%
SClause: 78921 -> 78920 (-0.00%)
Copies: 44456 -> 45421 (+2.17%); split: -0.05%, +2.22%
Branches: 12987 -> 13933 (+7.28%)
PreSGPRs: 47599 -> 47813 (+0.45%)
Cycles:
10037540 ->
10045304 (+0.08%); split: -0.00%, +0.08%
VMEM: 538381 -> 538777 (+0.07%); split: +0.11%, -0.03%
SMEM: 84553 -> 84554 (+0.00%); split: +0.01%, -0.01%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9288>
Juan A. Suarez Romero [Thu, 25 Feb 2021 11:21:57 +0000 (12:21 +0100)]
ci/piglit: fix parallel piglit results
Commit
bcea453d4a6 removed the summary from the expected piglit
results, but handling of results when using parallel jobs was also doing
the same, which ends up on removing too many lines from results.
Fixes:
bcea453d4a6 ("ci/piglit: Stop including the test counts at the
end of expectations.")
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9286>
Gert Wollny [Wed, 23 Dec 2020 15:19:31 +0000 (16:19 +0100)]
nir: Add r600 specific CUBE opcode to evaluate cube texture coords and
face
The opcode evaluates tha unnormalized coordinates, the length of the
major axis, and the cube face.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9200>
Gert Wollny [Wed, 13 Jan 2021 09:28:59 +0000 (10:28 +0100)]
nir: Add flag to tex instruction to indicate lowering cube to array
E.g. r600 a cube texture lookup uses a specific cube instruction
to evaluate the sample coordinates and the face ID, so that the cube
texture lookup can be lowered to a array texture lookup, thereby sharing
the code with the 2D array texture lopkup.
However, for TXD the given gradients still need to be three-component
vectors, so add a flag that the NIR validation knows that we deal with
cube texture that was lowered to an array and can validate accordingly.
v2: Handle new flag in serialization (Marek)
v3: Rebase so that the change does not require the patch to deduct the
number of offset and grad components from sampler type
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9200>
Mike Blumenkrantz [Wed, 7 Oct 2020 16:46:38 +0000 (12:46 -0400)]
zink: use pre-fetched format properties everywhere
this is a noticeable perf improvement
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9293>
Mike Blumenkrantz [Wed, 7 Oct 2020 16:45:04 +0000 (12:45 -0400)]
zink: pre-fetch all format properties during screen init
this ends up being a tradeoff where we waste a little startup time and
an extra ~4k memory for the overall screen object in exchange for never having
to fetch format properties again, which is a surprisingly expensive call
to be making as much as we have to make it
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9293>
Kenneth Graunke [Tue, 23 Feb 2021 03:04:39 +0000 (19:04 -0800)]
i965: Eliminate all tabs except in brw_defines.h
For a while we were doing 3-space indent with 8-space tabs, largely
due to the emacs settings of a couple of contributors. We stopped
using tabs a long time ago, and they're just a nuisance at this point.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Tue, 23 Feb 2021 01:13:12 +0000 (17:13 -0800)]
i965: Rename DRI extension structs to be "brw" instead of "intel"
Matching the rest of the driver, and avoiding confusion with i915.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Tue, 23 Feb 2021 00:46:16 +0000 (16:46 -0800)]
i965: Rename more camel-case functions to brw and underscore style
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Tue, 23 Feb 2021 00:05:49 +0000 (16:05 -0800)]
i965: Rename some camel-case local variables
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 23:59:39 +0000 (15:59 -0800)]
i965: Rename intelInit and brwInit camel-case functions to brw_*
The driver style has been to use underscores for internal functions.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 19:43:46 +0000 (11:43 -0800)]
i965: Rename the rest of intel_* functions to brw_*
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 19:43:46 +0000 (11:43 -0800)]
i965: Rename intel_image_format and intel_buffer to brw_*
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 19:37:49 +0000 (11:37 -0800)]
i965: Rename intel_buffer_object to brw_buffer_object
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Tue, 23 Feb 2021 00:42:05 +0000 (16:42 -0800)]
i965: Use __func__ in blorp perf_debug macros
These had the function name baked into the perf_debug message, which
after a bunch of refactoring, was out of sync with the actual code.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 19:01:33 +0000 (11:01 -0800)]
i965: Rename intel_mip* to brw_mip*.
With lots of indentation fixes.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 18:43:42 +0000 (10:43 -0800)]
i965: Rename intel_renderbuffer to brw_renderbuffer
For now, keeping the 'irb' name on local variables.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 18:41:26 +0000 (10:41 -0800)]
i965: Rename intel_texture_{object,image} to brw_texture_{object,image}
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 18:40:10 +0000 (10:40 -0800)]
i965: Rename intel_screen to brw_screen
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 18:35:03 +0000 (10:35 -0800)]
i965: Rename intel_batchbuffer_* to brw_batch_*.
Shorter, matching the convention in iris, and drops use of "intel_"
on i965-specific code that isn't shared.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Kenneth Graunke [Mon, 22 Feb 2021 19:04:53 +0000 (11:04 -0800)]
i965: Rename use_intel_mipree_map_blit to use_blitter_to_map
Mip...ree? Use a more descriptive name instead of just fixing the typo.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
Rob Clark [Wed, 24 Feb 2021 19:21:01 +0000 (11:21 -0800)]
freedreno: Add macro for duration based warns
Add a macro to do a perf_debug() if a block of code takes longer than a
specified amount of time.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
Rob Clark [Wed, 24 Feb 2021 20:36:56 +0000 (12:36 -0800)]
freedreno: Slight perf_debug rework
Allow ctx to be NULL in perf_debug_ctx() and make perf_debug() a
shortcut for perf_debug_ctx(NULL, ...) to simplify things slightly
in the next patch.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
Rob Clark [Wed, 24 Feb 2021 21:31:43 +0000 (13:31 -0800)]
freedreno: Add FD_DBG() macro
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
Rob Clark [Thu, 25 Feb 2021 17:12:54 +0000 (09:12 -0800)]
freedreno/ir3: Fix initial_variants_synchronous() condition
This was meant to be an || rather than &&, although it didn't matter for
shaderdb because both conditions would be true. But it did matter if
you were trying to force synchronous compile to avoid having nir/ir3
prints interleaved from multiple threads.
While at it, add a more specific debug flag to force initial variant
compile to be synchronous, because at some point the 'shaderdb' flag
itself will not force this.
Fixes:
75b0c4b5e1e ("freedreno/ir3: Async shader compile")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
Rob Clark [Wed, 24 Feb 2021 18:58:15 +0000 (10:58 -0800)]
freedreno: Fix think-o in fd_resource_wait()
Fixes:
dabec19b05e ("freedreno: Add perf_debug logging for bo stalls")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9264>
Mauro Rossi [Tue, 23 Feb 2021 20:50:18 +0000 (21:50 +0100)]
android: pan/bi: reorder static dependencies in gallium/dri
libpanfrost_lib depends on libpanfrost_bifrost for 'bifrost_compile_shader_nir' symbol
libpanfrost_lib depends on libpanfrost_bifrost_disasm for 'disassemble_bifrost' symbol
LOCAL_STATIC_LIBRARIES requires proper ordering to make the symbols available
Fixes the following building error happening with Android P:
FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
external/mesa/src/panfrost/lib/decode.c:534: error: undefined reference to 'disassemble_bifrost'
external/mesa/src/panfrost/lib/pan_shader.c:145: error: undefined reference to 'bifrost_compile_shader_nir'
Cc: 20.3 21.0 <mesa-stable@lists.freedesktop.org>
Fixes: 166630f ("android: pan/bi: Separate disasm/compiler targets")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9265>
Eric Anholt [Thu, 25 Feb 2021 00:28:18 +0000 (16:28 -0800)]
freedreno/a5xx: Fix cube image load/stores.
This is the same thing we do on a6xx for cubes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9270>
Dave Airlie [Thu, 18 Feb 2021 04:56:39 +0000 (14:56 +1000)]
ci: try building lavapipe on windows
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9121>
James Park [Wed, 3 Feb 2021 18:28:47 +0000 (10:28 -0800)]
vulkan: Update dispatch table gen for Windows
Update entry null test to deal with MSVC not supporting weak functions.
Also fix warnings for returning from void functions.
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9121>
James Park [Wed, 3 Feb 2021 18:32:02 +0000 (10:32 -0800)]
vulkan: Fix source list for vulkan_wsi on Windows
I don't think link_whole works right for VS project generation, but MSVC
doesn't support GCC weak functions anyway, so work around it.
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9121>
Mike Blumenkrantz [Wed, 17 Feb 2021 23:23:43 +0000 (18:23 -0500)]
zink: fix dynamic bo lowering for ssbo stores
there are no piglit tests for this, so naturally it would not have worked
fixes KHR-GL46.compute_shader.resources-max
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9113>
Jesse Natalie [Wed, 24 Feb 2021 18:42:49 +0000 (10:42 -0800)]
meson/gallium: Add an option to not use LLVM for gallium draw module
We'd like to use one Mesa build environment which builds our CL compiler
stack (which needs Clang/LLVM) and which builds our GL driver. The GL
driver doesn't really need LLVM support, and since we're statically
linking LLVM, removing it from the driver drastically reduces our DLL
size on disk.
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9259>
Roman Stratiienko [Thu, 20 Aug 2020 15:46:57 +0000 (18:46 +0300)]
egl: android: use num_planes param in createImageFromDmaBufs()
Fixes
972f36d8fa62 ("egl/android: Call createImageFromDmaBufs directly")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9278>
Michel Zou [Wed, 24 Feb 2021 19:28:38 +0000 (20:28 +0100)]
meson/xmlconfig: win32 regex fallback
xmlconfig now uses regex fonctions even without xml support
Fixes:
c83400e6
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9261>
Mike Blumenkrantz [Thu, 25 Feb 2021 13:38:48 +0000 (08:38 -0500)]
zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9232>
Mike Blumenkrantz [Tue, 23 Feb 2021 19:20:10 +0000 (14:20 -0500)]
zink: relax tessellation shader reqs
vk memory model isn't actually required for tcs io semantics due
to how control barriers are emitted in GL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9232>
Qiang Yu [Sun, 14 Feb 2021 10:41:10 +0000 (18:41 +0800)]
lima: fix xserver page flip fail for full screen client
Need to import client buffer to display drm device, otherwise
get following xserver error log:
[ 190.982] (WW) modeset(0): Page flip failed: No such file or directory
[ 190.982] (EE) modeset(0): present flip failed
With this fix, full screen x11 client can display its window
buffer directly without a copy. Tested on Allwinner H3, 1080p
full screen glxgears go from 163FPS to 173FPS.
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9038>
Jose Fonseca [Tue, 14 Apr 2020 15:36:33 +0000 (16:36 +0100)]
wgl: Match opengl32.dll export ordinals.
Some apps import GL/WGL symbols by ordinal. See
https://github.com/apitrace/apitrace/issues/652
This is not an issue when Mesa is used as an OpenGL ICD, but it might
create troubles when used as a drop-in opengl32.dll replacement.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7372>
Daniel Schürmann [Tue, 22 Dec 2020 10:59:26 +0000 (11:59 +0100)]
aco/value_numbering: use can_eliminate() function to avoid unnecessary hashmap lookups
No fossil-db changes.
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9195>
Daniel Schürmann [Mon, 21 Dec 2020 11:49:07 +0000 (12:49 +0100)]
aco: value number VOPC instructions with different exec masks
This becomes possible as long as we do
val = s_and_b32/64 exec, val
before any subgroup operations.
This precautional instruction can be removed by the
optimizer if 'val' was computed by a VOPC instruction
using the same exec mask.
Totals from 59 (0.04% of 146267) affected shaders (Navi10):
VGPRs: 2808 -> 2816 (+0.28%)
CodeSize: 340888 -> 340852 (-0.01%); split: -0.20%, +0.19%
Instrs: 61733 -> 61625 (-0.17%); split: -0.18%, +0.01%
Cycles: 470636 -> 469112 (-0.32%); split: -0.33%, +0.01%
VMEM: 8091 -> 7993 (-1.21%)
SMEM: 2736 -> 2719 (-0.62%); split: +0.29%, -0.91%
VClause: 1745 -> 1741 (-0.23%)
SClause: 2394 -> 2392 (-0.08%); split: -0.25%, +0.17%
Copies: 3249 -> 3253 (+0.12%); split: -0.62%, +0.74%
Branches: 1210 -> 1206 (-0.33%)
PreSGPRs: 3126 -> 3176 (+1.60%); split: -0.16%, +1.76%
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9195>
Aaron Watry [Sun, 25 Oct 2020 19:20:00 +0000 (20:20 +0100)]
clover: implement CL_IMAGE_NUM_MIP_LEVELS and CL_IMAGE_NUM_SAMPLES
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>
Edward O'Callaghan [Fri, 18 Nov 2016 05:38:13 +0000 (16:38 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE1D
v2: Consider surface height as valid when unused by using 1.
Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
Fix validation
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>
Karol Herbst [Mon, 26 Oct 2020 12:57:22 +0000 (13:57 +0100)]
clover: rework quering image max sizes
The 3D one was always wrongly used, also the consumers always wanted the
size, not the levels. This should make it easier to use the interface and
also prevent future bugs like the 3D one.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>
Aaron Watry [Sun, 11 Oct 2020 19:33:19 +0000 (21:33 +0200)]
clover: implement CL_IMAGE_ELEMENT_SIZE
v2 (Karol Herbst): extracted from other commit
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>
Karol Herbst [Wed, 21 Oct 2020 00:55:11 +0000 (02:55 +0200)]
clover: simplify image arguments
We don't care how many dimensions the image arg has, so drop it otherwise
we would have to add a lot of variants for arrays, msaa and depth
combinations. Yes, image2d_array_msaa_depth_t is a thing.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>
Serge Martin [Sun, 11 Oct 2020 18:27:44 +0000 (20:27 +0200)]
clover: return CL_INVALID_VALUE when origin or region are NULL
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9212>
Samuel Pitoiset [Wed, 24 Feb 2021 12:05:26 +0000 (13:05 +0100)]
radv: do not scale the depth bias for D16_UNORM depth surfaces
Scaling the depth bias doesn't seem correct with Vulkan. This is
probably the root cause of the shadow artifacts differences between
RADV and AMDVLK/AMDGPU-PRO.
Fix dEQP-VK.rasterization.depth_bias.d16_unorm.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2217
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/9249>
Mike Blumenkrantz [Tue, 20 Oct 2020 19:20:40 +0000 (15:20 -0400)]
zink: hook up nir_texop_query_levels
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9275>
Mike Blumenkrantz [Tue, 20 Oct 2020 19:20:29 +0000 (15:20 -0400)]
zink: add spirv builder methods for OpImageQueryLevels
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9275>
Mike Blumenkrantz [Fri, 27 Nov 2020 17:14:30 +0000 (12:14 -0500)]
zink: do batch-program tracking after possibly cycling batch in update_descriptors()
ensure we have the right batch here
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Mike Blumenkrantz [Fri, 27 Nov 2020 17:13:23 +0000 (12:13 -0500)]
zink: increment batch->descs_used during update_descriptors flushing
ensure that this actually flushes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Mike Blumenkrantz [Fri, 27 Nov 2020 15:37:03 +0000 (10:37 -0500)]
zink: properly size descriptorset layout binding stack array
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Mike Blumenkrantz [Sun, 4 Oct 2020 14:19:28 +0000 (10:19 -0400)]
zink: unref programs last in batch reset
we're going to want to make sure all other resources have been handled
at this point so that we can make some better decisions in this block
based on descriptor usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Mike Blumenkrantz [Fri, 2 Oct 2020 17:20:42 +0000 (13:20 -0400)]
zink: ralloc zink program structs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Mike Blumenkrantz [Fri, 2 Oct 2020 17:18:21 +0000 (13:18 -0400)]
zink: use zink_program in zink_batch_reference_program()
this is a little nicer
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Mike Blumenkrantz [Fri, 2 Oct 2020 17:12:47 +0000 (13:12 -0400)]
zink: add zink_program struct as a base class for compute/gfx structs
this is going to be useful for managing descriptors
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
Vinson Lee [Mon, 22 Feb 2021 01:47:47 +0000 (17:47 -0800)]
zink: Remove leftover dead code.
Fix defect reported by Coverity Scan.
Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: return progress;
Fixes:
d550c5780f6 ("zink: use nir_shader_instructions_pass for draw params pass")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9182>
Vinson Lee [Mon, 22 Feb 2021 03:20:57 +0000 (19:20 -0800)]
gv100/ir: Initialize CodeEmitterGV100 members in constructor.
Fix defects reported by Coverity Scan.
uninit_member: Non-static class member prog is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member insn is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9183>
Vinson Lee [Mon, 22 Feb 2021 01:31:30 +0000 (17:31 -0800)]
nir/lower_tex: Change coord type to int.
nir_tex_instr_src_index returns an int.
Fix defect reported by Coverity Scan.
Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an unsigned value is always true. coord >= 0U.
Fixes:
b154a4154b4 ("nir/lower_tex: rewrite tex/txb -> txd/txl before saturating srcs")
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/9181>
Vinson Lee [Sun, 17 Jan 2021 06:04:44 +0000 (22:04 -0800)]
llvmpipe: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8542>
Vinson Lee [Sat, 2 Jan 2021 01:31:15 +0000 (17:31 -0800)]
r600: Fix typos.
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/8293>
Michel Zou [Wed, 24 Feb 2021 05:20:36 +0000 (06:20 +0100)]
gallium: remove DROP_PIPE_LOADER_MISC
not needed since these code paths are always enabled
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7208>
Michel Zou [Tue, 23 Feb 2021 08:28:25 +0000 (09:28 +0100)]
lavapipe: set empty dll prefix
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7208>
Michel Zou [Tue, 23 Feb 2021 08:22:50 +0000 (09:22 +0100)]
lavapipe: add mingw32 def file
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7208>
Michel Zou [Mon, 9 Nov 2020 21:51:01 +0000 (22:51 +0100)]
vulkan: implement wsi_win32 backend
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7208>
Dave Airlie [Tue, 23 Feb 2021 08:30:20 +0000 (18:30 +1000)]
lavapipe: use null probe path on win32
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7208>
Timothy Arceri [Wed, 24 Feb 2021 12:27:15 +0000 (23:27 +1100)]
util/disk_cache: fix crash in fossilize_db
We don't need to close the file here check_files_opened_successfully()
already does that for us if needed.
This fixes a crash when invalid filename/paths are provided to the
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS environment variable.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9251>
Mike Blumenkrantz [Thu, 1 Oct 2020 13:37:08 +0000 (09:37 -0400)]
zink: rename zink_context::buffers -> vertex_buffers (and usage mask)
this is more descriptive
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
Mike Blumenkrantz [Mon, 28 Sep 2020 18:23:15 +0000 (14:23 -0400)]
zink: use dynamic vertex buffer strides
this removes another case of needing to rehash/create a new pipeline
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
Mike Blumenkrantz [Mon, 28 Sep 2020 18:21:52 +0000 (14:21 -0400)]
zink: make dynamic state usage in pipeline creation more explicit/flexible
we'll be expanding this, so we want to have it very easy to update and read
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
Mike Blumenkrantz [Mon, 28 Sep 2020 18:20:07 +0000 (14:20 -0400)]
zink: setup CmdBindVertexBuffers2EXT member in screen for dynamic state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9272>
Marek Olšák [Tue, 23 Feb 2021 15:44:36 +0000 (10:44 -0500)]
nouveau_vieux: use align_calloc for the context to fix m32 crashes
Fixes:
3175b63a0dfa290 "mesa: don't allocate matrices with malloc"
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9220>
Marek Olšák [Tue, 23 Feb 2021 15:44:36 +0000 (10:44 -0500)]
radeon,r200: use align_calloc for the context to fix m32 crashes
Fixes:
3175b63a0dfa290 "mesa: don't allocate matrices with malloc"
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9220>
Marek Olšák [Tue, 23 Feb 2021 15:44:36 +0000 (10:44 -0500)]
i915: use align_calloc for the context to fix m32 crashes
Fixes:
3175b63a0dfa290 "mesa: don't allocate matrices with malloc"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4295
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9220>
Mike Blumenkrantz [Thu, 8 Oct 2020 19:19:02 +0000 (15:19 -0400)]
zink: set VK_IMAGE_LAYOUT_PRESENT_SRC_KHR on fb resources at eof flush
this should maybe fix garbled images on amd?
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Thu, 8 Oct 2020 19:18:31 +0000 (15:18 -0400)]
zink: handle VK_IMAGE_LAYOUT_PRESENT_SRC_KHR barriers
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Wed, 30 Sep 2020 13:51:55 +0000 (09:51 -0400)]
zink: handle PIPE_FLUSH_DEFERRED
these flushes queue the fence to be submitted on the next finish call, so
we have to store the context to the fence to be able to handle threaded calls
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Wed, 30 Sep 2020 16:54:10 +0000 (12:54 -0400)]
zink: add util function for returning previous batch
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Fri, 2 Oct 2020 17:19:21 +0000 (13:19 -0400)]
zink: add a define for compute batch count
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Tue, 29 Sep 2020 19:12:21 +0000 (15:12 -0400)]
zink: only flush batches in pipe_context::flush if they actually have work
no need to submit command buffers to the queue which have no commands, so we
can just proceed to give back an inactive fence object that always returns success
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Antonio Caggiano [Fri, 14 Aug 2020 06:10:06 +0000 (08:10 +0200)]
zink: fix destroy batch
Extract batch destruction in its own function, then make sure to
release objects.
Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Wed, 24 Feb 2021 02:40:51 +0000 (21:40 -0500)]
zink: create a single fence per batch on startup and then reuse
previously we would be creating a new fence per batch for every submit,
but we can just reset and reuse them if we're careful with it
based on original patch by Antonio Caggiano
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
Mike Blumenkrantz [Mon, 28 Sep 2020 18:13:12 +0000 (14:13 -0400)]
zink: reorder zink_bind_vertex_buffers()
we should be making this a no-op if we have no bindings (somehow)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9241>
Mike Blumenkrantz [Mon, 14 Sep 2020 17:37:05 +0000 (13:37 -0400)]
zink: move samplerview referencing around in update_descriptors()
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9241>
Mike Blumenkrantz [Mon, 28 Sep 2020 17:35:25 +0000 (13:35 -0400)]
zink: avoid memset during update_descriptors() for resources refs
we can simplify this a bit to further reduce cpu usage here
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9241>