platform/upstream/mesa.git
3 years agoradv: adjust an error message related to the SQTT buffer size
Samuel Pitoiset [Wed, 10 Feb 2021 13:29:14 +0000 (14:29 +0100)]
radv: adjust an error message related to the SQTT buffer size

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/8960>

3 years agoradv: do not overallocate the SQTT buffer
Samuel Pitoiset [Wed, 10 Feb 2021 13:27:24 +0000 (14:27 +0100)]
radv: do not overallocate the SQTT buffer

The total size is computed for all available SEs which is not always 4.

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/8960>

3 years agoci: document arm oddity in build-rules
Erik Faye-Lund [Wed, 10 Feb 2021 18:19:35 +0000 (19:19 +0100)]
ci: document arm oddity in build-rules

There's an oddity in the .lava-test:amd64 build rules; we depend on and
use the ARM images instead of the AMD64 images. The reason for this is
kind of silly; we need the Docker image to match the architecture of the
runner, which happens to be ARM.

So this isn't at all about the target architecture, but more of a Docker
detail.

Hopefully documenting this will prevent others from spending time being
puzzled about this in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8967>

3 years agoci: Restrict meson-gallium job to gstreamer runners
Michel Dänzer [Wed, 10 Feb 2021 17:27:41 +0000 (18:27 +0100)]
ci: Restrict meson-gallium job to gstreamer runners

The i965_asm tests are randomly timing out. I've been able to find such
timeouts only on packet runners. This change should have either of these
results:

* The timeouts actually don't happen on gstreamer runners. There will
  be no more spurious pipeline failures due to them for the time being,
  and we'll know the timeouts are due to some kind of packet runner
  specific issue.

* The timeouts happen on gstreamer runners as well. We'll know they're
  not caused by a packet runner specific issue.

Win-win.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8966>

3 years agollvmpipe: enable GL spir-v support
Dave Airlie [Mon, 6 Jul 2020 04:55:48 +0000 (14:55 +1000)]
llvmpipe: enable GL spir-v support

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8972>

3 years agoglsl: fix leak in gl_nir_link_uniform_blocks
Dave Airlie [Thu, 11 Feb 2021 03:42:09 +0000 (13:42 +1000)]
glsl: fix leak in gl_nir_link_uniform_blocks

asan on llvmpipe with piglit tests/spec/arb_gl_spirv/execution/ssbo/array-indirect.shader_test
reported.

=================================================================
==3288325==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f5b2d6513cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
    #1 0x7f5b2a1ae810 in ralloc_size ../src/util/ralloc.c:133
    #2 0x7f5b2a1ae7e1 in ralloc_context ../src/util/ralloc.c:120
    #3 0x7f5b2b210177 in gl_nir_link_uniform_blocks ../src/compiler/glsl/gl_nir_link_uniform_blocks.c:585
    #4 0x7f5b2af7f52d in gl_nir_link_spirv ../src/compiler/glsl/gl_nir_linker.c:614
    #5 0x7f5b2a3b76fa in st_link_nir ../src/mesa/state_tracker/st_glsl_to_nir.cpp:765
    #6 0x7f5b2a3ace7b in st_link_shader ../src/mesa/state_tracker/st_glsl_to_ir.cpp:65
    #7 0x7f5b2a471165 in _mesa_glsl_link_shader ../src/mesa/program/ir_to_mesa.cpp:3122
    #8 0x7f5b2a97a6d8 in link_program ../src/mesa/main/shaderapi.c:1311
    #9 0x7f5b2a97a6d8 in link_program_error ../src/mesa/main/shaderapi.c:1419
    #10 0x7f5b2a97df45 in _mesa_LinkProgram ../src/mesa/main/shaderapi.c:1911
    #11 0x7f5b299b59e5 in stub_glLinkProgram /mnt/devel/gl/piglit/tests/util/piglit-dispatch-gen.c:33956
    #12 0x40a71a in link_and_use_shaders /mnt/devel/gl/piglit/tests/shaders/shader_runner.c:1604
    #13 0x415722 in init_test /mnt/devel/gl/piglit/tests/shaders/shader_runner.c:5225
    #14 0x4164ce in piglit_init /mnt/devel/gl/piglit/tests/shaders/shader_runner.c:5597
    #15 0x7f5b29a214e9 in run_test /mnt/devel/gl/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:73
    #16 0x7f5b29a103fe in piglit_gl_test_run /mnt/devel/gl/piglit/tests/util/piglit-framework-gl.c:229
    #17 0x407847 in main /mnt/devel/gl/piglit/tests/shaders/shader_runner.c:72
    #18 0x7f5b2928f1e1 in __libc_start_main (/lib64/libc.so.6+0x281e1)

SUMMARY: AddressSanitizer: 48 byte(s) leaked in 1 allocation(s).

Fixes: 57239192 ("nir/linker: add gl_nir_link_uniform_blocks.c")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8974>

