platform/upstream/mesa.git
2 years agoac/spm: setup write broadcasting correctly
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 11:43:39 +0000 (13:43 +0200)]
ac/spm: setup write broadcasting correctly

Based on PAL's PerfExperiment::BuildGrbmGfxIndex method.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agoradeonsi: make sure profile_peak is used before using sqtt
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 08:23:40 +0000 (10:23 +0200)]
radeonsi: make sure profile_peak is used before using sqtt

Using sqtt without this profile can cause hangs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agoradeonsi/sqtt: enable spm counters on gfx10+
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 12:37:01 +0000 (14:37 +0200)]
radeonsi/sqtt: enable spm counters on gfx10+

Tested on:
  - navi10: L0 cache counter doesn't work (always 0)
  - sienna_cichlid: L0 doesn't work (always 0) and L1 isn't visible in RGP

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agoradeonsi/sqtt: setup spm bo
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 12:36:26 +0000 (14:36 +0200)]
radeonsi/sqtt: setup spm bo

The hardware will write SPM counters to this bo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agoradeonsi: add spm counters setup code
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 12:30:53 +0000 (14:30 +0200)]
radeonsi: add spm counters setup code

Based on radv_spm.c and PAL.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agoradeonsi: add helpers to deal with spm counters
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 12:14:34 +0000 (14:14 +0200)]
radeonsi: add helpers to deal with spm counters

Based on radv_perfcounter.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agoradeonsi: make si_pc_emit_shaders non static
Pierre-Eric Pelloux-Prayer [Tue, 29 Mar 2022 12:13:30 +0000 (14:13 +0200)]
radeonsi: make si_pc_emit_shaders non static

Also pass "cs" as a param to allow updating a specific cs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15646>

2 years agodzn: Add KHR_draw_indirect_count support
Boris Brezillon [Thu, 7 Apr 2022 13:49:00 +0000 (06:49 -0700)]
dzn: Add KHR_draw_indirect_count support

Unfortunately it's not as simple as passing the indirect draw count
buffer to ExecuteIndirect. The compute job that populate the execute
buffer also needs to know the number of entries that need to be
patched. Instead of transitioning the indirect count buffer from
GENERIC_READ to INDIRECT_ARGUMENT we just keep at as a read-only
resource and copy the draw_count value to the exec buffer in the
compute job.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15914>

2 years agodzn: Allow multiDrawIndirect and drawIndirectFirstInstance
Boris Brezillon [Wed, 6 Apr 2022 16:25:54 +0000 (18:25 +0200)]
dzn: Allow multiDrawIndirect and drawIndirectFirstInstance

Those are already supported, let's just toggle the switch.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15914>

2 years agov3dv: duplicate key on hashtable insert
Juan A. Suarez Romero [Thu, 21 Apr 2022 14:26:39 +0000 (16:26 +0200)]
v3dv: duplicate key on hashtable insert

The key is created on stack, so as soon as the function returns this key
is lost, so the inserted key in the hashtable is invalid.

Rather, insert a duplicated version on heap.

This fixes a stack-buffer-overflow when running some Vulkan CTS tests.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16083>

2 years agogallium: move get_canonical_format hook to pipe_screen
Juan A. Suarez Romero [Thu, 21 Apr 2022 07:49:07 +0000 (09:49 +0200)]
gallium: move get_canonical_format hook to pipe_screen

pipe_context shouldn't have functions that return values because this
prevent multithreading.

Move this hook to pipe_screen.

Fixes: 606e42027e6 ("gallium: add hook on getting canonical format")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16078>

2 years agodzn: Get rid of the render pass logic
Boris Brezillon [Wed, 20 Apr 2022 09:45:33 +0000 (02:45 -0700)]
dzn: Get rid of the render pass logic

The core provides generic render-pass -> dynamic-rendering wrappers,
so let's rely on them instead of implementing our own logic.

Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>

2 years agodzn: Add support for dynamic rendering
Boris Brezillon [Tue, 12 Apr 2022 13:01:10 +0000 (15:01 +0200)]
dzn: Add support for dynamic rendering

This is how D3D12 works, so nothing really complicated here. We just
add a bunch of states to the render state, patch the pipeline building
logic to support dynamic rendering, and add new functions to

Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>

2 years agodzn: Inline dzn_cmd_buffer_clear_attachments()
Boris Brezillon [Wed, 20 Apr 2022 08:56:44 +0000 (10:56 +0200)]
dzn: Inline dzn_cmd_buffer_clear_attachments()

It's only called from dzn_CmdClearAttachments(), so let's move the
code there.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>

2 years agodzn: Move all render-related states to a substruct
Boris Brezillon [Wed, 20 Apr 2022 08:36:10 +0000 (01:36 -0700)]
dzn: Move all render-related states to a substruct

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>

