Commit Graph

46002 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho 9f3d5e99ea compiler: Use util/bitset.h for system_values_read
It is currently a bitset on top of a uint64_t but there are already
more than 64 values.  Change to use BITSET to cover all the
SYSTEM_VALUE_MAX bits.

Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8585>
2021-01-26 20:20:47 +00:00
Vinson Lee f1cffe2394 clover: Add constructor for global_argument.
Fix defects reported by Coverity Scan.

member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize buf.
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize svm.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8623>
2021-01-26 05:30:39 +00:00
Francisco Jerez e2c5ef6cd6 intel/gen12: Fix memory corruption issues in fused Gen12 parts.
According to the BSpec page for MEDIA_VFE_STATE, on Gen12 platforms
"if a fused configuration has fewer threads than the native POR
configuration, the scratch space allocation is based on the number of
threads in the base native POR configuration".  However we currently
use the subslice count from devinfo->num_subslices[0], which only
includes the subslices currently enabled by the platform fusing.  This
leads to scratch space underallocation and occasional hangs.

The problem is likely to affect most Gen12 GPUs with less than 96 EUs.
GFXBench5 Aztec Ruins is able to reproduce the issue fairly reliably.

Fixes: 9e5ce30da7 "intel: fix the gen 12 compute shader scratch IDs"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8636>
2021-01-26 00:01:27 +00:00
Icecream95 1d967132f3 panfrost: Use normal malloc/free instead of ralloc for surfaces
Fixes a double-free in some Qt5 WebEngine apps (e.g. ghostwriter).

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8678>
2021-01-25 23:48:11 +00:00
Rob Clark 46e9800408 freedreno/a6xx: Fix 3dmark misrendering with unwritten MRTs
Fixes an issue with 3dmark caused by a shader that only writes mrt0 in a
renderpass that has two color buffers bound, resulting in mrt1 getting
random/undefined values.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8685>
2021-01-25 23:19:23 +00:00
Eric Anholt aa1ddb6fe3 freedreno: Skip some batch dependency tracking if !ctx->dirty.
drawoverhead test 1 perf 4.37618% +/- 0.933261% (n=57)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8602>
2021-01-25 23:00:12 +00:00
Eric Anholt 49b83509fe freedreno: Move framebuffer state checks under a ctx->dirty flag.
Anything changing this should have flagged FD_DIRTY_FRAMEBUFFER.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8602>
2021-01-25 23:00:12 +00:00
Eric Anholt 6e29757a57 freedreno: Move blend gmem checks to a blend dirty state check.
We don't need to do this every draw call.  We do now consider the blend
enable field of a non-present color buffer, because it's not worth
filtering that case out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8602>
2021-01-25 23:00:12 +00:00
Eric Anholt e4e46f2c4c freedreno/a6xx: Skip the body of emit_state if we're clean.
drawoverhead test 1 (no state change) perf +5.43864% +/- 1.28466% (n=10).

Part of #4106.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8602>
2021-01-25 23:00:12 +00:00
Mike Blumenkrantz 0376064783 zink: guarantee surface lifetimes for shader images
these may be unset from the ctx before the draw command has completed,
so we need (more) references to prevent that

Fixes: 3f9a6d333b ("zink: export shader image caps using features")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8627>
2021-01-25 22:53:08 +00:00
Christian Gmeiner 81ab9fe2d0 etnaviv: handle NULL views in set_sampler_views
Passing NULL for the views parameter should be the same as passing an
array of NULL, according to the documentation. So let's respect that
detail.

This fixes a crash when using GALLIUM_HUD. The wrong handling of views
parameter was causing problems starting with
2813688f8d ("gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views").

Cc: <mesa-stable@lists.freedesktop.org>
Fixes: c9e8b49b88 ("etnaviv: gallium driver for Vivante GPUs")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8670>
2021-01-25 20:42:22 +00:00
Eric Anholt efff70e73f gallium: Fix leak of shader images on context destruction.
Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>
2021-01-25 18:50:26 +00:00
Eric Anholt f259fcae83 panfrost: Stub out set_shader_images().
If PAN_MESA_DEBUG=deqp is set to enable testing, then we advertise shader
images to get GLES3.1, even though we don't have any of the shader image
funcs hooked up.  This caused breakage when cso started unbinding shader
images at context destruction.