3 years agozink: handle nir_intrinsic_load_helper_invocation
Mike Blumenkrantz [Thu, 20 Aug 2020 20:16:04 +0000 (16:16 -0400)]
zink: handle nir_intrinsic_load_helper_invocation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8949>

3 years agolavapipe: reset shader constant buffers after execution
Dave Airlie [Mon, 8 Feb 2021 07:31:36 +0000 (17:31 +1000)]
lavapipe: reset shader constant buffers after execution

Otherwise this leads to a use-after-free
dEQP-VK.synchronization.op.single_queue.fence.write_fill_buffer_read_ssbo_vertex.buffer_16384
when run after any test using a ubo in the fragment shader.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8912>

3 years agollvmpipe: fix use after free with fs variant cleanup
Dave Airlie [Mon, 8 Feb 2021 06:52:57 +0000 (16:52 +1000)]
llvmpipe: fix use after free with fs variant cleanup

item->base will be freed for the NULL reference write
so just use a temporary to avoid it.

This was found with asan and lavapipe:
dEQP-VK.api.copy_and_blit.core.blit_image*

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8912>

3 years agollvmpipe: add a mutex around debug resource tracking
Dave Airlie [Mon, 8 Feb 2021 06:10:26 +0000 (16:10 +1000)]
llvmpipe: add a mutex around debug resource tracking

The debug resource tracking triggers an asan warning, add a mutex
around it to avoid multi-thread failures with vulkan CTS test:

dEQP-VK.api.object_management.multithreaded_per_thread_device.buffer_uniform_small

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8912>

3 years agoglx: Fix GLX_SGI_video_sync for the no-current-drawable case
Adam Jackson [Mon, 16 Nov 2020 18:24:23 +0000 (13:24 -0500)]
glx: Fix GLX_SGI_video_sync for the no-current-drawable case

Starting with GL 3.0 it's legal to have no drawable bound to the current
context. GLX_SGI_video_sync doesn't take a drawable for an argument so
it implicitly operates on... something. NVIDIA's driver throws
GLX_BAD_CONTEXT for GetVideoSync, but WaitVideoSync seems to actually
wait for the next MSC on the context's screen. We could work around this
by internally creating/destroying a GLXWindow for the root window, but
for Xwayland there's not necessarily a good answer it can return.

Just throw GLX_BAD_CONTEXT for both.

Fixes: mesa/mesa#1207
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8334>

3 years agoosmesa: Pacify MSVC in the test code
Adam Jackson [Wed, 27 Jan 2021 19:23:17 +0000 (14:23 -0500)]
osmesa: Pacify MSVC in the test code

Not smart enough to think this is const, eh.

Fixes: mesa/mesa#4119
Fixes: c5c1aa7c75c05927017325829cb3f354654d0b73 ("gallium/osmesa: Fix flushing and Y-flipping of the depth buffer.")
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8936>

3 years agoiris: Call iris_sample_with_depth_aux earlier
Nanley Chery [Wed, 11 Nov 2020 16:04:53 +0000 (08:04 -0800)]
iris: Call iris_sample_with_depth_aux earlier

Instead of calling iris_sample_with_depth_aux right before a sample
operation, call it at resource creation time. Unifies the code which
ensures that it's okay to sample with HiZ.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Drop iris_resource::aux::has_hiz
Nanley Chery [Mon, 14 Dec 2020 19:36:29 +0000 (11:36 -0800)]
iris: Drop iris_resource::aux::has_hiz

Instead of storing a bitfield of which resource levels will be accessed
with HiZ, compute this information on-demand. Makes the iris_resource
struct more generic.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Don't avoid aux state getter/setter with HiZ
Nanley Chery [Wed, 16 Dec 2020 01:08:17 +0000 (17:08 -0800)]
iris: Don't avoid aux state getter/setter with HiZ

Before this commit, various functions avoided calling
iris_resource_get_aux_state and iris_resource_set_aux_state for depth
buffers which lacked full HiZ support at certain levels. This was
because:

 1. Some callers of prepare/finish neglected to use ISL_AUX_USAGE_NONE
    for the levels which lacked full HiZ support.
 2. The assertions within the getter and setter were too strict.

Now that both of these issues have been resolved, there's no obvious
reason to try to avoid these function calls. Delete the code for
avoiding them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Loosen aux state getter/setter assert on HiZ
Nanley Chery [Wed, 16 Dec 2020 00:38:52 +0000 (16:38 -0800)]
iris: Loosen aux state getter/setter assert on HiZ

The aux state getter and setter currently assert
iris_resource_level_has_hiz() for depth surfaces.

This assertion is too strict however. In some cases where the assert
would fail, we can still correctly describe the aux state with the ISL
enums (using ISL_AUX_STATE_AUX_INVALID, for example).

