Commit Graph

134855 Commits

Author SHA1 Message Date
Samuel Pitoiset 9d79bb24b4 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>
2021-02-11 09:29:31 +00:00
Samuel Pitoiset c7e6f4ff3d 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>
2021-02-11 09:29:31 +00:00
Erik Faye-Lund 72709c2bce 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>
2021-02-11 08:42:12 +00:00
Michel Dänzer 4b4bddcd99 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>
2021-02-11 08:26:38 +00:00
Dave Airlie 452a37e634 llvmpipe: enable GL spir-v support
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8972>
2021-02-11 07:32:02 +00:00
Dave Airlie 14b2dc0013 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>
2021-02-11 14:20:22 +10:00
Mike Blumenkrantz a29e7c0784 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>
2021-02-11 00:04:19 +00:00
Dave Airlie 8ed874d73f 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>
2021-02-11 08:36:07 +10:00
Dave Airlie c10b785490 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>
2021-02-11 08:34:35 +10:00
Dave Airlie 2937f69cc0 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>
2021-02-11 08:34:05 +10:00
Adam Jackson acaf07c24b 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>
2021-02-10 21:10:04 +00:00
Adam Jackson 88ca480c8b osmesa: Pacify MSVC in the test code
Not smart enough to think this is const, eh.

Fixes: mesa/mesa#4119
Fixes: c5c1aa7c75 ("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>
2021-02-10 20:54:55 +00:00
Nanley Chery fbacd8a99c 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 9bd092736c 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>
2021-02-10 20:48:01 +00:00
Nanley Chery cfa38e5a99 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>
2021-02-10 20:48:01 +00:00
Nanley Chery f2a2ee3193 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 0079b8543a 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 7170479475 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 0e03fe19e5 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 767fd868a0 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 62831815e6 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>
2021-02-10 20:48:01 +00:00
Nanley Chery a0908d0c91 iris: Drop a stale comment about HiZ sampling
With commit 7339660e80, this comment is no
longer needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8853>
2021-02-10 20:48:01 +00:00
Nanley Chery becefe5a69 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>
2021-02-10 20:48:01 +00:00
Nanley Chery 4c6882c090 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>
2021-02-10 20:48:01 +00:00
Nanley Chery f961cf2047 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>
2021-02-10 20:48:01 +00:00
Adam Jackson f2573760b4 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>
2021-02-10 20:31:42 +00:00
Mike Blumenkrantz f88d9c9d7c 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>
2021-02-10 20:20:38 +00:00
Erik Faye-Lund 329b26ab76 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>
2021-02-10 20:42:02 +01:00
Michel Zou aea36ee05e 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>
2021-02-10 18:19:43 +00:00
Alyssa Rosenzweig 60cd7ff7f7 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: 77933d16d8 ("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>
2021-02-10 18:08:11 +00:00
Alyssa Rosenzweig 214e7de909 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>
2021-02-10 18:08:11 +00:00
Michel Zou e487ae1b99 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>
2021-02-10 17:10:50 +00:00
Erik Faye-Lund 7ea69f40d8 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>
2021-02-10 17:29:18 +01:00
Erik Faye-Lund ef36de243c 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>
2021-02-10 17:14:02 +01:00
Pierre-Eric Pelloux-Prayer c7725ad4aa 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: ccf9ef3628 ("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>
2021-02-10 16:36:06 +01:00
Mike Blumenkrantz d81087a700 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>
2021-02-10 14:21:01 +00:00
Mike Blumenkrantz 79dd0562f4 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>
2021-02-10 14:21:01 +00:00
Mike Blumenkrantz ce230f15e4 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>
2021-02-10 14:21:01 +00:00
Lionel Landwerlin 0b69e8b16f 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>
2021-02-10 15:55:52 +02:00
Mike Blumenkrantz b20e08fadd 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>
2021-02-10 13:28:10 +00:00
Mike Blumenkrantz e388fae898 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>
2021-02-10 13:28:10 +00:00
Mike Blumenkrantz 564bb1410c 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>
2021-02-10 13:28:10 +00:00
Mike Blumenkrantz b92ba0100e 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>
2021-02-10 13:28:10 +00:00
Mike Blumenkrantz 4a7a226e49 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>
2021-02-10 13:28:10 +00:00
Mike Blumenkrantz 152916b2bb 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>
2021-02-10 13:28:10 +00:00
Iago Toral Quiroga bd0ef080d0 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>
2021-02-10 13:18:25 +00:00
Mike Blumenkrantz 79fcea9475 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>
2021-02-10 13:12:12 +00:00
Mike Blumenkrantz 802c1afe9c 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>
2021-02-10 13:05:45 +00:00
Mike Blumenkrantz efbd3584e3 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>
2021-02-10 12:59:37 +00:00
Danylo Piliaiev f0a76b2067 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>
2021-02-10 12:38:44 +00:00