platform/upstream/mesa.git
2 years agogallium/dri: add missing PIPE_BIND_DRI_PRIME handling
Pierre-Eric Pelloux-Prayer [Wed, 19 Jan 2022 10:32:22 +0000 (11:32 +0100)]
gallium/dri: add missing PIPE_BIND_DRI_PRIME handling

e9c3dbd0461 added PIPE_BIND_DRI_PRIME but it was only set when
importing a prime buffer.

This commit adds handling of this flag in the other codepath = the
one where the prime buffer is allocated by the render GPU.

With this change PIPE_BIND_DRI_PRIME is still only set for the
render GPU - the display GPU will never see this flag; a future
commit will rename it.

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

2 years agoci/iris: Mark qbo tests as flakes
Kenneth Graunke [Mon, 7 Feb 2022 21:33:40 +0000 (13:33 -0800)]
ci/iris: Mark qbo tests as flakes

These appear to have some kind of race condition and usually fail,
but sometimes pass.  We had already attempted to mark them as flakes
on amly, but need to mark them as flakes on KBL+ too.

See https://gitlab.freedesktop.org/mesa/mesa/-/jobs/18522605 and
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/18527737 where these
unexpectedly passed on KBL, and also where the top-level test not
being caught by the regex led to failures.

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

2 years agocrocus: Enable compat profile the same way as core profile
Zoltán Böszörményi [Sat, 5 Feb 2022 06:47:44 +0000 (07:47 +0100)]
crocus: Enable compat profile the same way as core profile

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11756>

2 years agoiris: Add support for flushing the blitter (hackily)
Kenneth Graunke [Fri, 4 Sep 2020 23:16:48 +0000 (16:16 -0700)]
iris: Add support for flushing the blitter (hackily)

To flush the blitter, we need to use MI_FLUSH_DW rather than the usual
PIPE_CONTROL we use on the 3D engine.  Most of our code is set up to
suggest flushes via PIPE_CONTROL commands, however, so we hackily just
emit MI_FLUSH_DW when they ask for any kind of PIPE_CONTROL flush.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>

2 years agoblorp: Assert that blorp_copy() on the blitter can handle it
Kenneth Graunke [Thu, 3 Feb 2022 04:15:47 +0000 (20:15 -0800)]
blorp: Assert that blorp_copy() on the blitter can handle it

Safeguards against callers that don't guarantee the necessary things.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>

2 years agointel/genxml: Add missing MI_FLUSH_DW::Flush CCS field
Kenneth Graunke [Mon, 24 Jan 2022 21:10:34 +0000 (13:10 -0800)]
intel/genxml: Add missing MI_FLUSH_DW::Flush CCS field

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>

2 years agoradv: fix R_02881C_PA_CL_VS_OUT_CNTL with mixed cull/clip distances
Rhys Perry [Fri, 4 Feb 2022 19:02:54 +0000 (19:02 +0000)]
radv: fix R_02881C_PA_CL_VS_OUT_CNTL with mixed cull/clip distances

Matches radeonsi.

Seems Vulkan CTS doesn't really test cull distances. Removing
VARYING_SLOT_CULL_DIST0/VARYING_SLOT_CULL_DIST1 variables doesn't break
any of dEQP-VK.clipping.*, except for tests which read the variables in
the fragment shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5984
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14882>

2 years agotu: Implement VK_AMD_buffer_marker to support Graphics Flight Recorder
Danylo Piliaiev [Wed, 27 Oct 2021 16:23:19 +0000 (19:23 +0300)]
tu: Implement VK_AMD_buffer_marker to support Graphics Flight Recorder

Graphics Flight Recorder is:
 "The Graphics Flight Recorder (GFR) is a Vulkan layer to help
  trackdown and identify the cause of GPU hangs and crashes.
  It works by instrumenting command buffers with completion tags."

This is a nice little tool which could help quickly identify the call
which hanged. Or if command buffer is executed for too long.

The tiling nature of our GPU shouldn't be a big issue aside from
lower performance.

For non-segfault case, if:
- Hang happens at the same place in cmdbuf and draw/dispatch is not
  finished at that point - it is likely that there is an infinite
  loop in some of the shaders in this draw.
- Hang happens always in different place - likely there is nothing
  wrong and command buffer just takes too long to execute and you
  should try increasing hangcheck_period_ms. If it doesn't help
  it is likely a synchronization issue.

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

2 years agoegl/wayland: Don't replace existing backbuffer in get_buffers
Daniel Stone [Fri, 4 Feb 2022 18:17:51 +0000 (18:17 +0000)]
egl/wayland: Don't replace existing backbuffer in get_buffers

If the surface already has a current backbuffer - say through a
buffer_age query - we do not want to replace it in get_buffers, because
it means the result we'd previously returned them is stale.

If we already have a backbuffer set on the surface, keep it locked in no
matter what until we hit SwapBuffers.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>

2 years agoegl/wayland: Reset buffer age when destroying buffers
Daniel Stone [Fri, 4 Feb 2022 10:42:19 +0000 (10:42 +0000)]
egl/wayland: Reset buffer age when destroying buffers