When HiZ is enabled on a resource but disabled for a given level, allow
the getter to be called and allow the setter to set aux states that lack
compression. Enables code simplifications later on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Fix aux usage of depth buffer prepare/finish
Nanley Chery [Wed, 16 Dec 2020 22:57:14 +0000 (14:57 -0800)]
iris: Fix aux usage of depth buffer prepare/finish

Prepare/finish a framebuffer's depth buffer with the aux usage that's
appropriate for the given miplevel instead of wrongly assuming that
compression is always enabled. Enables code simplifications later on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Keep aux_usage in iris_blorp_surf_for_resource
Nanley Chery [Mon, 14 Dec 2020 19:10:02 +0000 (11:10 -0800)]
iris: Keep aux_usage in iris_blorp_surf_for_resource

Avoid the surprising behavior of overriding the aux usage for depth
resources.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Fix the depth aspect aux usage in iris_blit
Nanley Chery [Thu, 17 Dec 2020 22:41:19 +0000 (14:41 -0800)]
iris: Fix the depth aspect aux usage in iris_blit

Set dst_aux_usage to ISL_AUX_USAGE_NONE for the depth buffer blit if the
level doesn't fully support HiZ. Enables removing the code that masked
this issue later on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Drop batch param from iris_resource_prepare_render
Nanley Chery [Thu, 17 Dec 2020 23:05:51 +0000 (15:05 -0800)]
iris: Drop batch param from iris_resource_prepare_render

Drop an unused parameter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Delete redundant assertion in iris_hiz_exec
Nanley Chery [Tue, 15 Dec 2020 05:29:00 +0000 (21:29 -0800)]
iris: Delete redundant assertion in iris_hiz_exec

There's an iris_resource_level_has_hiz assert at the top of the
function. Also, aux surfaces are allocated in the same BO as main
surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Drop a stale comment about HiZ sampling
Nanley Chery [Thu, 19 Nov 2020 22:36:03 +0000 (14:36 -0800)]
iris: Drop a stale comment about HiZ sampling

With commit 7339660e80331ed773fc6dbb8295384d4ef6954e, this comment is no
longer needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoiris: Drop an XXX comment about sampling HiZ arrays
Nanley Chery [Fri, 13 Nov 2020 00:59:12 +0000 (16:59 -0800)]
iris: Drop an XXX comment about sampling HiZ arrays

Contrary to the comment, i965 doesn't disable sampling with HiZ on 2D
arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoi965,iris: Delete misleading HiZ sampling comments
Nanley Chery [Fri, 13 Nov 2020 14:50:55 +0000 (06:50 -0800)]
i965,iris: Delete misleading HiZ sampling comments

One comment seems to suggest that MCS (which is needed for compressed
multisampling) can be used to sample from a multisampled depth buffer.
This is not the case. Multisampled depth buffers are sampled without an
auxiliary surface.

Another comment seems to suggest that some depth buffers don't have
corresponding levels in their HiZ buffers. Each main slice *should* have
a corresponding aux slice, but not all of these slices have equal
support for HiZ ops (e.g. ambiguates aren't really supported on
non-8x4-aligned slices).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agoblorp: Assert 8x4 alignment for a HiZ op on Gen8-9
Nanley Chery [Mon, 14 Dec 2020 23:03:26 +0000 (15:03 -0800)]
blorp: Assert 8x4 alignment for a HiZ op on Gen8-9

On BDW and SKL, assert that render target dimensions are 8x4-aligned
when performing HiZ ambiguates on LOD1+. Testing indicates that the
assertion should hold in order to achieve consistent/correct ambiguate
operations on gen9.

v2. Account for the relaxed restrictions on ICL+. (Ken)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3788
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>

3 years agozink: Factor out instance setup a bit more
Adam Jackson [Wed, 16 Dec 2020 22:44:50 +0000 (17:44 -0500)]
zink: Factor out instance setup a bit more

The VkInstance is really display state not screen state, as is the
loader version. Factor this out a bit further so that
zink_create_instance fills in a zink_instance_info. The latter struct
still lives in the zink_screen for now but that'll move soon.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8968>

3 years agozink: use better mapping for PIPE_FORMAT_X24S8_UINT
Mike Blumenkrantz [Wed, 10 Feb 2021 14:47:57 +0000 (09:47 -0500)]
zink: use better mapping for PIPE_FORMAT_X24S8_UINT

this needs to be unconditionally supported in some way, and it also
needs to use a more compatible fallback format if the base format is unavailable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8959>

3 years agolavapipe: report correct value for minMemoryMapAlignment
Erik Faye-Lund [Wed, 10 Feb 2021 17:07:39 +0000 (18:07 +0100)]
lavapipe: report correct value for minMemoryMapAlignment

The vulkan spec says the following about vkMapMemory:

"ppData is a pointer to a void * variable in which is returned a
 host-accessible pointer to the beginning of the mapped range. This
 pointer minus offset must be aligned to at least
 VkPhysicalDeviceLimits::minMemoryMapAlignment."