Just stub out the function for now, you'll still segfault when creating an
image.

Cc: mesa-stable (for the next commit)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>
2021-01-25 18:50:26 +00:00
Eric Anholt 9445c3d59f swr: Don't report support for shader images.
gallivm has images support, but this driver doesn't.

Cc: mesa-stable (for the upcoming shader image leak fix)
Acked-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>
2021-01-25 18:50:26 +00:00
Eric Anholt fb25ef153a nir_to_tgsi: Fix buffer overflow in atomic image compswap.
Caught by the new asan CI job.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>
2021-01-25 18:50:26 +00:00
Eric Anholt 58e43594fc r300,i915g: Report no shader buffers or images on non-TCL HW.
We don't have the driver hooks to set the state, or to update draw's copy
of the state at draw time.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Fixes: d6fd7acf9b79 ("gallium: Fix leak of bound SSBOs at CSO context
destruction.")

Closes: #3990
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>
2021-01-25 18:50:26 +00:00
Mike Blumenkrantz c3719f3b9b zink: flag gfx pipeline dirty using newer mechanism
this wasn't updated during rebases

Fixes: 334759d850 ("zink: implement passthrough tcs shader injection")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8696>
2021-01-25 18:40:06 +00:00
Ryan Neph 6fb66d18be Revert "virgl: fix BGRA emulation artifacts during window resize"
This reverts commit accc222217.

The change in accc2222 caused a regression in gameplay for a few valve
games such as Portal 2 where textures were rendered darker than
expected.

Reverting to restore normal gameplay at the smaller cost of
re-introducing the issue described in !8119.

Fixes: accc2222 ("virgl: fix BGRA emulation artifacts during window resize")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8664>
2021-01-25 17:58:16 +00:00
Erik Faye-Lund 9052819ebb zink: request texcoord replace lowering
We don't actually support point-sprites by texcoord replacement, so let's
remove that cap. This allows gallium to automatically lower this to the
PNTC varying instead, which we do support.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6473>
2021-01-25 17:32:33 +00:00
Mike Blumenkrantz b59d98ae5f zink: enable PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE
this was already handled internally

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8688>
2021-01-25 16:59:36 +00:00
Mike Blumenkrantz b7fe85e949 zink: set lower_mul_2x32_64 when 64bit int support is available
started hitting umul_2x32_64 recently on ANV

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8674>
2021-01-25 16:50:15 +00:00
Mike Blumenkrantz b415211ce9 zink: add a VkExternalMemoryImageCreateInfo for PIPE_BIND_SHARED images
required by spec

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8273>
2021-01-25 16:14:30 +00:00
Connor Abbott cf5df15622 ntt: Assume that nir_tex_instr::dest_type is sized
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
2021-01-25 11:22:07 +01:00
Connor Abbott 8133649918 ttn: Use sized types for nir_tex_instr::dest_type
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
2021-01-25 11:21:53 +01:00
Connor Abbott 4b623afc3f gallium/nir: Use sized types for nir_tex_instr::dest_type
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
2021-01-25 11:21:53 +01:00
Connor Abbott 3ed9e75868 d3d12/blit: Use sized types for nir_tex_instr::dest_type
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
2021-01-25 11:21:48 +01:00
Connor Abbott 3d6fe93382 ntt: Handle sized tex destination types
I believe this code doesn't handle 16-bit destination types so we only
need to handle float32, etc.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
2021-01-25 11:21:42 +01:00
Erico Nunes 250b511f8e lima/ppir: fix creation of mov node for non-ssa tex dest
In ppir when a texture node has only a single successor, it is used
directly to output the texture lookup value, in order to save the
insertion of a mov.
However, a sequence like this can happen:

  r0 = (float)tex r8 (coord), 0 (texture), 0 (sampler)
  r1 = mov r0.z

In this case, even if the mov is a single successor, the assumption
that only the elements needed by the successor node cannot be made.
The target register can also be read or written elsewhere and so the
simplification cannot be made. Add an exception to cover this case.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8517>
2021-01-24 13:35:49 +00:00
Mike Blumenkrantz b6f8f3a3ba zink: fix streamout for clipdistance
the assert added here during review broke this since clipdistance is 8 components

Fixes: 9eec52c67e ("zink: tweak xfb slot mapping in ntv")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8673>
2021-01-24 02:21:04 +00:00
Rob Clark 03c28278a7 freedreno: Add perf_warn() for missed UBWC opportunities
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8659>
2021-01-23 09:57:48 -08:00
Rob Clark 55f4f6882f freedreno/a6xx: Add helper to check if UBWC is supported
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8659>
2021-01-23 09:57:48 -08:00
Rob Clark 38b073ebfe freedreno: Add fmt/args macros for pipe_resource
Deduplicate some long debug prints before adding more.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8659>
2021-01-23 09:57:48 -08:00
Rob Clark a065682f30 freedreno: Add perf_warn() trace helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8659>
2021-01-23 09:57:48 -08:00
Mike Blumenkrantz 3c3764f7df zink: don't force a renderpass start when setting framebuffer state
this breaks compute and isn't strictly necessary since we'll be starting
a renderpass during draw anyway; we just need to flush here to update the
state

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8662>
2021-01-23 01:11:24 +00:00
Mike Blumenkrantz 2bc24c7e46 zink: add function for waiting on a specific batch's fence
previously we only had zink_fence_wait(), which just waits on the
current batch to finish, but it may be the case that we don't want to
wait on all batches up to that point, so we can optimize a bit by only
waiting as long as we have to

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8662>
2021-01-23 01:11:24 +00:00
Mike Blumenkrantz 53d9beb9b8 gallium/u_inlines: add helper for simplifying pipe_context::resource_copy_region
this hook has too many params, and I only need like half of them

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8624>
2021-01-22 23:47:03 +00:00
Mike Blumenkrantz cacb3e1826 zink: enable PIPE_CAP_SAMPLER_VIEW_TARGET
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8629>
2021-01-22 22:37:46 +00:00
Chia-I Wu d37124b065 virgl: add support for VIRGL_CAP_V2_UNTYPED_RESOURCE
An untyped resource is a blob resource that contains only raw bytes
without type information (e.g., width, height, format, etc.).  virgl
supports only typed resources, and when it encounters untyped resources,
it fails silently in the host.

This cap enables virgl to assign type information to untyped resources.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-By: Isaac Bosompem <mrisaacb@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8584>
2021-01-22 21:25:49 +00:00
Vinson Lee 9565c1d83c nv50/ir: Initialize RegAlloc member func in constructor.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member func 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/8568>
2021-01-22 21:14:51 +00:00
Erik Faye-Lund 92ec7b577c zink: clone shader before lowering clip_halfz
If we don't clone the shader before lowering clip_halfz, we risk ending
up performing the same lowering multiple times, each time we compile a
new variant.

This fixes rendering in Neverball.

Fixes: 15f478fe84 ("zink: only run nir_lower_clip_halfz for last vertex processing stage")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4147
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8652>
2021-01-22 20:04:17 +00:00
Mike Blumenkrantz 5282210c0b zink: check correct caps for PIPE_CAP_IMAGE_LOAD_FORMATTED
we actually need more features here than just the one which was checked to
enabled this

Fixes: 2f6f4b613c3 ("zink: export shader image caps using features")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8656>
2021-01-22 19:54:58 +00:00
Marek Olšák 67c2921193 radeonsi: iterate from draw 1 for total/min_direct_count computation
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák 01e3d28829 radeonsi: enable accidentally disabled fast launch with non-indexed tri strips
Only *indexed* triangle strips hang.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák ea670ac150 radeonsi: skip some code for ALLOW_PRIM_DISCARD_CS if tess or GS is enabled
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák dd9801a918 radeonsi: rename SI_SGPR_RW_BUFFERS to SI_SGPR_INTERNAL_BINDINGS
They are just internal buffers and images.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák 59a478b843 radeonsi: move if (sctx->vertex_buffers_dirty) into the upload function
This looks unnecessary, but the next commit will build upon it and add
more stuff into the function.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák 5013828863 radeonsi: don't set vertex buffer dirty flags when they don't do anything
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák 26d785fbbd radeonsi: move y_inverted out of si_viewports
for better packing

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák c1957e58a6 radeonsi: inline si_blend_color and si_clip_state structures
better packing

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00
Marek Olšák ca2062a394 radeonsi: simplify determining whether render condition is enabled at draw time
Read one bool instead of reading one bool and one pointer.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
2021-01-22 16:45:30 +00:00