A buffer age of 0 means that the buffer is uninitialised or has unknown
content. We rely on the buffer age initially being 0 through zalloc when
the surface is first created; when they are first used for a swap, we
set their age to 1, and then we increment the age of every buffer in the
chain with a non-zero age when we swap.

Now that we can release buffers, both through dmabuf-feedback as well as
detecting when we're using a deeper swapchain than the compositor needs,
make sure to reset their age as they are released. Without doing this,
the age will stay as it was before it was released and be incremented,
returning the wrong age to the user the first time a previously-released
buffer slot has been reused.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5977
Fixes: 22d796feb828 ("egl/wayland: break double/tripple buffering feedback loops")
Fixes: b5848b2dac14 ("egl/wayland: use surface dma-buf feedback to allocate surface buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>

2 years agoci/iris: Add skips and flakes notes for recent #intel-ci logs.
Emma Anholt [Mon, 7 Feb 2022 03:53:45 +0000 (19:53 -0800)]
ci/iris: Add skips and flakes notes for recent #intel-ci logs.

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

2 years agoci/crocus: Add recent flakes from #intel-ci
Emma Anholt [Mon, 7 Feb 2022 03:49:12 +0000 (19:49 -0800)]
ci/crocus: Add recent flakes from #intel-ci

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

2 years agoci/softpipe,llvmpipe: Disable Xvfb server reset on piglit runs.
Emma Anholt [Mon, 7 Feb 2022 03:16:09 +0000 (19:16 -0800)]
ci/softpipe,llvmpipe: Disable Xvfb server reset on piglit runs.

The resets take time that we don't need to spend.

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

2 years agoRevert "radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets.""
Samuel Pitoiset [Wed, 19 Jan 2022 15:19:11 +0000 (16:19 +0100)]
Revert "radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets.""

The most famous RADV revert over the past months. This was an issue
in RADV and not an use-after-free (descriptor set layouts can be
destroyed almost at any time).

This reverts commit b775aaff1ec86f4ebd50867a045695da1fbeb2e1.

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

2 years agoradv: add reference counting for descriptor set layouts
Samuel Pitoiset [Wed, 19 Jan 2022 15:15:33 +0000 (16:15 +0100)]
radv: add reference counting for descriptor set layouts

The spec states that descriptor set layouts can be destroyed almost
at any time:

   "VkDescriptorSetLayout objects may be accessed by commands that
    operate on descriptor sets allocated using that layout, and those
    descriptor sets must not be updated with vkUpdateDescriptorSets
    after the descriptor set layout has been destroyed. Otherwise,
    descriptor set layouts can be destroyed any time they are not in
    use by an API command."

Based on ANV.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5893
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/14621>

2 years agocrocus: find correct relocation target for the bo.
Dave Airlie [Mon, 7 Feb 2022 06:19:15 +0000 (16:19 +1000)]
crocus: find correct relocation target for the bo.

If we have batch a + b, and writing to batch b, causes batch a
to flush, all the bo->index get reset, and we try to submit a -1
to the kernel.

Look the bo index up when creating relocations.

Fixes crash seen in KHR-GL46.compute_shader.pipeline-post-fs
and a trace from Wasteland 3

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14905>

2 years agocrocus: enable GL46 tests for HSW in ci
Zoltán Böszörményi [Sat, 5 Feb 2022 05:23:46 +0000 (06:23 +0100)]
crocus: enable GL46 tests for HSW in ci

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14889>

2 years agoasahi: Fix memory unsafety in delete_sampler_state
Alyssa Rosenzweig [Sun, 6 Feb 2022 20:44:35 +0000 (15:44 -0500)]
asahi: Fix memory unsafety in delete_sampler_state

The type is wrong, masked by a void*, meaning the free is completely
wrong. ASan is rightfully unhappy. Fixes crashes destroying the context.

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

2 years agoagx: Don't kill helper threads in ld_var
Alyssa Rosenzweig [Sun, 6 Feb 2022 14:43:48 +0000 (09:43 -0500)]
agx: Don't kill helper threads in ld_var

Apparently this is yet another .kill bit. Fixes:

dEQP-GLES3.functional.shaders.derivate.dfdx.linear.*
dEQP-GLES3.functional.shaders.derivate.dfdy.linear.*

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

2 years agoagx: Handle texture array indices
Alyssa Rosenzweig [Tue, 18 Jan 2022 19:14:55 +0000 (14:14 -0500)]
agx: Handle texture array indices

These need to be converted to integers.

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

2 years agoagx: Implement nir_op_txb
Alyssa Rosenzweig [Tue, 18 Jan 2022 14:48:36 +0000 (09:48 -0500)]
agx: Implement nir_op_txb

Like explicit LODs, biases must be 16-bit, so add a lowering rule for
this. With the LOD mode selection updated for txb, we can then ingest
biases like explicit LODs and allowlist txb. Passes:

dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2d_bias
dEQP-GLES2.functional.texture.mipmap.2d.bias.*

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

2 years agoagx: Translate LOD modes more generically
Alyssa Rosenzweig [Tue, 18 Jan 2022 14:48:13 +0000 (09:48 -0500)]
agx: Translate LOD modes more generically

Now includes support for auto_load_bias mode.

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

2 years agoagx: Add AUTO_LOD_BIAS mode
Alyssa Rosenzweig [Tue, 18 Jan 2022 14:47:44 +0000 (09:47 -0500)]
agx: Add AUTO_LOD_BIAS mode

Automatic load with a bias.

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

2 years agoasahi: Correctly set IOGPU_ATTACHMENT::size
Alyssa Rosenzweig [Wed, 19 Jan 2022 01:07:12 +0000 (20:07 -0500)]
asahi: Correctly set IOGPU_ATTACHMENT::size

Not sure what this is used for, but let's not lie to the kernel.

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

2 years agoasahi: Identify IOGPU_ATTACHMENT::size
Alyssa Rosenzweig [Wed, 19 Jan 2022 00:58:21 +0000 (19:58 -0500)]
asahi: Identify IOGPU_ATTACHMENT::size

Oops.

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

2 years agomesa: fix misaligned pointer returned by dlist_alloc
Charmaine Lee [Wed, 2 Feb 2022 23:12:12 +0000 (15:12 -0800)]
mesa: fix misaligned pointer returned by dlist_alloc

In cases where the to-be-allocated node size with padding exceeds BLOCK_SIZE
but without padding doesn't, a new block is not created and no padding is done
to the previous instruction, causing a misaligned pointer to be returned.

v2: Per Ilia Mirkin's suggestion, remove the extra condition in the first
    if statement, let it unconditionally pad the last instruction if needed.
    The updated currentPos will then be taken into account in the
    block size checking.

This fixes crash seen with lightsmark and Optuma apitraces

Fixes:  05605d7f537c4 (' mesa: remove display list OPCODE_NOP')

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Tested-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14871>

2 years agosvga: store shared_mem_size in svga_compute_shader instead of svga_context
Neha Bhende [Thu, 3 Feb 2022 22:48:09 +0000 (14:48 -0800)]
svga: store shared_mem_size in svga_compute_shader instead of svga_context

When new context was created, shared_mem_size was getting overwritten.
This fixes glretrace failure seen with manhattan, aztec and BASS2_intro
apitraces

Fixes: 247c61f2d0454a ('svga: Add support for compute shader, shader buffers and image views')

Tested with glretrace, piglit

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit dd6793ec9218782b1b716a87582d7219bae4e75f)

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