So let's report the same value as the gallium-driver reports, otherwise
we'll fail to adhere to the alignment requirement.

This fixes a few Piglit failures for Zink.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4267
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8965>

3 years agozink: Fix win32 build
Michel Zou [Wed, 10 Feb 2021 13:27:52 +0000 (14:27 +0100)]
zink: Fix win32 build

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8957>

3 years agopan/bi: Fix 2-write pseudo op scheduling
Alyssa Rosenzweig [Wed, 10 Feb 2021 00:46:40 +0000 (19:46 -0500)]
pan/bi: Fix 2-write pseudo op scheduling

These cannot schedule to the last tuple, there needs to be other work in
the last clause, or a tuple of NOP's failing that. Can occur depending
on scheduling of CUBEFACE instructions, and will apply to computational
atomics in the near future.

Fixes: 77933d16d8c ("pan/bi: Switch to new scheduler")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8962>

3 years agopan/bi: Fix 'last tuple' for terminal-NOP clauses
Alyssa Rosenzweig [Wed, 10 Feb 2021 00:45:03 +0000 (19:45 -0500)]
pan/bi: Fix 'last tuple' for terminal-NOP clauses

This incorrectly assumed the last tuple was nontrivial, an invariant
that holds by accident on the current scheduler but will break
momentarily. Fix this, and document the invariants.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8962>

3 years agovulkan: Fix windows api conflict
Michel Zou [Wed, 10 Feb 2021 13:25:38 +0000 (14:25 +0100)]
vulkan: Fix windows api conflict

Closes #4247

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8956>

3 years agoci: run piglit on zink with lavapipe
Erik Faye-Lund [Wed, 2 Dec 2020 20:28:19 +0000 (21:28 +0100)]
ci: run piglit on zink with lavapipe

Now that we can run on top of Lavapipe, we can finally start testing
Piglit on top of Zink in CI, yay!

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8879>

3 years agoci: make sure all lava-builders have libvulkan
Erik Faye-Lund [Tue, 9 Feb 2021 17:28:17 +0000 (18:28 +0100)]
ci: make sure all lava-builders have libvulkan

In the next commit, we'll start building Zink in the meson-testing step,
and because mega-drivers end up stuffing all dependencies in the same
shared-object, we end up requiring libvulkan for other drivers as well.

So let's no longer track separately who needs vulkan and who doesn't,
and just always install it.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8879>

3 years agogallium/u_upload_mgr: lower risk of hitting an assert
Pierre-Eric Pelloux-Prayer [Fri, 5 Feb 2021 14:31:19 +0000 (15:31 +0100)]
gallium/u_upload_mgr: lower risk of hitting an assert

The assert(size < INT32_MAX / 2) can be triggered by large uploads.

Since we know that the caller of u_upload_alloc_buffer will consume
min_size bytes, we can init buffer_private_refcount to a much smaller
value.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: ccf9ef36285 ("gallium/u_upload_mgr: eliminate all atomics for the upload buffer")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4235
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8880>

3 years agozink: handle null xfb buffers
Mike Blumenkrantz [Fri, 14 Aug 2020 21:38:44 +0000 (17:38 -0400)]
zink: handle null xfb buffers

ARB_enhanced_layouts allows specifying explicit locations for xfb buffers,
which means we get arrays of buffers with gaps in the middle sometimes and
have to throw in a null handle

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8943>

3 years agozink: create dummy xfb buffer
Mike Blumenkrantz [Fri, 9 Oct 2020 15:13:57 +0000 (11:13 -0400)]
zink: create dummy xfb buffer

xfb spec disallows binding a null buffer, so we need something to throw in

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8943>

3 years agozink: rename zink_context::dummy_buffer -> dummy_vertex_buffer
Mike Blumenkrantz [Fri, 9 Oct 2020 15:11:43 +0000 (11:11 -0400)]
zink: rename zink_context::dummy_buffer -> dummy_vertex_buffer

this is a bit more specific

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8943>

3 years agoanv: print out perf permission warning only once
Lionel Landwerlin [Wed, 10 Feb 2021 10:25:49 +0000 (12:25 +0200)]
anv: print out perf permission warning only once

This warning is bothering a number of people and rightfully so.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8955>

3 years agozink: enable PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Mike Blumenkrantz [Thu, 13 Aug 2020 14:55:13 +0000 (10:55 -0400)]
zink: enable PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

3 years agozink: flush all resources with persistent maps on work batch before draw/compute
Mike Blumenkrantz [Thu, 13 Aug 2020 14:54:25 +0000 (10:54 -0400)]
zink: flush all resources with persistent maps on work batch before draw/compute

these require explicit memory sync on our part

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

3 years agozink: slightly refactor batch resource referencing in update_descriptors()
Mike Blumenkrantz [Mon, 21 Sep 2020 13:16:33 +0000 (09:16 -0400)]
zink: slightly refactor batch resource referencing in update_descriptors()