2 years agodzn: Set MAX_RTS to D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT
Boris Brezillon [Wed, 20 Apr 2022 08:23:58 +0000 (10:23 +0200)]
dzn: Set MAX_RTS to D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT

D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT == 8, so no functional change
here, it's just cleaner to use the D3D12 definition.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>

2 years agodzn: Pass an image view to dzn_cmd_buffer_clear_attachment()
Boris Brezillon [Wed, 20 Apr 2022 08:12:06 +0000 (10:12 +0200)]
dzn: Pass an image view to dzn_cmd_buffer_clear_attachment()

Let the caller extract the image view from the attachment index, so
we can make this function framebuffer-agnostic and re-use it in the
dynamic rendering path.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15913>

2 years agodzn: Advertise KHR_shader_draw_parameters
Boris Brezillon [Wed, 6 Apr 2022 16:25:20 +0000 (18:25 +0200)]
dzn: Advertise KHR_shader_draw_parameters

We already pass those parameters to shaders, so let's advertise the
feature.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>

2 years agodzn: Update the draw_id sysval when issuing indirect draws
Boris Brezillon [Wed, 6 Apr 2022 16:23:37 +0000 (18:23 +0200)]
dzn: Update the draw_id sysval when issuing indirect draws

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>

2 years agodzn: Simplify the triangle_fan_rewrite_index shader
Boris Brezillon [Wed, 6 Apr 2022 15:30:33 +0000 (17:30 +0200)]
dzn: Simplify the triangle_fan_rewrite_index shader

We don't need the first_vertex argument when turning non-indexed
triangle-fan draws into indexed triangle-list ones, the firstVertex
argument can simply be passed as a vertexOffset.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>

2 years agodzn: Fix exec_buf_stride calculation
Boris Brezillon [Wed, 6 Apr 2022 15:25:14 +0000 (17:25 +0200)]
dzn: Fix exec_buf_stride calculation

The stride depends on the indirect draw arguments which are different if
triangle-fan emulation is required.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>

2 years agomicrosoft/spirv_to_dxil: Add a draw_id field to vertex_runtime_data
Boris Brezillon [Wed, 6 Apr 2022 08:24:33 +0000 (01:24 -0700)]
microsoft/spirv_to_dxil: Add a draw_id field to vertex_runtime_data

So we can support the draw_id system value.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15912>

2 years agoradv: only apply enable_mrt_output_nan_fixup for 32-bit float MRTs
Samuel Pitoiset [Thu, 21 Apr 2022 10:41:27 +0000 (12:41 +0200)]
radv: only apply enable_mrt_output_nan_fixup for 32-bit float MRTs

This is incorrect for 32-bit integer MRTs which are clamped to the
maximum value of the format, and returning 0 can break some shaders.

This fixes a rendering issue with RAGE2.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4329
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/16080>

2 years agodocs: update calendar for 22.1.0-rc2
Dylan Baker [Fri, 22 Apr 2022 04:32:46 +0000 (21:32 -0700)]
docs: update calendar for 22.1.0-rc2

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

2 years agodocs: update calendar for 22.1.0-rc1
Dylan Baker [Fri, 22 Apr 2022 04:32:45 +0000 (21:32 -0700)]
docs: update calendar for 22.1.0-rc1

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

2 years agodocs: update calendar and link releases notes for 22.0.2
Dylan Baker [Fri, 22 Apr 2022 04:31:58 +0000 (21:31 -0700)]
docs: update calendar and link releases notes for 22.0.2

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

2 years agodocs: Add sha256sums for 22.0.2
Dylan Baker [Fri, 22 Apr 2022 04:31:09 +0000 (21:31 -0700)]
docs: Add sha256sums for 22.0.2

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

2 years agodocs: add release notes for 22.0.2
Dylan Baker [Fri, 22 Apr 2022 04:03:38 +0000 (21:03 -0700)]
docs: add release notes for 22.0.2

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

2 years agozink: fix memory_barrier intrinsic
Mike Blumenkrantz [Fri, 15 Apr 2022 13:58:58 +0000 (09:58 -0400)]
zink: fix memory_barrier intrinsic

matching glsang behavior here

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

2 years agozink: always use vk mem model for shaders if available
Mike Blumenkrantz [Fri, 15 Apr 2022 13:58:48 +0000 (09:58 -0400)]
zink: always use vk mem model for shaders if available

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

2 years agozink: use vulkan memory model shader semantics for tcs barriers
Mike Blumenkrantz [Thu, 14 Apr 2022 18:30:21 +0000 (14:30 -0400)]
zink: use vulkan memory model shader semantics for tcs barriers

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

2 years agozink: hook up VK_KHR_vulkan_memory_model
Mike Blumenkrantz [Thu, 14 Apr 2022 18:30:09 +0000 (14:30 -0400)]
zink: hook up VK_KHR_vulkan_memory_model

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