2 years agoanv: Increase maxUniformBufferRange to 2^30 when not using the sampler
Kenneth Graunke [Fri, 4 Feb 2022 09:13:52 +0000 (01:13 -0800)]
anv: Increase maxUniformBufferRange to 2^30 when not using the sampler

The limit here is from the RENDER_SURFACE_STATE height/width/depth
fields - it's 2^30 for ISL_FORMAT_RAW buffers, and 2^27 otherwise.

anv_isl_format_for_descriptor_type() uses ISL_FORMAT_R32G32B32A32_FLOAT
for uniform buffers when compiler->indirect_ubos_use_sampler is set
(Icelake and earlier), but ISL_FORMAT_RAW when it isn't (Tigerlake+).

So we can increase the limit on Tigerlake and later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14892>

2 years agor300: fix deadcode elimination in loops with breaks
Pavel Ondračka [Fri, 21 Jan 2022 13:08:33 +0000 (14:08 +0100)]
r300: fix deadcode elimination in loops with breaks

We are updating the deadcode state while walking the program backwards.
When encountering ENDLOOP, we scan the loop, mark everything in the loop
as used and than continue as usuall. We were previously trying to be
smart with the breaks. This was however not working as expected.

Instead, save the most pesimistic deadcode state from the ENDLOOP and
just restore it anytime we see a break.

This keeps the code simple and more importantly does not touch the flat
and IF(-ELSE)-ENDIF paths at all so reduces the chances of regression.
No changes with my shader-db.

Fixes piglits on RV530:
    shaders/ssa/fs-if-def-else-break.shader_test
    spec/glsl-1.10/execution/vs-loop-array-index-unroll.shader_test

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5832
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14661>

2 years agoanv: add dynamic rendering traces
Lionel Landwerlin [Sun, 30 Jan 2022 12:41:00 +0000 (14:41 +0200)]
anv: add dynamic rendering traces

v2: Get rid of subpass_count

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14798>

2 years agoanv: flush utrace before at device destroy
Lionel Landwerlin [Sun, 30 Jan 2022 12:40:19 +0000 (14:40 +0200)]
anv: flush utrace before at device destroy

Ensuring any remaining traces are displayed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14798>

2 years agozink: use scanout obj when returning resource param info
Mike Blumenkrantz [Fri, 4 Feb 2022 13:29:28 +0000 (08:29 -0500)]
zink: use scanout obj when returning resource param info

embarrassing typo since the base obj has no modifier data available