this is easier to debug

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

3 years agozink: track persistent, non-coherent, writable transfer map count for resources
Mike Blumenkrantz [Thu, 13 Aug 2020 14:53:25 +0000 (10:53 -0400)]
zink: track persistent, non-coherent, writable transfer map count for resources

these require explicit memory flushes before being submitted to a batch

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

3 years agozink: set HOST_COHERENT bit for coherent resource creation
Mike Blumenkrantz [Thu, 13 Aug 2020 14:24:46 +0000 (10:24 -0400)]
zink: set HOST_COHERENT bit for coherent resource creation

this allows memory to be mapped during draws without requiring a flush

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

3 years agozink: use = and not |= for VkMemoryPropertyFlags during resource creation
Mike Blumenkrantz [Thu, 13 Aug 2020 14:23:24 +0000 (10:23 -0400)]
zink: use = and not |= for VkMemoryPropertyFlags during resource creation

the previous value of this isn't used, so be explicit here

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

3 years agov3d/compiler: fix QPU scheduler TMU sequence shuffling
Iago Toral Quiroga [Wed, 10 Feb 2021 07:34:05 +0000 (08:34 +0100)]
v3d/compiler: fix QPU scheduler TMU sequence shuffling

The QPU scheduler allows to move certain TMU instructions around and
since we enabled pipelining, we need to protect against the case where
doing this might break a TMU sequence. For example, this test:

dEQP-VK.rasterization.line_continuity.line-strip

Was generating this VIR:

mov tmud, t187
mov.pushz null, t176
mov.ifa tmua, t9
nop null; wrtmuc (img[0].p0 | 0x0)
mov tmut, t185
mov tmud, t180
mov.ifa tmusf, t183
nop null; thrsw

where we have a general TMU access (tmud,tmua) followed by an image
access (wrtmuc, tmut, tmud, tmusf), which the QPU scheduler was turning
into:

nop            ; nop               ; ldunifrf.rf22 (0xffffff00 / -nan)
nop            ; nop               ; wrtmuc (img[0].p0 | 0x0)
nop            ; nop               ; ldtmu.r2
add  r0, r2, 1 ; nop               ; ldtmu.r3
nop            ; nop               ; ldtmu.r4
nop            ; mov  tmud, r0
nop            ; mov.ifa  tmua, rf15
nop            ; mov  tmut, r4     ; thrsw
nop            ; mov  tmud, rf22
nop            ; mov.ifa  tmusf, r3

where it allowed the wrtmuc to move up and before the general TMU access,
leading to an incorrect TMU sequence.

Fix this by flagging TMUA writes (which are the sequence terminators for
general TMU accessess) as writing new TMU configuration, like we do for all
other TMU sequence terminators for textures and images.

Fixes: 197090a3fc ('broadcom/compiler: implement pipelining for general TMU operations')

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8954>

3 years agozink: add a texture barrier hook
Mike Blumenkrantz [Tue, 18 Aug 2020 21:12:27 +0000 (17:12 -0400)]
zink: add a texture barrier hook

this just flushes all the pending batches, which is enough since we
do our batch work synchronously and everything is awful

will be reworked when this is no longer the case

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8948>

3 years agozink: handle nir_texop_texture_samples
Mike Blumenkrantz [Tue, 18 Aug 2020 21:00:48 +0000 (17:00 -0400)]
zink: handle nir_texop_texture_samples

this is just a SpvOpImageQuerySamples

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8947>

3 years agozink: rework viewport handling
Mike Blumenkrantz [Tue, 18 Aug 2020 19:07:18 +0000 (15:07 -0400)]
zink: rework viewport handling

viewport can be transformed at draw time based on clip_halfz, so we actually
want to do the conversion from gallium->vulkan at that time

as a nice bonus, we get to delete a struct member

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8946>

3 years agoturnip: enable inheritedQueries
Danylo Piliaiev [Mon, 1 Feb 2021 19:02:00 +0000 (21:02 +0200)]
turnip: enable inheritedQueries

Passes relevant CTS tests.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8824>

3 years agoradv: fix memory leaks if a submission fails
Samuel Pitoiset [Tue, 9 Feb 2021 14:29:50 +0000 (15:29 +0100)]
radv: fix memory leaks if a submission fails

If the device isn't lost, the application might want to re-submit.

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/8931>

3 years agozink: handle vote intrinsics in ntv
Mike Blumenkrantz [Wed, 19 Aug 2020 18:32:30 +0000 (14:32 -0400)]
zink: handle vote intrinsics in ntv

these are super simple and straightforward

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8950>

3 years agozink: add spirv_builder wrapper for vote intrinsics
Mike Blumenkrantz [Wed, 19 Aug 2020 18:19:11 +0000 (14:19 -0400)]
zink: add spirv_builder wrapper for vote intrinsics

these are all going to use the same mechanics, so we can simplify a bit

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8950>

