Connor Abbott [Wed, 13 Oct 2021 15:28:07 +0000 (17:28 +0200)]
vk/format, v3dv: Add a vulkan -> pipe swizzle helper
And use it to replace the one in v3dv.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 12:35:09 +0000 (14:35 +0200)]
Revert "gallium: add a is_dri_blit_image bool to pipe_blit_info"
This reverts commit
22a1b7c5b3a9cdbf05a0fd97fb193763a525b732.
The only use was radeonsi and it switched to PIPE_BIND_DRI_PRIME
instead.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 12:34:31 +0000 (14:34 +0200)]
radeonsi: use PIPE_BIND_DRI_PRIME instead of is_dri_blit_image
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 14:12:01 +0000 (16:12 +0200)]
radeonsi/gfx10.3: enable SDMA for DRI_PRIME copies
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:16:31 +0000 (15:16 +0200)]
winsys/amdgpu: add uncached flag to the imported DRI_PRIME buffer
There's no point in caching this linear buffer since we're only
ever writing to it.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:15:20 +0000 (15:15 +0200)]
radeon_winsys.h: add a parameter to buffer_from_handle
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:12:12 +0000 (15:12 +0200)]
gallium/dri: let the driver know if the imported image is DRI_PRIME buffer
Use createImageFromFds2 together with __DRI_IMAGE_PRIME_LINEAR_BUFFER, so
the driver's resource_from_handle hook will be aware that this specific
image is the linear buffer.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:09:49 +0000 (15:09 +0200)]
gallium/dri: add createImageFromFds2
Same as createImageFromFds but with added flags so the caller can give
the driver more context.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:06:31 +0000 (15:06 +0200)]
gallium/dri: replace bool with flag parameter
This will allow to pass more information.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
Witold Baryluk [Thu, 14 Oct 2021 22:40:14 +0000 (00:40 +0200)]
zink: Fully initialize VkBufferViewCreateInfo for hashing
Makes hashing achieve higher hit rate, and valgrind happier.
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13371>
Juan A. Suarez Romero [Mon, 18 Oct 2021 11:16:35 +0000 (13:16 +0200)]
v3dv/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13407>
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 15:28:19 +0000 (17:28 +0200)]
radeonsi: use viewport offset in quant_mode determination
Instead of only using the viewport extent.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5344
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13382>
Vinson Lee [Sun, 17 Oct 2021 05:34:25 +0000 (22:34 -0700)]
anv: Fix assertion.
Fix defect reported by Coverity Scan.
Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
assign_where_compare_meant: use of "=" where "==" may have been intended
Fixes:
35315c68a57 ("anv: Use the common wrapper for GetPhysicalDeviceFormatProperties")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13395>
Samuel Pitoiset [Fri, 15 Oct 2021 12:52:13 +0000 (14:52 +0200)]
radv: fix removing PSIZ when it's not emitted by the last VGT stage
This dereferences a NULL pointer and crash many tests with Zink.
Fixes:
92e1981a800 ("radv: Remove PSIZ output when it isn't needed.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13378>
Aaron Watry [Sun, 11 Oct 2020 19:34:24 +0000 (21:34 +0200)]
clover/image: add dimension property
With that we can fix CL_IMAGE_HEIGHT and CL_IMAGE_DEPTH.
v2 (Karol Herbst): split up commit
(Serge Martin): convert to virtual method
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Edward O'Callaghan [Fri, 18 Nov 2016 06:21:51 +0000 (17:21 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE1D_ARRAY
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: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Edward O'Callaghan [Fri, 18 Nov 2016 05:51:14 +0000 (16:51 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE1D_BUFFER
v2: Consider surface height as valid when unused by using 1.
Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
v4:(airlied): use max_buffer_size as the limit (Fixes CTS test)
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Edward O'Callaghan [Fri, 18 Nov 2016 04:24:18 +0000 (15:24 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE2D_ARRAY
v2: Ensure we pass in row_pitch state as well.
v3 (Karol): Pull in changes from later commits
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Aaron Watry [Sun, 25 Oct 2020 17:32:27 +0000 (18:32 +0100)]
clover: implement CL_IMAGE_BUFFER
We will also need it to implement image1Dbuffer_t
v2 (Karol Herbst): extracted from other commit
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Edward O'Callaghan [Sat, 26 Nov 2016 06:18:58 +0000 (17:18 +1100)]
clover/images: Add array_size to implement CL_IMAGE_ARRAY_SIZE
This will be needed to implement array immages.
v2 (Karol Herbst): Extracted from other commit
Fix clEnqueueMapImage for arrays
Add some basic support for image arrays
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Karol Herbst [Thu, 1 Apr 2021 16:12:30 +0000 (18:12 +0200)]
clover/image: add templated basic_image class to simplify image subclassing
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Karol Herbst [Tue, 3 Nov 2020 16:41:53 +0000 (17:41 +0100)]
spirv: Don't add 0.5 to array indicies for OpImageSampleExplicitLod
This fixes CLs 1.2 1Darray and 2Darray images.
Fixes:
589d918a4f9da83e3ae441aa674372a141d23349
("spirv: Add 0.5 to integer coordinates for OpImageSampleExplicitLod")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
Juan A. Suarez Romero [Sun, 17 Oct 2021 21:41:02 +0000 (23:41 +0200)]
vc4/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13397>
Dave Airlie [Wed, 13 Oct 2021 04:49:50 +0000 (14:49 +1000)]
llvmpipe: fix userptr for texture resources.
This is needed for CL image hostptr support, but it's possible
it could hit these paths from GL/Vulkan
Fixes:
9a57dceeb760 ("llvmpipe: add support for user memory pointers")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13375>
Alyssa Rosenzweig [Sat, 16 Oct 2021 23:36:16 +0000 (19:36 -0400)]
panfrost: Don't allow rendering/texturing 48-bit
Matches freedreno. Fixes crashes in Piglit arb_texture_view.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13394>
Derek Foreman [Fri, 8 Oct 2021 13:55:44 +0000 (08:55 -0500)]
egl/wayland: Properly clear stale buffers on resize
The following chain of events results in an incorrectly sized buffer
persisting beyond its useful lifetime, and causing visual artifacts.
buffer is attached at size A
window is resized to size B
rendering takes place for size B
window is resized back to size A
swapbuffers with damage is called
In this scenario, update_buffers fails to recognize that the surface it's
about to commit is a different size than it has rendered. The
attached_width and attached_height are set incorrectly, and periodic
flickering is observed.
Instead, we set a boolean flag at time of resize and use this at the time
we latch the window dimensions as surface dimensions to decide whether to
discard stale buffers.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13270>
Marek Olšák [Tue, 14 Sep 2021 04:32:51 +0000 (00:32 -0400)]
radeonsi: don't memcmp inlined uniform values if uniform inlining is disabled
This uses a C++ template to compute the memcmp size at compile time,
which is important for getting inlined memcmp.
There are 4 different key sizes now:
GE with inlined uniforms: 68 bytes
GE without inlined uniforms: 52 bytes
PS with inlined uniforms: 28 bytes
PS without inlined uniforms: 12 bytes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13285>
Marek Olšák [Tue, 14 Sep 2021 03:09:22 +0000 (23:09 -0400)]
radeonsi: split si_shader_key into ps and ge parts to minimize memcmp overhead
ps is for the pixel shader, while ge is for VS, TCS, TES, and GS.
si_shader_key: 68 bytes
si_shader_key_ge: 68 bytes
si_shader_key_ps: 28 bytes
The only notable change is that si_shader_select_with_key is changed
to a C++ template. Other changes are trivial.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13285>
Marek Olšák [Tue, 14 Sep 2021 03:25:31 +0000 (23:25 -0400)]
radeonsi: si_state_shaders.c -> cpp
We'll add some templates here.
Why is `extern "C"` not needed for exported functions?
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13285>
Marek Olšák [Tue, 14 Sep 2021 03:28:04 +0000 (23:28 -0400)]
gallium/util: add some extern "C" guards
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13285>
Jason Ekstrand [Fri, 15 Oct 2021 21:26:32 +0000 (16:26 -0500)]
compiler/types: Add a wrap_in_arrays helper
This has been copied+pasted 3 times now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 19:15:52 +0000 (14:15 -0500)]
spirv: Use texture types for sampled images
Instead of using gsamplerND types for sampled images, use the new
gtextureND types for sampled images and reserve gsamplerND for combined
image+samplers. Combined image+sampler bindings still get a gsamplerND
type.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 21:55:46 +0000 (16:55 -0500)]
clover/nir: Don't remove texture variables
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 21:55:37 +0000 (16:55 -0500)]
lavapipe: Allow for texture types
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 19:53:19 +0000 (14:53 -0500)]
nir/deref: Also optimize samplerND -> textureND casts
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 19:15:32 +0000 (14:15 -0500)]
nir: Allow texture types
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 18:56:57 +0000 (13:56 -0500)]
compiler/types: Add a texture type
This is separate from images and samplers. It's a texture (not a
storage image) without a sampler. We also add C-visible helpers to
convert between sampler and image types.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 21:52:51 +0000 (16:52 -0500)]
compiler/types: Unify the guts of get_sampler/image_count
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Jason Ekstrand [Fri, 15 Oct 2021 19:25:00 +0000 (14:25 -0500)]
compiler/types: Combine image and sampler type serialization
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
Yiwei Zhang [Fri, 15 Oct 2021 20:30:56 +0000 (20:30 +0000)]
dri_interface: remove gl header
Only gl typedefs are used. So just remove the header and update the
types to the underlying types.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13387>
Yiwei Zhang [Fri, 15 Oct 2021 18:38:32 +0000 (18:38 +0000)]
dri_interface: remove obsolete interfaces
Below are removed:
__DRI_FRAME_TRACKING
__DRI_TEX_OFFSET
__DRI_GET_DRAWABLE_INFO
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13387>
Jason Ekstrand [Fri, 15 Oct 2021 18:25:50 +0000 (13:25 -0500)]
nir/serialize: Pack deref modes better
With nir_var_image, we've now run out of bits in our packed blob for
deref instructions. We could revert to an unpacked blob or we could be
a bit more clever about how we encode deref modes and pack them into 5
bits.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>
Jason Ekstrand [Fri, 15 Oct 2021 18:04:45 +0000 (13:04 -0500)]
nir: Re-arrange the variable modes
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>
Jason Ekstrand [Fri, 15 Oct 2021 17:58:22 +0000 (12:58 -0500)]
nir: s/nir_var_mem_image/nir_var_image/g
We typically use nir_var_mem_* for stuff that has an explicit byte-based
memory layout. Images are opaque.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>
Dylan Baker [Wed, 13 Jan 2021 21:10:21 +0000 (13:10 -0800)]
meson: use gtest protocol for gtest based tests when possible
With the `gtest` protocol meson will add some extra arguments to the
test to generate better junit results, which may be useful. This
protocol is only available in meson 0.55.0+, so keep using the default
`exitcode` protocol for meson older than that.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8484>
Enrico Galli [Tue, 12 Oct 2021 18:31:27 +0000 (11:31 -0700)]
microsoft/compiler: Shadow tex instructions always use shadow samplers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13321>
Mike Blumenkrantz [Fri, 15 Oct 2021 20:01:52 +0000 (16:01 -0400)]
aux/pb: more correctly check number of reclaims
the increment needs to happen before the comparison here
Fixes:
3d6c8829f54 ("aux/pb: add a tolerance for reclaim failure")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13388>
Jason Ekstrand [Fri, 15 Oct 2021 17:46:58 +0000 (12:46 -0500)]
nir: Drop our attempt at typed-based image mode validation
This is broken for bindless images declared as local variables. It
turns out nir_variable::data::bindless is only used for uniforms and we
already assume anything in nir_var_function_temp or similar is bindless.
We could try to make a tricky assert but now that we have everything
else passing but now that we've got everyone converted the extra
validation probably isn't necessary.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13384>
Marcin Ślusarz [Wed, 13 Oct 2021 09:21:41 +0000 (11:21 +0200)]
intel: fix INTEL_DEBUG environment variable on 32-bit systems
INTEL_DEBUG is defined (since
4015e1876a77162e3444eeaa29a0dfbc47efe90e) as:
#define INTEL_DEBUG __builtin_expect(intel_debug, 0)
which unfortunately chops off upper 32 bits from intel_debug
on platforms where sizeof(long) != sizeof(uint64_t) because
__builtin_expect is defined only for the long type.
Fix this by changing the definition of INTEL_DEBUG to be function-like
macro with "flags" argument. New definition returns 0 or 1 when
any of the flags match.
Most of the changes in this commit were generated using:
for c in `git grep INTEL_DEBUG | grep "&" | grep -v i915 | awk -F: '{print $1}' | sort | uniq`; do
perl -pi -e "s/INTEL_DEBUG & ([A-Z0-9a-z_]+)/INTEL_DBG(\1)/" $c
perl -pi -e "s/INTEL_DEBUG & (\([A-Z0-9_ |]+\))/INTEL_DBG\1/" $c
done
but it didn't handle all cases and required minor cleanups (like removal
of round brackets which were not needed anymore).
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13334>
Mike Blumenkrantz [Fri, 15 Oct 2021 18:15:25 +0000 (14:15 -0400)]
virgl: remove unused pipebuffer include
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13385>
Mike Blumenkrantz [Wed, 13 Oct 2021 17:34:30 +0000 (13:34 -0400)]
aux/pb: add a tolerance for reclaim failure
originally, a slab attempts to reclaim a single bo. there are two outcomes
to this which can occur:
* the bo is reclaimed
* the bo is not reclaimed
if the bo is reclaimed, great.
if the bo is not reclaimed, it remains at the head of the list until it can
be reclaimed. this means that any bo with a "long" work queue which makes it
into a slab will effectively kill the entire slab. in a benchmarking scenario,
this can occur in rapid succession, and every slab will get 1-2 suballocations
before it reaches a bo that blocks long enough for a new slab to be needed.
the inevitable result of this scenario is that all memory is depleted almost instantly,
all because pb assumes that if the first bo in the reclaim list isn't ready, none of them
can be ready
for drivers like radeonsi, this happens to be a fine assumption
for drivers like zink, this is entirely not workable and explodes the gpu
Cc: mesa-stable
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13345>
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:27:53 +0000 (23:27 -0700)]
intel/compiler: Build all tests in a single binary
With gtest is possible to filter execution and run only a specific
test suite or individual test, so there's no particular reason here to
generate multiple binaries for the tests of a single module.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13303>
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:20:39 +0000 (23:20 -0700)]
intel/compiler: Rename vec4 test fixtures
Include vec4 in their names to avoid same names as the fs
counterparts. This will allow compiling all the tests together in the
future.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13303>
Rob Clark [Wed, 13 Oct 2021 22:53:55 +0000 (15:53 -0700)]
freedreno/isa: Add immed reg accessors
This way we can assert that a src that we expect to be an immediate
actually is.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Mon, 11 Oct 2021 18:50:03 +0000 (11:50 -0700)]
isaspec: Add bitfield size assertions
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Wed, 13 Oct 2021 17:55:16 +0000 (10:55 -0700)]
isaspec: Do not emit duplicate field encodes
If an <override> overrides the definition of a field, don't emit
encoding for both the override's definition and the fallback. (See
"SAMP" in #cat5-src3). It is harmless currently, because (in this
case) it will just re-encode the low bits of "SAMP". But when we
start asserting on that the field being encoded fits in the allowed
number of bits, the re-encoding of the fallback field definition
will start triggering asserts.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Tue, 12 Oct 2021 21:22:25 +0000 (14:22 -0700)]
isaspec: Fix derived field width
The low/high bit positions should be integers.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Wed, 13 Oct 2021 21:14:29 +0000 (14:14 -0700)]
freedreno/ir3: Don't lower s2en if samp/tex is too large
We only have four bits to encode an immediate samp/tex.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Tue, 12 Oct 2021 18:32:39 +0000 (11:32 -0700)]
freedreno/ir3/tests: Add additional disasm test vectors
Add branch with negative offset, and a couple others to trigger issues I
found while adding pack_field() overflow asserts.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Wed, 13 Oct 2021 18:11:28 +0000 (11:11 -0700)]
freedreno/ir3/tests: Fix indentation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Tue, 12 Oct 2021 17:23:18 +0000 (10:23 -0700)]
freedreno/isa: Fixes for validation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Rob Clark [Tue, 12 Oct 2021 17:57:24 +0000 (10:57 -0700)]
freedreno/ir3+isa: Cleanup bindless cat5 samp/tex encoding
Don't let the way they are encoded at the isa level leak thru to the
ir3 level.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
Jason Ekstrand [Fri, 1 Oct 2021 04:42:44 +0000 (23:42 -0500)]
ir3: Images are always nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jesse Natalie [Tue, 28 Sep 2021 19:13:30 +0000 (12:13 -0700)]
microsoft/clc: Images use nir_var_mem_image
The only big change is that lower_vars_to_explicit no longer assigns
a driver_location for images. That means that the storage for the
format/order loads is no longer implicitly "allocated" in the middle
of the kernel args. Instead, manually add the storage for that to the end
of the input args buffer.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 19:24:37 +0000 (14:24 -0500)]
nir/gl_nir_lower_images: Require nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 18:07:15 +0000 (13:07 -0500)]
intel/fs: Stop emitting TGM fences for nir_var_mem_ssbo
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:51:42 +0000 (11:51 -0500)]
aco: Split var_mem_image barrier handling from global/ssbo
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:39:12 +0000 (11:39 -0500)]
nir: Validate image variable modes
We can also significantly simplify the foreach_image_variable helper.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 20:27:49 +0000 (15:27 -0500)]
st/pbo: Use nir_var_mem_image for images
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Rhys Perry [Fri, 17 Sep 2021 13:22:06 +0000 (08:22 -0500)]
radv: Use nir_var_mem_image in meta shaders
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 20:26:17 +0000 (15:26 -0500)]
ttn: Use nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:41:09 +0000 (11:41 -0500)]
glsl: Use nir_var_mem_image for images
We don't use it for bindless images because the uniforms in that case
just contain a bindless handle and aren't an actual image. Bound
images, on the other hand, go in the nir_var_mem_image class.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Caio Marcelo de Oliveira Filho [Fri, 2 Jul 2021 08:01:45 +0000 (01:01 -0700)]
spirv: Use nir_var_mem_image
Use the new nir_var_mem_image mode for images that are not known to be
used with a sampler (i.e. storage images).
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Mon, 27 Sep 2021 21:43:23 +0000 (16:43 -0500)]
spirv: Assert that OpTypeForwardPointer only points to structs
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Fri, 1 Oct 2021 04:42:06 +0000 (23:42 -0500)]
ir3: Check for nir_var_mem_image in shared_barrier handling
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Thu, 30 Sep 2021 17:32:48 +0000 (12:32 -0500)]
zink: Images can live in nir_var_mem_image now
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Mon, 27 Sep 2021 22:11:12 +0000 (17:11 -0500)]
clover: Use nir_foreach_image_variable for images
This splits image and sampler handling into two separate loops.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Mon, 27 Sep 2021 23:42:20 +0000 (18:42 -0500)]
clover: Insert dummy uniform variables for images
Instead of making images have a well-defined size, insert a dummy
variable of the appropriate type which we can use for the parameter
block layout. This will work much better when we switch over to
nir_var_mem_image.
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Mon, 27 Sep 2021 22:08:20 +0000 (17:08 -0500)]
nir/lower_readonly_images_to_tex: Also rewrite variable modes
Storage images will start using nir_var_mem_image but sampled images
still use nir_var_uniform. If we're going to rewrite types, we need to
rewrite the modes as well. Otherwise, nir_validate will get grumpy and
drivers might get confused.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 29 Sep 2021 23:21:13 +0000 (18:21 -0500)]
llvmpipe: Support image variables living in nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 29 Sep 2021 23:20:46 +0000 (18:20 -0500)]
ntt: Separate image and sampler handling
Use nir_foreach_image_variable for images so we survive the coming
refactor where they get their own mode.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 21:53:44 +0000 (16:53 -0500)]
st/nir: Assign uniform locations to nir_var_mem_image vars
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 19:24:18 +0000 (14:24 -0500)]
nir/gl_nir_lower_images: Support nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 21:57:19 +0000 (16:57 -0500)]
nir/gl_nir_lower_samplers_as_deref: Support nir_var_mem_image
Contrary to the name of the pass, it also handles storage images so we
need to support nir_var_mem_image.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 19:29:15 +0000 (14:29 -0500)]
glsl/nir_linker: nir_var_mem_image is also a GL uniform
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:50:42 +0000 (11:50 -0500)]
aco: Add support for nir_var_mem_image
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:50:21 +0000 (11:50 -0500)]
amd/llvm/nir: Add support for nir_var_mem_image
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Caio Marcelo de Oliveira Filho [Fri, 25 Jun 2021 21:40:35 +0000 (14:40 -0700)]
anv: Use nir_foreach_image_variable
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:34:06 +0000 (11:34 -0500)]
i965/uniforms: Handle images as a separate pass
Instead of walking all uniforms and handling images as a special case,
walk "normal" uniforms first and images as a second pass. This lets us
use nir_foreach_image_variable which will survive the upcoming refactor.
While we're at it, use nir_foreach_image_variable in
brw_nir_lower_gl_images too.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Caio Marcelo de Oliveira Filho [Wed, 8 Jan 2020 22:48:17 +0000 (14:48 -0800)]
intel/fs: Consider nir_var_mem_image for TGM fences
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Jason Ekstrand [Wed, 15 Sep 2021 16:22:59 +0000 (11:22 -0500)]
nir: Add a nir_foreach_image_variable() iterator
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Caio Marcelo de Oliveira Filho [Wed, 8 Jan 2020 21:54:47 +0000 (13:54 -0800)]
nir: Add nir_var_mem_image
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Caio Marcelo de Oliveira Filho [Thu, 9 Jan 2020 18:37:48 +0000 (10:37 -0800)]
nir/schedule: Handle nir_intrisic_scoped_barrier
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
Rob Clark [Thu, 14 Oct 2021 18:36:46 +0000 (11:36 -0700)]
freedreno: Fix for large epilogues
Apparently Rocket League overflows the fixed size epilogue. Switch it
to be growable.
Closes: #5493
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13365>
Ella-0 [Sun, 10 Oct 2021 14:24:00 +0000 (14:24 +0000)]
v3dv: enable VK_KHR_swapchain_mutable_format
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13297>
Samuel Pitoiset [Wed, 13 Oct 2021 11:05:54 +0000 (13:05 +0200)]
aco: do not return an empty string when disassembly is not supported
Fixes dEQP-VK.pipeline.executable_properties.* on GFX6-7 when
clrxdisasm isn't found. Other generations are also affected if RADV
is built without LLVM.
Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13333>
Marcin Ślusarz [Thu, 14 Oct 2021 11:22:08 +0000 (13:22 +0200)]
iris: fix scratch address patching for TESS_EVAL stage
Scratch patching code in iris_upload_dirty_render_state (see MERGE_SCRATCH_ADDR
calls) assumes that in all shader stages derived_data field stores 3DSTATE_XS
packet first.
This is not true for TESS_EVAL (DS), so we end up patching 3DSTATE_TE
instead of 3DSTATE_DS leading to DWordLength becoming 11 instead of 9
(9 == 3DSTATE_DS.DWordLength, 2 == 3DSTATE_TE.DWordLength, and 9|2 == 11),
and hardware hanging on the next instruction.
Fix this by reversing the order of packets for TESS_EVAL stage.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5499
Fixes:
4256f7ed584 ("iris: Fill out scratch base address dynamically")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13358>
Dave Airlie [Wed, 15 Sep 2021 04:26:36 +0000 (14:26 +1000)]
crocus: Delete the MI_COPY_MEM_MEM resource_copy_region implementation.
(ported from iris - airlied)
The MI_COPY_MEM_MEM version of resource_copy_region has known bugs:
It's failing to set valid_buffer_range correctly
It's missing iris_emit_buffer_barrier_for() for the source/destination, so there may be missing flushes.
There are some bad interactions with the tile cache and VF using L3.
Even with those fixed, if you expand the "no more than 16 bytes" restriction to allow copies up to 1024 bytes, then it starts failing Piglit tests on Icelake.
We could probably fix this. However, I had originally only measured a 0.689096% +/- 0.473968% (n=4) speedup in Shadow of Mordor's OpenGL port, which is already fairly small, especially before adding missing flushes. Further, some of that likely came from not switching between render and compute...which we'll soon be able to avoid thanks to BLOCS.
Folks were also worried that MI_COPY_MEM_MEM can't be pipelined, and that stalling the command streamer may actually slow things down, especially as the GPUs become more powerful. We aren't really sure about this, but it's another concern.
So, let's just get rid of this optimization. It seemed like a good idea at the time, but it's just causing issues for very little gain.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13374>
Maniraj D [Mon, 11 Oct 2021 17:07:02 +0000 (22:37 +0530)]
egl: set TSD as NULL after deinit
When eglReleaseThread() is called from application's
destructor (API with __attribute__((destructor))),
it crashes due to invalid memory access.
In this case, _egl_TLS is freed in the flow of
_eglAtExit() as below but _egl_TLS is not set to NULL.
_eglDestroyThreadInfo
_eglFiniTSD
_eglAtExit
_run_exit_handlers
exit
Later when the eglReleaseThread is called from
application's destructor, it ends-up accessing
the freed _egl_TLS pointer.
eglReleaseThread -> in libEGL_mesa
eglReleaseThread -> in libEGL(glvnd)
destructor() -> App's destructor
To resolve the invalid access, setting the _egl_TLS
pointer as NULL after freeing it.
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5466
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13302>
Ella-0 [Tue, 12 Oct 2021 16:58:33 +0000 (16:58 +0000)]
v3dv: implement VK_EXT_host_query_reset
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13319>