2 years agozink: fix semantics mask for compute control barriers
Mike Blumenkrantz [Thu, 14 Apr 2022 18:28:43 +0000 (14:28 -0400)]
zink: fix semantics mask for compute control barriers

cc: mesa-stable

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

2 years agozink: fix tcs control barriers for use without vk memory model
Mike Blumenkrantz [Thu, 14 Apr 2022 18:19:02 +0000 (14:19 -0400)]
zink: fix tcs control barriers for use without vk memory model

these are translated into memory+control barriers in nir, and only
the control barrier needs to be handled

these semantics match what glslang does, so they must be right

cc: mesa-stable

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

2 years agowgl: support kopper
Sidney Just [Thu, 21 Apr 2022 19:55:38 +0000 (12:55 -0700)]
wgl: support kopper

this is semi transposed from the dri version of kopper and mostly ignores
what wgl tries to do in order to let zink drive everything

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>

2 years agozink: support win32 wsi
Sidney Just [Wed, 20 Apr 2022 21:50:39 +0000 (17:50 -0400)]
zink: support win32 wsi

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>

2 years agokopper: add win32 loader interface
Sidney Just [Wed, 20 Apr 2022 21:49:59 +0000 (17:49 -0400)]
kopper: add win32 loader interface

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>

2 years agozink: support VK_KHR_win32_surface
Sidney Just [Wed, 20 Apr 2022 21:48:30 +0000 (17:48 -0400)]
zink: support VK_KHR_win32_surface

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>

2 years agowgl: add zink to the list of auto-loaded drivers
Sidney Just [Wed, 20 Apr 2022 21:47:58 +0000 (17:47 -0400)]
wgl: add zink to the list of auto-loaded drivers

it's a legitimate driver!

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>

2 years agowgl: add a flag to determine if running on zink
Sidney Just [Wed, 20 Apr 2022 21:47:22 +0000 (17:47 -0400)]
wgl: add a flag to determine if running on zink

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>

2 years agozink: add a stencil blit fallback path
Mike Blumenkrantz [Thu, 14 Apr 2022 12:43:33 +0000 (08:43 -0400)]
zink: add a stencil blit fallback path

nvidia doesn't support stencil exports, so this is necessary to handle
stencil-only blits

fixes #6316

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

2 years agozink: rework clear_depth_stencil hook
Mike Blumenkrantz [Thu, 14 Apr 2022 12:42:57 +0000 (08:42 -0400)]
zink: rework clear_depth_stencil hook

u_blitter works great, but it doesn't handle recursion, so only use
it as a last resort

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

2 years agozink: make update_framebuffer_state() public
Mike Blumenkrantz [Thu, 14 Apr 2022 13:09:35 +0000 (09:09 -0400)]
zink: make update_framebuffer_state() public

this is useful

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

2 years agozink: make unsupported blit formats an error
Mike Blumenkrantz [Thu, 14 Apr 2022 12:13:09 +0000 (08:13 -0400)]
zink: make unsupported blit formats an error

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

2 years agoiris: fix race condition during busy tracking
Paulo Zanoni [Wed, 9 Feb 2022 20:56:35 +0000 (12:56 -0800)]
iris: fix race condition during busy tracking

The Iris code that deals with implicit tracking is protected by
bufmgr->bo_deps_lock. Before this patch, we hold this lock during
update_batch_syncobjs() but don't keep it held until we actually
submit the batch in the execbuf ioctl. This can lead to the following
race condition:

  - Context C1 generates a batch B1 that signals syncobj S1.
  - Context C2 generates a batch B2 that depends on something that B1
    from C1 is using, so we mark B2 as having to wait syncobj S1.
  - C2 calls submit_batch() before C1 does it.
  - The Kernel detects it was told to wait on syncobj S1 that was
    never even submitted, so it returns EINVAL to the execbuf ioctl.
  - We run abort() at the end of _iris_batch_flush().
    - If DEBUG is defined, we also print:
      iris: Failed to submit batchbuffer: Invalid argument

I couldn't figure out a way to reproduce this issue with real
workloads, but I was able to write a small reproducer to trigger this.
Basically it's a little GL program that has lots of contexts running
in different threads submitting compute shaders that keep using the
same SSBOs. I'll submit this as a piglit test. Edit: Tapani found a
dEQP test case which fails intermintently without this fix, so I'm not
sure a new Piglit is worth it now.

The solution itself is quite simple: just keep bo_deps_lock held all
the way from update_batch_syncobjs() until ioctl(). In order to make
that easier we just call update_batch_syncobjs() a little later. We
have to drop the lock as soon as the ioctl returns because removing
the references on the buffers would trigger other functions to try to
grab the lock again, leading to deadlocks.