cc: mesa-stable

fixes #5980

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

2 years agopan/midg: Support 8/16 bit load/store
Boris Brezillon [Fri, 4 Jun 2021 12:44:56 +0000 (14:44 +0200)]
pan/midg: Support 8/16 bit load/store

Needed for panvk copy shaders to support 8 or 16bit formats.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Add a pass to lower non-logbase2 global/shared loads
Boris Brezillon [Wed, 9 Jun 2021 08:01:51 +0000 (10:01 +0200)]
pan/midg: Add a pass to lower non-logbase2 global/shared loads

Compute shaders might do vec3(Xbits) loads which are translated
to LD.<next_pow2(3 * X)> by the midgard compiler. This might cause
out-of-bound accesses potentially leading to pagefaults if the
access is at the end of a BO. One solution to avoid that (maybe not
the best) is to split non-log2 loads to make sure we only read what's
requested.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Fix swizzle packing on 64bit instructions with src-expansion + dst-shrinking
Boris Brezillon [Thu, 9 Sep 2021 08:38:20 +0000 (10:38 +0200)]
pan/midg: Fix swizzle packing on 64bit instructions with src-expansion + dst-shrinking

In that case, the mask is specified on 32bit lanes, so we need to shift
it if it's > 0x3. The expand modifier will take care of selecting the
right side of the 32bit vector.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Fix the upper/lower limit on 8bit vectors
Boris Brezillon [Thu, 9 Sep 2021 08:36:03 +0000 (10:36 +0200)]
pan/midg: Fix the upper/lower limit on 8bit vectors

If I'm correct, the lower/upper split on 8bit vectors is 8, not 4.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Fix 64-bit swizzle printer
Boris Brezillon [Thu, 9 Sep 2021 08:31:18 +0000 (10:31 +0200)]
pan/midg: Fix 64-bit swizzle printer

Swizzling happens in 2 steps on Midgard:

1. Vector expansion/shuffling
2. Swizzling at the instruction-size granularity, but defined using
   the source size. Those size are different if the source is expanded.

So, when we print 64 bit swizzles on an expanded source, we first need
to apply an offset if the high part of the 32bit vector was selected,
and then divide the result by 2 to account for vector expansion.

To sum-up, swizzling on midgard is complicated, and I'm not sure I got
it right, but it seems to print what I expect on the few compute
shaders using 64bit arithmetic I debugged.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Fix swizzling on 8-bit sources
Boris Brezillon [Mon, 6 Sep 2021 10:52:17 +0000 (12:52 +0200)]
pan/midg: Fix swizzling on 8-bit sources

Even though 8-bit ALUs are not supported, we can have [un]pack_32_4x8
instructions which translate to IMOVs, and those operate on 8-bit
vectors. The problem is, the swizzling granularity is 16 bit, which
means we don't support

      MOV.i8 R0.xyzw, TMP0.xxxx, R1.zyxw

and the compiler doesn't even complain, it just applies 8 bit
swizzling directly, which obviously doesn't work.

This is probably not the right way to fix that, but I thought I'd
raised the issue with a hack to fix, so we can get the discussion
started.

(Found while debugging FB store lowering on Midgard).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Prefix scalar immediates with '#' instead of '<'
Boris Brezillon [Mon, 6 Sep 2021 11:05:00 +0000 (13:05 +0200)]
pan/midg: Prefix scalar immediates with '#' instead of '<'

We already do that for scalar instructions, so let's do it for
vector instructions with a single component too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Remove spurious printf() in print_vector_constants()
Boris Brezillon [Fri, 3 Sep 2021 08:20:56 +0000 (10:20 +0200)]
pan/midg: Remove spurious printf() in print_vector_constants()

Also tried to replace that one by an fprintf(fp, ...), but it pollutes
the dump too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agopan/midg: Add intra-bundle interferences
Boris Brezillon [Mon, 6 Sep 2021 09:49:10 +0000 (11:49 +0200)]
pan/midg: Add intra-bundle interferences

The register allocator assumes instructions are executed sequentially
and allows one instruction to overwrite a portion of a register written
by a previous instruction if this portion is never used. But scalar and
vector ALUs might be executed in parallel if they are part of the same
bundle, and when such instructions write to the same portion of the
register file, the result is undefined.

Let's add intra-bundle interferences to avoid this situation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>

2 years agoturnip: Unconditionaly remove descriptor set from pool's list on free
Danylo Piliaiev [Thu, 3 Feb 2022 16:07:21 +0000 (18:07 +0200)]
turnip: Unconditionaly remove descriptor set from pool's list on free

We didn't remove desc set from the pool's list if pool was
host_memory_base. On the other hand in there is no point in removing
desc set from the list in DestroyDescriptorPool/ResetDescriptorPool.

Fixes: da7a4751
("turnip: Drop references to layout of all sets on pool reset/destruction")

Fixes cts tests:
 dEQP-VK.api.buffer_marker.graphics.default_mem.bottom_of_pipe.memory_dep.draw
 dEQP-VK.api.buffer_marker.graphics.default_mem.bottom_of_pipe.memory_dep.dispatch

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