3 years agoci: Add trailing slash to path for documentation preview
Michel Dänzer [Wed, 10 Feb 2021 11:20:25 +0000 (12:20 +0100)]
ci: Add trailing slash to path for documentation preview

Fixes the documentation preview link on the MR Overview tab. Found by
comparing with the same thing in weston.

(It still appears only after all jobs in the pipeline have at least
started once though)

Fixes: ae8f9584f4c9 "CI: always expose docs artifacts"
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8927>

3 years agov3dv: support for depthBiasClamp
Alejandro Piñeiro [Tue, 9 Feb 2021 12:12:03 +0000 (13:12 +0100)]
v3dv: support for depthBiasClamp

Gets tests like the following working:
dEQP-VK.dynamic_state.rs_state.depth_bias_clamp

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8928>

3 years agoaco: fix adjust_vertex_fetch_alpha
Rhys Perry [Tue, 9 Feb 2021 21:33:43 +0000 (21:33 +0000)]
aco: fix adjust_vertex_fetch_alpha

These offsets were wrong and didn't match the old behaviour.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: e8220e106bf ("aco: optimize AC_FETCH_FORMAT_SNORM alpha adjust")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8935>

3 years agoradv: stop allocating useless ESGS scratch BO on GFX10+
Samuel Pitoiset [Tue, 9 Feb 2021 09:48:53 +0000 (10:48 +0100)]
radv: stop allocating useless ESGS scratch BO on GFX10+

On GFX10+, the ESGS ring is allocated in LDS. This saves one BO
when geometry shaders are used, and possibly two BOs if nothing
else (tess, scratch, etc) is used.

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/8926>

3 years agoradv: fix double free when creating a fence failed
Samuel Pitoiset [Tue, 9 Feb 2021 22:13:15 +0000 (23:13 +0100)]
radv: fix double free when creating a fence failed

It's already freed in radv_destroy_fence().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8938>

3 years agogallium: Document behavior of more lowering pipe caps.
Eric Anholt [Wed, 20 Jan 2021 23:48:53 +0000 (15:48 -0800)]
gallium: Document behavior of more lowering pipe caps.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agov3d: Stop advertising support for flat shading.
Eric Anholt [Wed, 20 Jan 2021 21:22:23 +0000 (13:22 -0800)]
v3d: Stop advertising support for flat shading.

The GL frontend can lower this weird GL feature away for us.  This should
fix redeclaration of the gl_Color/SecondaryColor as centroid, since that
case had been missed in the !flat special case here.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agov3d: Stop advertising support for PIPE_CAP_*_COLOR_CLAMPED.
Eric Anholt [Wed, 20 Jan 2021 21:05:59 +0000 (13:05 -0800)]
v3d: Stop advertising support for PIPE_CAP_*_COLOR_CLAMPED.

The GL frontend can lower away this deprecated GL feature for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agov3d: Stop advertising support for PIPE_CAP_TWO_SIDED_COLOR.
Eric Anholt [Wed, 20 Jan 2021 20:55:44 +0000 (12:55 -0800)]
v3d: Stop advertising support for PIPE_CAP_TWO_SIDED_COLOR.

The GL frontend can lower away this deprecated GL feature for us.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agov3d: Clean up vestiges of alpha test lowering.
Eric Anholt [Wed, 20 Jan 2021 20:33:49 +0000 (12:33 -0800)]
v3d: Clean up vestiges of alpha test lowering.

We had an unnecessary case in our uniforms upload switch statement, since
we no longer advertise the cap.

Fixes: 8ad931808e2d ("v3d: do not report alpha-test as supported")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agovc4: Stop advertising support for VS color clamping.
Eric Anholt [Wed, 20 Jan 2021 20:21:12 +0000 (12:21 -0800)]
vc4: Stop advertising support for VS color clamping.

This is special GL behavior that the frontend is now able to handle for
us.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agovc4: Stop advertising support for PIPE_CAP_TWO_SIDED_COLOR.
Eric Anholt [Wed, 20 Jan 2021 20:13:55 +0000 (12:13 -0800)]
vc4: Stop advertising support for PIPE_CAP_TWO_SIDED_COLOR.

The GL frontend is perfectly able to handle this for us.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agovc4: Remove vestiges of alpha test lowering.
Eric Anholt [Wed, 20 Jan 2021 20:07:54 +0000 (12:07 -0800)]
vc4: Remove vestiges of alpha test lowering.

We stopped reporting the alpha test screen cap, and stopped using the
value in the key, so now shrink the key.  This gets another switch case
out of the hot uniforms upload path.

Fixes: 1404b8b1e5b6 ("vc4: do not report alpha-test as supported")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agomesa/st: Assume that the default variant is always first in the list.
Eric Anholt [Wed, 20 Jan 2021 20:01:50 +0000 (12:01 -0800)]
mesa/st: Assume that the default variant is always first in the list.