Thanks to Kenneth Graunke for pointing out this issue.

This has also been confirmed to fix a dEQP test that was giving
intermittent failures:
  dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.12

v2: Move decode_batch() out, just to be safe (Jason).
v3: Do it all after assembling validation_list (Ken).

Cc: mesa-stable
Fixes: 89a34cb8450a ("iris: switch to explicit busy tracking")
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14964>

2 years agozink: Improve zink.rst with links
Yonggang Luo [Tue, 19 Apr 2022 08:49:44 +0000 (16:49 +0800)]
zink: Improve zink.rst with links

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16026>

2 years agozink: Trim spaces in zink.rst
Yonggang Luo [Tue, 19 Apr 2022 08:39:52 +0000 (16:39 +0800)]
zink: Trim spaces in zink.rst

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16026>

2 years agowgl: support GL 4.6
Mike Blumenkrantz [Thu, 21 Apr 2022 19:13:09 +0000 (15:13 -0400)]
wgl: support GL 4.6

somehow we never supported anything above 4.5?

cc: mesa-stable

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16085>

2 years agozink: move the kopper present fence to the displaytarget object
Mike Blumenkrantz [Wed, 20 Apr 2022 19:32:05 +0000 (15:32 -0400)]
zink: move the kopper present fence to the displaytarget object

this is otherwise broken when front/back buffers share the same dt

Fixes: 8ade5588e39 ("zink: add kopper api")

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

2 years agovirgl: Switch to nir-to-tgsi by default.
Emma Anholt [Tue, 21 Dec 2021 00:31:54 +0000 (16:31 -0800)]
virgl: Switch to nir-to-tgsi by default.