2 years agodocs: Update d3d12 features
Jesse Natalie [Fri, 4 Feb 2022 19:24:05 +0000 (11:24 -0800)]
docs: Update d3d12 features

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: GL4.2
Jesse Natalie [Fri, 4 Feb 2022 02:05:49 +0000 (18:05 -0800)]
d3d12: GL4.2

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Allow RGB VS inputs without an alpha channel
Jesse Natalie [Fri, 4 Feb 2022 16:33:38 +0000 (08:33 -0800)]
d3d12: Allow RGB VS inputs without an alpha channel

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: When adding new output varyings, write 0s
Jesse Natalie [Fri, 4 Feb 2022 16:24:02 +0000 (08:24 -0800)]
d3d12: When adding new output varyings, write 0s

This avoids undefined behavior in some cases, and in the case
where the new output varying is actually a sysval like viewport
index, the DXIL validator will require it to be written.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Don't add arrayed VS outputs when next stage uses per-vertex inputs
Jesse Natalie [Fri, 4 Feb 2022 17:49:29 +0000 (09:49 -0800)]
d3d12: Don't add arrayed VS outputs when next stage uses per-vertex inputs

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Don't force a GS to be added for 'flat' sysvals
Jesse Natalie [Fri, 4 Feb 2022 16:23:42 +0000 (08:23 -0800)]
d3d12: Don't force a GS to be added for 'flat' sysvals

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Update nir varying bitmasks when linking stages
Jesse Natalie [Fri, 4 Feb 2022 16:22:08 +0000 (08:22 -0800)]
d3d12: Update nir varying bitmasks when linking stages

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Fix location compares in MSAA disable
Jesse Natalie [Fri, 4 Feb 2022 15:33:44 +0000 (07:33 -0800)]
d3d12: Fix location compares in MSAA disable

Locations can only be compared against SYSTEM_VALUE_* if the var
mode is system_value.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Update depth invert to deal with multi-viewport
Jesse Natalie [Fri, 4 Feb 2022 15:10:54 +0000 (07:10 -0800)]
d3d12: Update depth invert to deal with multi-viewport

Turn the context state and shader key into a bitmask. When lowering
the depth invert into the shader, scan for writes to viewport index.
If found, move position to the end of the function (or current vertex)
and check if the current viewport needs the depth invert before applying.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Fix linkage for viewport index
Jesse Natalie [Fri, 4 Feb 2022 15:10:23 +0000 (07:10 -0800)]
d3d12: Fix linkage for viewport index

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Bind 16 scissor rects when scissor disabled
Jesse Natalie [Fri, 4 Feb 2022 14:16:56 +0000 (06:16 -0800)]
d3d12: Bind 16 scissor rects when scissor disabled

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agod3d12: Enable BPTC (BC6/BC7)
Jesse Natalie [Fri, 4 Feb 2022 02:05:43 +0000 (18:05 -0800)]
d3d12: Enable BPTC (BC6/BC7)

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agomicrosoft/compiler: Set flag for VP/RT array index from VS/DS
Jesse Natalie [Fri, 4 Feb 2022 16:21:18 +0000 (08:21 -0800)]
microsoft/compiler: Set flag for VP/RT array index from VS/DS

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agomicrosoft/compiler: Handle SV_ViewportArrayIndex
Jesse Natalie [Fri, 4 Feb 2022 14:16:05 +0000 (06:16 -0800)]
microsoft/compiler: Handle SV_ViewportArrayIndex

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

2 years agozink: set needs_mesa_flush_wsi for venus
Chia-I Wu [Fri, 4 Feb 2022 07:55:34 +0000 (23:55 -0800)]
zink: set needs_mesa_flush_wsi for venus

venus relies on wsi_image_create_info and wsi_memory_signal_submit_info.

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

2 years agozink: always chain wsi_image_create_info for scanout images
Chia-I Wu [Fri, 4 Feb 2022 07:55:31 +0000 (23:55 -0800)]
zink: always chain wsi_image_create_info for scanout images

Chaining wsi_image_create_info tells the drivers that the image can use
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout.  We still use
wsi_image_create_info::scanout to indicate whether this is legacy
scanout or uses modifiers.

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

2 years agozink: set dma-buf bit for shared resources
Chia-I Wu [Fri, 4 Feb 2022 07:55:23 +0000 (23:55 -0800)]
zink: set dma-buf bit for shared resources

Set the dma-buf bit when supported.  This is done because
zink_resource_get_handle exports dma-bufs when WINSYS_HANDLE_TYPE_FD is
requested.

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

2 years agoagx: Call nir_lower_discard_if
Alyssa Rosenzweig [Thu, 16 Dec 2021 01:39:02 +0000 (20:39 -0500)]
agx: Call nir_lower_discard_if

We still need to implement discard itself, but this means we don't need
to worry about discard_if. This compiles down to the same idiom as
the vendor compiler (Metal) generates

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