Since we always precompile now, we can remove some checks for presence of
the first variant or for it being the wrong key.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agomesa/st: Always precompile the first shader variant.
Eric Anholt [Wed, 20 Jan 2021 19:55:12 +0000 (11:55 -0800)]
mesa/st: Always precompile the first shader variant.

Every driver wants the chance to see the default variant of the shader in
the hopes of avoiding draw-time shader compiles, even if they have some
NOS compiled into the shader by st/mesa.  Before, every driver had to
avoid st/mesa lowering options to get this behavior, even if they would
like to have the shared lowering code, and some drivers were just missing
the behavior because nobody had debugged that it was missing yet.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

3 years agofreedreno/a5xx: Don't forget to count our custom blits against queries.
Eric Anholt [Fri, 29 Jan 2021 00:50:34 +0000 (16:50 -0800)]
freedreno/a5xx: Don't forget to count our custom blits against queries.

Noticed when comparing the a5xx and a6xx paths.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8873>

3 years agofreedreno: Remove FD_STAGE_* in favor of a "disable_all" flag.
Eric Anholt [Thu, 28 Jan 2021 21:29:15 +0000 (13:29 -0800)]
freedreno: Remove FD_STAGE_* in favor of a "disable_all" flag.

The only paths are "prepare queries for rendering" and "finish all
queries", everything else is handled by set_active_query_state().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8873>

3 years agofreedreno: Force updating active queries on batch reordering.
Eric Anholt [Thu, 28 Jan 2021 23:40:35 +0000 (15:40 -0800)]
freedreno: Force updating active queries on batch reordering.

The state of queries for the batch we've just switched to may not reflect
the current active flag, so make sure that we update at the start of the
next draw.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8873>

3 years agoci/virgl: Fix GLES31 testing on desktop GL.
Eric Anholt [Thu, 4 Feb 2021 00:38:04 +0000 (16:38 -0800)]
ci/virgl: Fix GLES31 testing on desktop GL.

The version overrides leaked into the virglrenderer server, breaking
compiling of all sorts of shaders.  We already get GLES3.1 when running
virgl on llvmpipe GL without doing any overrides.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8854>

3 years agofeatures: mark off GL 4.3 for zink
Mike Blumenkrantz [Wed, 10 Feb 2021 00:26:47 +0000 (19:26 -0500)]
features: mark off GL 4.3 for zink

\o/

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8941>

3 years agozink: GLSL 430
Mike Blumenkrantz [Wed, 12 Aug 2020 19:23:23 +0000 (15:23 -0400)]
zink: GLSL 430

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8941>

3 years agozink: enable compute
Mike Blumenkrantz [Wed, 12 Aug 2020 21:03:15 +0000 (17:03 -0400)]
zink: enable compute

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: export compute-specific shader/compute caps
Mike Blumenkrantz [Wed, 12 Aug 2020 21:02:42 +0000 (17:02 -0400)]
zink: export compute-specific shader/compute caps

this doesn't enable the compute cap itself, it just handles all the other
caps

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: add launch_grid pipe_context hook for compute handling
Mike Blumenkrantz [Wed, 12 Aug 2020 21:01:42 +0000 (17:01 -0400)]
zink: add launch_grid pipe_context hook for compute handling

we're reusing update_descriptors, so this is trivial

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: flush gfx/compute batches when the other pipeline needs resource sync
Mike Blumenkrantz [Wed, 12 Aug 2020 21:00:09 +0000 (17:00 -0400)]
zink: flush gfx/compute batches when the other pipeline needs resource sync

if compute or gfx use a resource which is already in use by the other pipeline,
we need to ensure tha we flush that pipeline now in order to have commands execute
in the expected order

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: handle descriptor set updates for compute operations
Mike Blumenkrantz [Wed, 12 Aug 2020 20:58:57 +0000 (16:58 -0400)]
zink: handle descriptor set updates for compute operations

this is almost identical, the difference being that we need to explicitly
use the compute batch/program in a few places

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: handle memory barriers for compute batch
Mike Blumenkrantz [Wed, 12 Aug 2020 20:56:35 +0000 (16:56 -0400)]
zink: handle memory barriers for compute batch

this is a bit different since the regular functions cycle the gfx batch
array, but the compute batch isn't in an array

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: setup compute batch and add handling
Mike Blumenkrantz [Wed, 12 Aug 2020 20:55:36 +0000 (16:55 -0400)]
zink: setup compute batch and add handling

this is separate to the gfx batch array,
so we need separate struct members in zink_context for it

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: break out descriptor updating into separate function
Mike Blumenkrantz [Wed, 12 Aug 2020 20:47:03 +0000 (16:47 -0400)]
zink: break out descriptor updating into separate function

this is a massive block of code that we need to reuse for compute shaders
because we absolutely don't want to be copying it around

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: add compute programs and pipelines
Mike Blumenkrantz [Wed, 12 Aug 2020 20:37:46 +0000 (16:37 -0400)]
zink: add compute programs and pipelines