With !8044 all TGSI drivers will end up going through the nir-to-tgsi
path, so make the switch now that CI is happy (which will also make sure
that future NTT work doesn't break virgl).

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13295>

2 years agotgsi: Extend array lengths when merging usage_masks.
Emma Anholt [Tue, 19 Apr 2022 23:21:02 +0000 (16:21 -0700)]
tgsi: Extend array lengths when merging usage_masks.

With nir-to-tgsi, virgl saw a case where a previous declaration of array
.x and scalar .y (turning into an array with .xy) ended up being a
declaration of scalar .x and array .y (turning into a scalar with .xy).
Make sure we extend the declared array length as well.

One might think that the fix would be to union the .first/.last between
the two declarations being merged, but note that ureg_DECL_output() passes
in the current nr_output_regs as the index, so the .last would end up
getting extended for those callers (such as nir_to_tgsi fs outputs) every
time you merged.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13295>

2 years agonir_to_tgsi: Lower FS input array indexing since we don't declare input arrays.
Emma Anholt [Fri, 8 Apr 2022 19:24:22 +0000 (12:24 -0700)]
nir_to_tgsi: Lower FS input array indexing since we don't declare input arrays.

We can't declare input arrays because mesa/st lowers NIR VS output
declarations to elements no matter what, and virgl has depended on
matching array sizes of declarations between producers and consumers.  So,
we have to lower it away (which is fine because hardware drivers will
generally be lowering anyway).

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13295>

2 years agovirgl: Clear all indirect flags when writing to a temporary
Gert Wollny [Sun, 17 Apr 2022 15:22:27 +0000 (17:22 +0200)]
virgl: Clear all indirect flags when writing to a temporary

The output may be an array, e.g. with a TCS shader, so if the
value is written to a temporaray first remove the indirect
indicator for that write.

Fixes: 36f12c85c84364d7f1ea797512462e7c7e47a260
   virgl: Extend integer write out output fix to all non-move integers ops

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13295>

2 years agonir/divergence: handle load_global_block_intel
Lionel Landwerlin [Thu, 21 Apr 2022 08:00:23 +0000 (11:00 +0300)]
nir/divergence: handle load_global_block_intel

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: dd39e311b336 ("nir: Add nir_intrinsic_{load,store}_deref_block_intel")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16075>

2 years agontt: Split 64 bit vec3 and vec4 local variables and phis
Gert Wollny [Wed, 20 Apr 2022 10:04:26 +0000 (12:04 +0200)]
ntt: Split 64 bit vec3 and vec4 local variables and phis

Fixes virgl with with ntt:
   spec@arb_enhanced_layouts@execution@component-layout@vs-fs-array-dvec3
   spec@arb_gpu_shader_fp64@uniform_buffers@fs-array-copy
   spec@arb_gpu_shader_fp64@uniform_buffers@gs-array-copy
   spec@arb_gpu_shader_fp64@uniform_buffers@vs-array-copy
   spec@arb_gpu_shader_fp64@execution@gs-fs-vs-double
   spec@arb_gpu_shader_fp64@execution@built-in-functions@fs-frexp-dvec4-variable-index
   spec@arb_gpu_shader_fp64@execution@explicit-location-gs-fs-vs
   spec@arb_gpu_shader_fp64@execution@built-in-functions@fs-frexp-dvec4-variable-index

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15945>

2 years agonir: Add pass to split 64 bit vec3 and vec4 variable access and phis
Gert Wollny [Wed, 13 Apr 2022 15:57:06 +0000 (17:57 +0200)]
nir: Add pass to split 64 bit vec3 and vec4 variable access and phis

NTT can't convert local 64 variables of type vec3 or vec4, therefore,
they need to be split into vec2 + double or vec2 + vec2.

At the same time deal splitting the phi nodes.

The pass goes into the global namespace because it is also useful
for r600.

v2: only lower function_temps (Emma) and handle array of arrays (Jason)

v3: - remove bool parameter in function to merge
      vec3 and vec4
    - simplify load/store_deref_(array|var)
    - use a pointer hash table
    - simplify PHI splitting (all Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15945>

2 years agor300: Print warning when stubbing derivatives
Filip Gawin [Sun, 23 Jan 2022 16:41:43 +0000 (17:41 +0100)]
r300: Print warning when stubbing derivatives

Fixes: e1c640c3a43d741719864b35cbf855aa82be0611
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14669>

2 years agoci/zink: Add glx-tfp to skips
Daniel Stone [Thu, 21 Apr 2022 15:12:24 +0000 (16:12 +0100)]
ci/zink: Add glx-tfp to skips

glx-tfp is broken since Kopper, and periodically either fails or
crashes; we seemingly can't quite deal with the change between the two.
Just skip it for now.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16082>

2 years agoradv/ci: add a Van Gogh dEQP runner
Martin Roukala (né Peres) [Thu, 24 Mar 2022 13:18:00 +0000 (15:18 +0200)]
radv/ci: add a Van Gogh dEQP runner

Vangogh is the codename of the custom APU found in the Steam Deck.
As it only has 4 Zen2 cores and a 15W TDP, don't expect fast runs
until we get more of them in CI :)

Just like the Renoir and one of the NAVI10 runners, this VanGogh
runner is hosted in my CI farm, behind a couple of UPSes.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Charlie Turner <cturner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15555>

2 years agoci/b2c: update b2c to enable monitoring support
Martin Roukala (né Peres) [Thu, 14 Apr 2022 12:34:21 +0000 (15:34 +0300)]
ci/b2c: update b2c to enable monitoring support

By enabling monitoring, we can collect all kind of metrics such as
CPU/Memory/Disk usage during execution, allowing us to detect
bottlenecks.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Charlie Turner <cturner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15555>

2 years agoci/b2c: bump the kernel to 5.17.1
Martin Roukala (né Peres) [Thu, 14 Apr 2022 12:49:37 +0000 (15:49 +0300)]
ci/b2c: bump the kernel to 5.17.1

This new kernel also brings support for sensors, which makes will
enable us to monitor metrics during the execution of tests.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Charlie Turner <cturner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15555>

2 years agoci/b2c: fix the generation of the IMAGE_UNDER_TEST variable
Martin Roukala (né Peres) [Tue, 19 Apr 2022 07:08:13 +0000 (10:08 +0300)]
ci/b2c: fix the generation of the IMAGE_UNDER_TEST variable

The `IMAGE_UNDER_TEST` variable set in `.b2c-test` got broken with
the merge of 7d474c1 (ci: Move most stuff out of root .gitlab-ci.yml).

During the shuffling, the `MESA_BASE_TAG` and `MESA_IMAGE_TAG`
variables were dropped, leading to `IMAGE_UNDER_TEST` being an
unexisting container.

To make this issue less likely to happen in the future, this patch
drops the code duplication that led to `IMAGE_UNDER_TEST` to be
the same as `MESA_IMAGE` and instead re-uses .use-debian/x86_test-vk
to generate `MESA_IMAGE`, which we then use verbatim in
`IMAGE_UNDER_TEST`.

The renaming is `MESA_IMAGE` into `IMAGE_UNDER_TEST` there to make the
distinction clear between the image run by gitlab-runner (what is
usually called `MESA_IMAGE` but we instead hardcode to valve-infra's
trigger container), and the image we are running on the test machines.

Fixes: 7d474c1 (ci: Move most stuff out of root .gitlab-ci.yml)
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Charlie Turner <cturner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15555>

2 years agomisc: replace `#ifdef\s\s__cplusplus` with `#ifdef\s__cplusplus`
Yonggang Luo [Thu, 31 Mar 2022 07:34:08 +0000 (15:34 +0800)]
misc: replace `#ifdef\s\s__cplusplus` with `#ifdef\s__cplusplus`

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15762>

2 years agomisc: Replace `#ifdef\t__cplusplus` with `#ifdef\s\s__cplusplus`
Yonggang Luo [Thu, 31 Mar 2022 07:32:36 +0000 (15:32 +0800)]
misc: Replace `#ifdef\t__cplusplus` with `#ifdef\s\s__cplusplus`

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15762>

2 years agonir/lower_int64: do not try to clamp floats to int-range
Erik Faye-Lund [Tue, 19 Apr 2022 06:21:08 +0000 (08:21 +0200)]
nir/lower_int64: do not try to clamp floats to int-range

The clamping isn't correct, because the exact values ended up getting
rounded off a bit when converting back to floats.

But, converting floats to integers have undefined results when the
float value doesn't fit in the integer. So let's not try to clamp the
value here.

This was caught by digging at a Clang warning, see this thread for
details:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15547#note_1329769

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

2 years agospirv: fix OpBranchConditional when both branches are the same
Alexey Bozhenko [Wed, 13 Apr 2022 12:16:16 +0000 (15:16 +0300)]
spirv: fix OpBranchConditional when both branches are the same

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

Signed-off-by: Bozhenko Alexey <oleksii.bozhenko@globallogic.com>
Fixes: 64cb143b922 ("spirv: Fix handling of OpBranchConditional with same THEN and ELSE")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15929>

2 years agoutil/stencil: fix stencil fallback blit shader texture types.
Dave Airlie [Thu, 21 Apr 2022 00:23:11 +0000 (10:23 +1000)]
util/stencil: fix stencil fallback blit shader texture types.

src/gallium/auxiliary/tgsi/tgsi_scan.c:287: scan_src_operand: Assertion `info->sampler_targets[index] == target' failed.
assert was being triggered by
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singlesampled_blit
using the stencil fallback with zink.

Fixes: f05dfddeb1ad ("u_blitter: fix stencil blit fallback for crocus.")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16069>

2 years agou_blitter/stencil: take dstbox x/y into accounts for dst fb width
Dave Airlie [Wed, 20 Apr 2022 23:49:31 +0000 (09:49 +1000)]
u_blitter/stencil: take dstbox x/y into accounts for dst fb width

When setting the dst framebuffer width height, it might be silly
to constrain this beyond the dst resource, but at least constrain
it correctly to take account of x/y offsets.

This fixes some uses of this as a fallback for zink with
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_stencil_blit

Fixes: b4c07a8a87d0 ("gallium/util: allow scaling blits for stencil-fallback")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16069>

2 years agopvr: replace p_compiler.h boolean with stdbool
Frank Binns [Wed, 13 Apr 2022 11:02:17 +0000 (12:02 +0100)]
pvr: replace p_compiler.h boolean with stdbool

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16037>

2 years agoci/windows: Eliminate duplicate script definition
Daniel Stone [Wed, 20 Apr 2022 21:16:44 +0000 (22:16 +0100)]
ci/windows: Eliminate duplicate script definition

We already get this from the base we extend from.

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

2 years agoci: Also disable Windows container builds when down
Daniel Stone [Wed, 20 Apr 2022 21:15:10 +0000 (22:15 +0100)]
ci: Also disable Windows container builds when down

Unlike all the other test configurations, we also want to drop the
Windows container build when our Windows machines aren't available.
Missed in !16055.

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

2 years agoci: Allow lima jobs to be globally disabled
Daniel Stone [Thu, 21 Apr 2022 10:30:27 +0000 (11:30 +0100)]
ci: Allow lima jobs to be globally disabled

This is useful in situations like right now, where the boards are dead.

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

2 years agodzn: remove stale cpp_args
Erik Faye-Lund [Wed, 20 Apr 2022 16:33:04 +0000 (18:33 +0200)]
dzn: remove stale cpp_args

We no longer use C++, so we don't need to set cpp_args here.

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

2 years agodzn: fixup indent
Erik Faye-Lund [Wed, 20 Apr 2022 10:50:14 +0000 (12:50 +0200)]
dzn: fixup indent

This seems to be all tab-indents we have in our code-base.

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

2 years agodzn: drop needless enum-casts
Erik Faye-Lund [Wed, 20 Apr 2022 10:50:04 +0000 (12:50 +0200)]
dzn: drop needless enum-casts

After rewriting to C, we also don't need these casts.

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

2 years agoanv: Fix geometry flickering issue when compute and 3D passes are combined
Vadym Shovkoplias [Thu, 14 Apr 2022 18:52:47 +0000 (21:52 +0300)]
anv: Fix geometry flickering issue when compute and 3D passes are combined

Call flush_pipeline_select_3d in CmdBeginRendering() to emit a dummy MEDIA_VFE_STATE
before switching from GPGPU to 3D.

Original commit with the fix:
bc612536 ("anv: Emit a dummy MEDIA_VFE_STATE before switching from GPGPU to 3D")

Fixes: 3501a3f9ed92 ("anv: Convert to 100% dynamic rendering")
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6201
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15954>

2 years agodzn: add space before += operator
Erik Faye-Lund [Tue, 12 Apr 2022 14:55:03 +0000 (16:55 +0200)]
dzn: add space before += operator

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

2 years agodzn: clean up pointer syntax
Erik Faye-Lund [Tue, 12 Apr 2022 14:50:21 +0000 (16:50 +0200)]
dzn: clean up pointer syntax

The code-style we use have a space before the first asterisk for
pointers. Fix a few inconsistencies.

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

2 years agodzn: remove some needless casts
Erik Faye-Lund [Fri, 8 Apr 2022 09:11:21 +0000 (11:11 +0200)]
dzn: remove some needless casts

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

2 years agodzn: Add support for KHR_descriptor_update_template
Boris Brezillon [Mon, 28 Mar 2022 08:12:57 +0000 (10:12 +0200)]
dzn: Add support for KHR_descriptor_update_template

Create update templates where the offset in the descriptor heap is
pre-calculated.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15691>

2 years agodzn: Split the write desc helpers in two halves
Boris Brezillon [Thu, 14 Apr 2022 12:34:19 +0000 (14:34 +0200)]
dzn: Split the write desc helpers in two halves

Split the write desc helpers in two halves, one taking a descriptor
offset directly, and the other one taking a descriptor set pointer.

This will allow us to pre-calculate descriptor offsets when creating
a descriptor_update template and speed up a bit the write step in that
case.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15691>

2 years agodzn: Pass layout objects to various dzn_descriptor_set_ptr_xxx helpers
Boris Brezillon [Thu, 14 Apr 2022 09:37:45 +0000 (11:37 +0200)]
dzn: Pass layout objects to various dzn_descriptor_set_ptr_xxx helpers

Needed if we want to support KHR_descriptor_update_template, since
we won't have access to the final descriptor set when calculating heap
offsets in that case.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15691>

2 years agodzn: Rename a bunch of dzn_descriptor_set helpers
Boris Brezillon [Thu, 14 Apr 2022 09:42:52 +0000 (11:42 +0200)]
dzn: Rename a bunch of dzn_descriptor_set helpers

Let's be consistent with other helpers taking a dzn_descriptor_set_ptr
object and prefix all such functions with dzn_descriptor_set_ptr_.

We also rename dzn_descriptor_set_ptr_get_desc_vk_type() into
dzn_descriptor_set_ptr_get_vk_type() to shorten it a bit.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15691>

2 years agointel/dev: Add device info for RPL-P
Jordan Justen [Fri, 25 Mar 2022 19:03:08 +0000 (12:03 -0700)]
intel/dev: Add device info for RPL-P

Cc: mesa-stable
Ref: https://patchwork.freedesktop.org/series/102701/
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16054>

2 years agodzn: Add support for EXT_vertex_attribute_divisor
Boris Brezillon [Thu, 7 Apr 2022 14:53:58 +0000 (07:53 -0700)]
dzn: Add support for EXT_vertex_attribute_divisor

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15915>

2 years agoci/windows: Split the windows-related tests
Boris Brezillon [Tue, 19 Apr 2022 15:18:13 +0000 (08:18 -0700)]
ci/windows: Split the windows-related tests

Should help with the timeouts we see in CI right now.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16042>

2 years agod3d12: Move the D3D12ResourceState code to the gallium driver
Boris Brezillon [Wed, 20 Apr 2022 06:46:56 +0000 (08:46 +0200)]
d3d12: Move the D3D12ResourceState code to the gallium driver

It's only used there, and we don't plan to use it in Dozen, so let's move
the code to src/gallium/drivers/d3d12/ and get rid of the static
d3d12_resource_state library.

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

2 years agocrocus: export GEM handle with RDWR access rights
Michael Olbrich [Wed, 20 Apr 2022 14:26:28 +0000 (16:26 +0200)]
crocus: export GEM handle with RDWR access rights

Without this, it is impossible to export gem handles with write access.

This was fixed the same way for
i965 (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10850) and
iris (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10851).

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

2 years agozink: unset PIPE_CAP_MULTI_DRAW_INDIRECT_PARTIAL_STRIDE
Mike Blumenkrantz [Wed, 13 Apr 2022 20:34:01 +0000 (16:34 -0400)]
zink: unset PIPE_CAP_MULTI_DRAW_INDIRECT_PARTIAL_STRIDE

by the time this gets to the driver, it's really awful to solve,
so have the frontend solve it

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>

2 years agogallium: add PIPE_CAP_MULTI_DRAW_INDIRECT_PARTIAL_STRIDE
Mike Blumenkrantz [Wed, 13 Apr 2022 20:32:04 +0000 (16:32 -0400)]
gallium: add PIPE_CAP_MULTI_DRAW_INDIRECT_PARTIAL_STRIDE

GL spec states that the stride for indirect multidraws:
* cannot be negative
* can be zero
* must be a multiple of 4

some drivers can't support strides which are not a multiple of the
size of the indirect struct being used, however, so rewrite those to
direct draws

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>

2 years agoutil/draw: fix indirect draw count readback
Mike Blumenkrantz [Tue, 19 Apr 2022 20:06:44 +0000 (16:06 -0400)]
util/draw: fix indirect draw count readback

if there is an indirect count, always use it

Fixes: 3eb99323172 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>

2 years agoutil/draw: handle draw_count=0 when reading indirect parameters
Mike Blumenkrantz [Tue, 19 Apr 2022 20:06:44 +0000 (16:06 -0400)]
util/draw: handle draw_count=0 when reading indirect parameters

Fixes: 3eb99323172 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>

2 years agoutil/draw: fix map size of indirect buffer in util_draw_indirect_read
Mike Blumenkrantz [Fri, 15 Apr 2022 14:34:03 +0000 (10:34 -0400)]
util/draw: fix map size of indirect buffer in util_draw_indirect_read

this was incorrectly calculating too small of a map region if
the stride was less than the size of the struct

Fixes: 3eb99323172 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>

2 years agovenus: use linear modifier for legacy common wsi path
Yiwei Zhang [Sun, 17 Apr 2022 04:33:05 +0000 (21:33 -0700)]
venus: use linear modifier for legacy common wsi path

Towards the renderer, venus better uses VK_EXT_image_drm_format_modifier
to force linear with tiling modifier and mod_linear. Doing so won't make
any difference on the mesa implementations we care about given we have
required VK_EXT_image_drm_format_modifier for wsi support.

A lucky side effect of this is to allow common wsi to work with host
implementations not supporting dma_buf export.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15993>

2 years agovenus: override aspectMask for internal tiling modifier
Yiwei Zhang [Tue, 19 Apr 2022 23:50:13 +0000 (16:50 -0700)]
venus: override aspectMask for internal tiling modifier

WSI images and Android AHBs can have tiling modifier overrides, thus we
must override the aspectMask upon image subresource layout query.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15993>

2 years agozink: handle device-local unsynchronized maps
Mike Blumenkrantz [Fri, 15 Apr 2022 17:25:00 +0000 (13:25 -0400)]
zink: handle device-local unsynchronized maps

this is only possible when tc determines the buffer is not in use
and decides to return a pointer immediately, so just give back a staging
buffer

cc: mesa-stable

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

2 years agozink: remove xfb_barrier flag
Mike Blumenkrantz [Wed, 20 Apr 2022 16:10:33 +0000 (12:10 -0400)]
zink: remove xfb_barrier flag

this was an attempt to minimize the number of xfb barriers being emitted,
but really xfb barriers need to always be emitted in order for xfb to work

cc: mesa-stable

fixes (nv):
KHR-GL46.texture_view.reference_counting
KHR-GL46.transform_feedback_overflow_query_ARB.multiple-streams-multiple-buffers-per-stream
KHR-GL46.transform_feedback_overflow_query_ARB.multiple-streams-one-buffer-per-stream

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

2 years agozink: fix xfb counter buffer barriers
Mike Blumenkrantz [Wed, 20 Apr 2022 15:46:36 +0000 (11:46 -0400)]
zink: fix xfb counter buffer barriers

a read barrier is needed for resume, yes, but the counter buffer
is always being written to, so write access must always be set

cc: mesa-stable

fixes (nv):
KHR-GL46.transform_feedback.draw_xfb_test

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

2 years agozink: fix synchronization when drawing from streamout
Mike Blumenkrantz [Wed, 20 Apr 2022 15:29:10 +0000 (11:29 -0400)]
zink: fix synchronization when drawing from streamout

this was well-documented, but ultimately wrong: the synchronization
being used was for binding streamout buffers (not counter buffers) as
vertex buffers, which was already handled just fine in the normal
vertex buffer binding

drawing from streamout ONLY uses the counter buffer, which means
the counter buffer needs to be synchronized for reading

cc: mesa-stable

fixes (nv):
KHR-GL46.transform_feedback.draw_xfb_feedbackk_test
KHR-GL46.transform_feedback.draw_xfb_instanced_test
KHR-GL46.transform_feedback.draw_xfb_stream_instanced_test

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

2 years agozink: nv ci update
Mike Blumenkrantz [Tue, 19 Apr 2022 21:52:55 +0000 (17:52 -0400)]
zink: nv ci update

cc: mesa-stable

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