2 years agonir,zink: Make lower_discard_if a common pass
Alyssa Rosenzweig [Tue, 14 Dec 2021 20:59:45 +0000 (15:59 -0500)]
nir,zink: Make lower_discard_if a common pass

This pass (lowering discard_if to control flow and unconditional
discard) was originally written for Zink, but is useful for hardware
that lacks conditional discard instructions like AGX. In theory AGX
could implement a conditional discard with CSEL, but the vendor
compiler uses a lowering like this one. Since I like not writing code,
I'd like to use the pass that's already in tree.

v2: Don't preserve dominance (Jason). Assert we don't see demotes or
terminates (Jason). Add Mike's ack.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14217>

2 years agoglx: Use the new no-error driver interface
Adam Jackson [Mon, 4 Oct 2021 21:53:52 +0000 (17:53 -0400)]
glx: Use the new no-error driver interface

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>

2 years agoegl: Use the new no-error driver interface
Adam Jackson [Mon, 4 Oct 2021 21:53:27 +0000 (17:53 -0400)]
egl: Use the new no-error driver interface

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>

2 years agodri: Epoch how no-error context creation works
Adam Jackson [Mon, 4 Oct 2021 21:46:46 +0000 (17:46 -0400)]
dri: Epoch how no-error context creation works

The bug here is that the DRI context "flags" are intended to alias the
GLX context flag values, and they don't, DRI's no-error flag is GLX's
reset-isolation flag. GLX (and EGL!) treat no-error as a context
attribute, and reset isolation predates Mesa's no-error implementation
by several years. The GL_KHR_no_error spec does describe it as a
"context flag", though, so maybe that's why we do it as a (DRI) context
flag.

In order to unalias these we need a new contract with the loader. We
remove the old __DRI_NO_ERROR extension, and add a new
__DRI_RENDERER_HAS_CONTEXT_NO_ERROR value to query. Loaders can key on
that to know to pass no-error-ness through as a context attribute,
matching the GLX/EGL calling convention. We go ahead and define
__DRI_CTX_FLAG_RESET_ISOLATION as well, and update the drivers to refuse
it since we don't support it yet.

This means mismatched drivers/loaders will not be able to create
no-error contexts. Too bad. If you want performance that badly you can
build both things at once.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>

2 years agomeson: add LIBGL_DRIVERS_PATH to the devenv
Dylan Baker [Tue, 1 Feb 2022 21:23:23 +0000 (13:23 -0800)]
meson: add LIBGL_DRIVERS_PATH to the devenv

This allows using built dri OpenGL drivers with the `meson devenv`
command

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

2 years agomeson: add support for `meson devenv` with vulkan
Dylan Baker [Tue, 1 Feb 2022 20:44:25 +0000 (12:44 -0800)]
meson: add support for `meson devenv` with vulkan

Meson devenv is a feature added in meson 0.58 (thus the features is
version guarded) that allows creating a shell environment with
environment variables automatically setup for running the project inside
the build dir. Some variables (such as LD_LIBRARY_PATH and PATH) are set
automatically, others must be added by the project.

For vulkan is is relativley simple, we create a new, uninstalled, icd
file for each driver and set the VK_ICD_FILENAMES variable
appropriately. This can be used with:

```sh
meson devenv -C $builddir
```

then, vulkan applications will automatically use the uninstall vulkan
driver, no need to install.

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

2 years agovulkan/util: simplify multialloc init
Erik Faye-Lund [Mon, 5 Jul 2021 13:02:34 +0000 (15:02 +0200)]
vulkan/util: simplify multialloc init

The syntax we're using doesn't work when included into C++ sources. So
let's make it C++ compabible.

It turns out, nobody needs this extra definition which is what's causing
issues. Let's just make the initializer trivial without casting the
struct.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>

2 years agovulkan/util: Add explicit casts to make c++ happy
Erik Faye-Lund [Fri, 4 Feb 2022 08:03:39 +0000 (09:03 +0100)]
vulkan/util: Add explicit casts to make c++ happy

We're about to need including this header from a C++ source, so let's
add some explicit casts for C++ compatibility.

In one case we can make things a bit cleaner by moving the
char-pointer-ism to the place that needs it, so let's clean that up
while we're at it.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>

2 years agovulkan/util: Add extern "C" to allow inclusion from c++
Erik Faye-Lund [Tue, 29 Jun 2021 12:38:14 +0000 (14:38 +0200)]
vulkan/util: Add extern "C" to allow inclusion from c++

We're about to need including this header from a C++ source, so let's
wrap the whole thing in extern "C".

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>

2 years agoturnip: Expose VK_KHR_shader_non_semantic_info
Danylo Piliaiev [Tue, 1 Feb 2022 17:37:35 +0000 (19:37 +0200)]
turnip: Expose VK_KHR_shader_non_semantic_info

This is entirely implemented in the SPIR-V frontend.

Relevant CTS tests:
dEQP-VK.spirv_assembly.instruction.compute.non_semantic_info.*

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