these are similar to the gfx variants, but mostly smaller

some things are implemented as placeholders for now to make the code
similar to gfx programs/pipelines and thus easier to read/review

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: rename pipeline_cache_entry -> gfx_pipeline_cache_entry
Mike Blumenkrantz [Thu, 26 Nov 2020 17:50:07 +0000 (12:50 -0500)]
zink: rename pipeline_cache_entry -> gfx_pipeline_cache_entry

prep for compute pipelines

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: explicitly get shader stage from shader during binding setup in draw
Mike Blumenkrantz [Wed, 12 Aug 2020 20:25:12 +0000 (16:25 -0400)]
zink: explicitly get shader stage from shader during binding setup in draw

the iterator matches the shader stage currently, but this won't always be the
case

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: make allocate_descriptor_set() take more params instead of a gfx_program
Mike Blumenkrantz [Wed, 12 Aug 2020 20:21:25 +0000 (16:21 -0400)]
zink: make allocate_descriptor_set() take more params instead of a gfx_program

this makes the function reusable between different types of programs

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: refactor batch creation
Mike Blumenkrantz [Wed, 12 Aug 2020 20:15:59 +0000 (16:15 -0400)]
zink: refactor batch creation

by moving this into its own function, we can reuse it for creating a compute
batch, which will not be part of the gfx batch array

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: take a pipe_reference param in zink_batch_reference_program
Mike Blumenkrantz [Wed, 12 Aug 2020 20:11:02 +0000 (16:11 -0400)]
zink: take a pipe_reference param in zink_batch_reference_program

this lets us reuse the function for gfx and compute programs without much
churn, since in C we can use a pointer to the first member of a struct and
a pointer to the struct interchangeably

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: ignore compute batch when starting/ending batches
Mike Blumenkrantz [Wed, 12 Aug 2020 20:04:07 +0000 (16:04 -0400)]
zink: ignore compute batch when starting/ending batches

compute batches don't have queries

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: handle nir_intrinsic_memory_barrier_shared in ntv
Mike Blumenkrantz [Wed, 12 Aug 2020 20:03:31 +0000 (16:03 -0400)]
zink: handle nir_intrinsic_memory_barrier_shared in ntv

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: add handling for shared atomic ops in ntv
Mike Blumenkrantz [Wed, 12 Aug 2020 19:57:53 +0000 (15:57 -0400)]
zink: add handling for shared atomic ops in ntv

these are mostly the same as ssbo except they use the shared block variable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: implement shared load/store nir ops in ntv
Mike Blumenkrantz [Wed, 12 Aug 2020 19:57:17 +0000 (15:57 -0400)]
zink: implement shared load/store nir ops in ntv

these access the data in the shared block variable at an offset

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: handle COMPUTE glsl variables
Mike Blumenkrantz [Wed, 12 Aug 2020 19:56:03 +0000 (15:56 -0400)]
zink: handle COMPUTE glsl variables

we can just use existing helpers for these

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: handle COMPUTE setup in ntv
Mike Blumenkrantz [Wed, 12 Aug 2020 19:54:48 +0000 (15:54 -0400)]
zink: handle COMPUTE setup in ntv

addressing mode, shared block, and execution modes all need to be handled
here

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: handle COMPUTE bindings in compiler/ntv
Mike Blumenkrantz [Wed, 12 Aug 2020 19:53:40 +0000 (15:53 -0400)]
zink: handle COMPUTE bindings in compiler/ntv

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: add spirv_builder function for emitting a 3word literal exec mode
Mike Blumenkrantz [Wed, 12 Aug 2020 18:24:57 +0000 (14:24 -0400)]
zink: add spirv_builder function for emitting a 3word literal exec mode

used by compute

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: wait on compute batch when necessary during transfer map
Mike Blumenkrantz [Tue, 11 Aug 2020 22:39:25 +0000 (18:39 -0400)]
zink: wait on compute batch when necessary during transfer map

now that we have the capability to wait on specific batches, we can
check whether we need to sync with the compute queue here before trying
to map resources

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: make zink_batch_reference_resource_rw return usage info
Mike Blumenkrantz [Tue, 11 Aug 2020 22:32:44 +0000 (18:32 -0400)]
zink: make zink_batch_reference_resource_rw return usage info

now this provides some info regarding which batches need to be flushed,
allowing gfx batches and compute batches to share resources

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: make get_resource_usage() public
Mike Blumenkrantz [Tue, 11 Aug 2020 22:36:15 +0000 (18:36 -0400)]
zink: make get_resource_usage() public

also cover compute batch id (still not yet used)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>

3 years agozink: bump resource usage flags to allow 5 batches
Mike Blumenkrantz [Tue, 11 Aug 2020 22:35:15 +0000 (18:35 -0400)]
zink: bump resource usage flags to allow 5 batches

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>