2 years agoturnip: Implement VK_KHR_zero_initialize_workgroup_memory
Danylo Piliaiev [Tue, 1 Feb 2022 17:30:53 +0000 (19:30 +0200)]
turnip: Implement VK_KHR_zero_initialize_workgroup_memory

Moved nir_lower_compute_system_values to lower
load_local_invocation_index which could be emitted by
nir_zero_initialize_shared_memory.

Relevant CTS tests:
dEQP-VK.compute.zero_initialize_workgroup_memory.*

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

2 years agoturnip: Expose VK_EXT_image_robustness
Danylo Piliaiev [Tue, 1 Feb 2022 15:30:15 +0000 (17:30 +0200)]
turnip: Expose VK_EXT_image_robustness

VK_EXT_image_robustness is a strict subset of VK_EXT_robustness2
so we could just expose it.

Relevant CTS tests: dEQP-VK.robustness.image_robustness.*

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

2 years agoturnip: Use the shared helpers to expose 1.3 core extensions/limits
Danylo Piliaiev [Tue, 1 Feb 2022 15:25:17 +0000 (17:25 +0200)]
turnip: Use the shared helpers to expose 1.3 core extensions/limits

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

2 years agoturnip/doc: Update turnip extension list
Danylo Piliaiev [Tue, 1 Feb 2022 17:51:40 +0000 (19:51 +0200)]
turnip/doc: Update turnip extension list

We were missing VK_EXT_subgroup_size_control and
VK_EXT_extended_dynamic_state2.

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

2 years agoiris: Make an iris_foreach_batch macro that skips unsupported batches
Kenneth Graunke [Fri, 28 Jan 2022 11:23:34 +0000 (03:23 -0800)]
iris: Make an iris_foreach_batch macro that skips unsupported batches

IRIS_BATCH_BLITTER isn't supported prior to Tigerlake; in general,
batches may not be supported on all hardware.  In most cases, querying
them is harmless (if useless): they reference nothing, have no commands
to flush, and so on.  However, the fence code does need to know that
certain batches don't exist, so it can avoid adding inter-batch fences
involving them.

This patch introduces a new iris_foreach_batch() iterator macro that
walks over all batches that are actually supported on the platform,
while skipping the others.  It provides a central place to update should
we add or reorder more batches in the future.

Fixes various tests in the piglit.spec.ext_external_objects.* category.

Thanks to Tapani Pälli for catching this.

Fixes: a90a1f15 ("iris: Create an IRIS_BATCH_BLITTER for using the BLT command streamer")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14834>

2 years agollvmpipe/triangle: don't store area in fixed_position.
Dave Airlie [Thu, 3 Feb 2022 04:18:40 +0000 (14:18 +1000)]
llvmpipe/triangle: don't store area in fixed_position.

It doesn't get used again, just extract the sign and move on.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>

2 years agollvmpipe: just move opaque alpha lookup closer to use.
Dave Airlie [Thu, 3 Feb 2022 02:58:45 +0000 (12:58 +1000)]
llvmpipe: just move opaque alpha lookup closer to use.

Saves looking this up before checking the variant.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>

2 years agollvmpipe: refactor lp_rast_shader_inputs.
Dave Airlie [Thu, 3 Feb 2022 02:52:30 +0000 (12:52 +1000)]
llvmpipe: refactor lp_rast_shader_inputs.

viewport_index won't be >= 16
layer should be < 2048
view_index should be < 2048

this leaves the last 64-bits as padding, which something
expects, but not having to write to it means we have to write
less memory every triangle.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>

2 years agollvmpipe/setup: remove opaque from setup triangle
Dave Airlie [Thu, 3 Feb 2022 02:46:35 +0000 (12:46 +1000)]
llvmpipe/setup: remove opaque from setup triangle

This isn't used in the rast side of things, so just pass it out here.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>

2 years agollvmpipe: inline retry_triangle_ccw
Dave Airlie [Thu, 3 Feb 2022 04:54:31 +0000 (14:54 +1000)]
llvmpipe: inline retry_triangle_ccw

This reduces some of the overheads in the callstack here.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>

2 years agollvmpipe: optimise triangle setup a bit.
Dave Airlie [Wed, 2 Feb 2022 07:39:38 +0000 (17:39 +1000)]
llvmpipe: optimise triangle setup a bit.

the bboxpos = bbox copy was visible overhead on perf traces,
but we don't need to really do it.

Extract all the things from bbox needed early, then don't copy
it just overwrite it.

use boolean to fix power build.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>

2 years agoturnip: Do not use hw binning if tiles per pipe are over the limit
Danylo Piliaiev [Thu, 3 Feb 2022 12:04:01 +0000 (14:04 +0200)]
turnip: Do not use hw binning if tiles per pipe are over the limit

Otherwise GPU would hang.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5951

Freedreno commit as a reference:
39d00722b22a0059bbc58f0158a22f384519cd39

Fixes VK cts tests on a618 if their memory limit is raised to 1024 MB:
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_d16_unorm
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_d24_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_d32_sfloat_s8_uint
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm_d16_unorm
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm_d24_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.cube_array.huge.width_height.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.core.cube_array.huge.width_height.r8g8b8a8_unorm_d24_unorm_s8_uint

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Tested-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14849>

2 years agoturnip: Add TU_GMEM envvar to test different gmem sizes
Danylo Piliaiev [Thu, 3 Feb 2022 12:03:22 +0000 (14:03 +0200)]
turnip: Add TU_GMEM envvar to test different gmem sizes

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

2 years agovenus: Advertise VK_EXT_extended_dynamic_state support
Omar Akkila [Fri, 28 Jan 2022 06:20:19 +0000 (01:20 -0500)]
venus: Advertise VK_EXT_extended_dynamic_state support

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14866>

2 years agovenus: Implement VK_EXT_extended_dynamic_state commands
Omar Akkila [Fri, 28 Jan 2022 06:21:49 +0000 (01:21 -0500)]
venus: Implement VK_EXT_extended_dynamic_state commands

This implements hooks for the following commands:

- vkCmdBindVertexBuffers2
- vkCmdSetCullMode
- vkCmdSetDepthBoundsTestEnable
- vkCmdSetDepthCompareOp
- vkCmdSetDepthTestEnable
- vkCmdSetDepthWriteEnable
- vkCmdSetFrontFace
- vkCmdSetPrimitiveTopology
- vkCmdSetScissorWithCount
- vkCmdSetStencilOp
- vkCmdSetStencilTestEnable
- vkCmdSetViewportWithCount

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14866>

2 years agodocs: Update d3d12 features
Jesse Natalie [Wed, 2 Feb 2022 21:03:09 +0000 (13:03 -0800)]
docs: Update d3d12 features

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: ARB_gpu_shader_fp64
Jesse Natalie [Fri, 28 Jan 2022 19:54:15 +0000 (11:54 -0800)]
d3d12: ARB_gpu_shader_fp64

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Handle structs in TCS variants
Jesse Natalie [Wed, 2 Feb 2022 14:26:02 +0000 (06:26 -0800)]
d3d12: Handle structs in TCS variants

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Handle structs in GS variants
Jesse Natalie [Wed, 2 Feb 2022 14:23:47 +0000 (06:23 -0800)]
d3d12: Handle structs in GS variants

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Set lower full fp64 compiler options flag when needed
Jesse Natalie [Fri, 28 Jan 2022 20:55:29 +0000 (12:55 -0800)]
d3d12: Set lower full fp64 compiler options flag when needed

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Lower [de]construction of doubles via math ops into pack/unpack ops
Jesse Natalie [Fri, 28 Jan 2022 20:55:10 +0000 (12:55 -0800)]
d3d12: Lower [de]construction of doubles via math ops into pack/unpack ops

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Add int64 support
Jesse Natalie [Fri, 28 Jan 2022 23:14:04 +0000 (15:14 -0800)]
d3d12: Add int64 support

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Get OPTIONS1
Jesse Natalie [Fri, 28 Jan 2022 23:13:05 +0000 (15:13 -0800)]
d3d12: Get OPTIONS1

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Add a driver version to the screen to be used for workarounds
Jesse Natalie [Fri, 28 Jan 2022 23:12:35 +0000 (15:12 -0800)]
d3d12: Add a driver version to the screen to be used for workarounds

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Cache a modifyable copy of the nir options in d3d12_screen
Jesse Natalie [Fri, 28 Jan 2022 20:37:23 +0000 (12:37 -0800)]
d3d12: Cache a modifyable copy of the nir options in d3d12_screen

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Use the right constant for GS varying limits
Jesse Natalie [Sat, 29 Jan 2022 17:35:14 +0000 (09:35 -0800)]
d3d12: Use the right constant for GS varying limits

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Use a constant define for max anisotropy
Jesse Natalie [Tue, 1 Feb 2022 17:35:34 +0000 (09:35 -0800)]
d3d12: Use a constant define for max anisotropy

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agod3d12: Update max input, output, and varying caps
Jesse Natalie [Tue, 1 Feb 2022 17:30:11 +0000 (09:30 -0800)]
d3d12: Update max input, output, and varying caps

The simple-varyings piglit test attempts to use GL_MAX_VARYING_FLOATS
varyings, PLUS one additional vector for position (which is not used
as input to the PS). "Reserve" that additional position vector by
removing it from the max varyings and max PS inputs.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agomicrosoft/compiler: Handle structs in I/O signatures
Jesse Natalie [Wed, 2 Feb 2022 13:43:21 +0000 (05:43 -0800)]
microsoft/compiler: Handle structs in I/O signatures

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>

2 years agomicrosoft/compiler: Map I/O base locations to input IDs
Jesse Natalie [Tue, 1 Feb 2022 22:37:29 +0000 (14:37 -0800)]
microsoft/compiler: Map I/O base locations to input IDs

When dealing with a vertex input that takes multiple rows, the value of
nir_intrinsic_base points to a driver-location-based index, but we need
to emit a location-based index (or more specifically, an index that
increments once per input, not once per register). Add a mapping to
the module of base -> ID.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>