platform/upstream/mesa.git
2 years agopanvk: Clamp blend constants before copying them to the cmdbuf state
Boris Brezillon [Mon, 6 Sep 2021 13:35:17 +0000 (15:35 +0200)]
panvk: Clamp blend constants before copying them to the cmdbuf state

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: Narrow the allow-forward-pixel-kill condition
Boris Brezillon [Mon, 6 Sep 2021 10:16:41 +0000 (12:16 +0200)]
panvk: Narrow the allow-forward-pixel-kill condition

Setting it to info->fs.can_fpk is wrong. Let's mimic the gallium driver
here.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: Fix chan_size calculation in panvk_emit_blend()
Boris Brezillon [Mon, 6 Sep 2021 10:13:34 +0000 (12:13 +0200)]
panvk: Fix chan_size calculation in panvk_emit_blend()

Only the first channel was taken into account.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: Don't advertise min/max filter
Boris Brezillon [Tue, 7 Sep 2021 12:20:37 +0000 (14:20 +0200)]
panvk: Don't advertise min/max filter

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: We don't support linear filtering on integer formats
Boris Brezillon [Fri, 3 Sep 2021 10:06:01 +0000 (12:06 +0200)]
panvk: We don't support linear filtering on integer formats

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: Only advertise MSAA-4
Boris Brezillon [Fri, 3 Sep 2021 15:00:53 +0000 (17:00 +0200)]
panvk: Only advertise MSAA-4

We'll see if we want to support MSAA 8 and 16 later. MSAA 2 is not
supported.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: Fix blend descriptor emission
Boris Brezillon [Mon, 30 Aug 2021 08:37:47 +0000 (10:37 +0200)]
panvk: Fix blend descriptor emission

Got the round_to_fb_precision wrong when rebasing the the per-gen XML
changes. Fix it now.

Fixes: 792a0ab0b146 ("panvk: Prepare per-gen split")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agopanvk: Don't use pan_is_bifrost()
Boris Brezillon [Tue, 7 Sep 2021 11:18:26 +0000 (13:18 +0200)]
panvk: Don't use pan_is_bifrost()

Leftovers from the per-gen XML transition patch.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12762>

2 years agobroadcom/compiler: force a last thrsw for spilling
Juan A. Suarez Romero [Wed, 8 Sep 2021 08:04:45 +0000 (10:04 +0200)]
broadcom/compiler: force a last thrsw for spilling

As we don't know if we are going to have spilling or not, emit always a
last thrsw at the end of the shader.

If later we don't have spillings and we don't need that last thrsw, we
remove it and switch back to the previous one.

This way we ensure all the spilling happens always before the last
thrsw.

v2 (Juan):
 - Rework the code to force a last thrsw and remove later if no spilling

v3:
 - Merge functionality inside vir_emit_last_thrsw (Iago)
 - Add vir_restore_last_thrsw (Juan)

v4 (Iago):
 - Fix/add new comments
 - Rename variables/parameters

v5 (Iago):
 - Fix comments
 - Add assertion

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

2 years agobroadcom: make vir_emit_last_thrsw() private
Juan A. Suarez Romero [Wed, 8 Sep 2021 08:02:26 +0000 (10:02 +0200)]
broadcom: make vir_emit_last_thrsw() private

This function is only used in v3d_nir_to_vir(), so make it private.

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

2 years agoa4xx/computerator: add initial backend
Ilia Mirkin [Thu, 9 Sep 2021 01:39:56 +0000 (21:39 -0400)]
a4xx/computerator: add initial backend

This backend provides very basic a4xx support. It's enough to run
kernels with explicit stg/etc ops, but not with stgb/ldgb type access.
There is no perfcounter support hooked up yet either.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12784>

2 years agoa4xx: add some better documentation for compute registers
Ilia Mirkin [Thu, 9 Sep 2021 01:37:06 +0000 (21:37 -0400)]
a4xx: add some better documentation for compute registers

These were driven by seeing 0x1c (and other) values set by blob, as well
as comparing to equivalent a3xx documentation.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12784>

2 years agoanv: No need to lower to A64 messages for 64-bit atomics
Sagar Ghuge [Tue, 31 Aug 2021 02:00:50 +0000 (19:00 -0700)]
anv: No need to lower to A64 messages for 64-bit atomics

With LSC support, we can do 64-bit atomics with A32/64 messages.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12566>

2 years agointel/compiler: Add support to handle 64-bit atomics with A32 messages
Sagar Ghuge [Tue, 31 Aug 2021 01:59:51 +0000 (18:59 -0700)]
intel/compiler: Add support to handle 64-bit atomics with A32 messages

v1: (Jason)
- Fix parentheses

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12566>

2 years agoanv: Advertise support for shaderBufferFloat64AtomicMinMax
Sagar Ghuge [Thu, 26 Aug 2021 17:19:59 +0000 (10:19 -0700)]
anv: Advertise support for shaderBufferFloat64AtomicMinMax

v1:
- Just check has_lsc (Jason)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12566>

2 years agointel/compiler: Add 64-bit A64 float logical opcode support
Sagar Ghuge [Thu, 26 Aug 2021 17:13:34 +0000 (10:13 -0700)]
intel/compiler: Add 64-bit A64 float logical opcode support

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12566>

2 years agoanv: Advertise support for shaderBufferFloat32AtomicAdd
Jason Ekstrand [Wed, 25 Aug 2021 20:00:51 +0000 (13:00 -0700)]
anv: Advertise support for shaderBufferFloat32AtomicAdd

Rework: (Sagar)
- Enable shaderBufferFloat32AtomicAdd for XeHPG

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12566>

2 years agointel/fs: Add support for atomic_fadd
Jason Ekstrand [Tue, 26 May 2020 20:28:56 +0000 (15:28 -0500)]
intel/fs: Add support for atomic_fadd

Rework:
- Enable float32 atomic add with LSC (Sagar)
- disassemble new opcode (Caio)

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12566>

2 years agonir_to_tgsi: Allow SSA defs to include swizzles, abs, and neg.
Emma Anholt [Wed, 8 Sep 2021 22:14:47 +0000 (15:14 -0700)]
nir_to_tgsi: Allow SSA defs to include swizzles, abs, and neg.

This will let some copy prop happen automatically, avoiding MOVs to temps.
Most importantly, though, it means that virgl won't see (unused channel)
swizzles from channels beyond the bounds of sysvals, which trigger shader
compile failures on the host.

softpipe shader-db:

total instructions in shared programs: 2946336 -> 2934777 (-0.39%)
instructions in affected programs: 374676 -> 363117 (-3.09%)
total temps in shared programs: 565552 -> 564139 (-0.25%)
temps in affected programs: 18138 -> 16725 (-7.79%)

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12781>

2 years agonir_to_tgsi: Switch ssa_temp[] to be a ureg_src.
Emma Anholt [Wed, 8 Sep 2021 00:18:46 +0000 (17:18 -0700)]
nir_to_tgsi: Switch ssa_temp[] to be a ureg_src.

After ntt_store_def(), all uses want it to be a ureg_src.  This will let
us fold abs/neg/swizzles in.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12781>

2 years agonir_to_tgsi: Clean up some unnecessary pointers-to-uregs.
Emma Anholt [Wed, 8 Sep 2021 00:16:58 +0000 (17:16 -0700)]
nir_to_tgsi: Clean up some unnecessary pointers-to-uregs.

This was used at one point to do ntt_store_def() or something I think.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12781>

2 years agonir_to_tgsi: Add support for memory_barrier_tcs_patch.
Emma Anholt [Wed, 4 Aug 2021 22:48:45 +0000 (15:48 -0700)]
nir_to_tgsi: Add support for memory_barrier_tcs_patch.

glsl_to_tgsi translated both cases of ir_barrier to TGSI's BARRIER, so map
both of glsl_to_nir's ir_barrier outputs to the same.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12781>

2 years agonir_to_tgsi: Don't forget to add sampler views with our samplers.
Emma Anholt [Wed, 8 Sep 2021 22:17:23 +0000 (15:17 -0700)]
nir_to_tgsi: Don't forget to add sampler views with our samplers.

While softpipe and i915 didn't really care, virgl very much does.
tgsi_scan also insisted that the texture ops and the decls matched, which
led to deduplicating the switch statemnts.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12781>

2 years agonir_to_tgsi: Fix indirect addressing of atomic counters.
Emma Anholt [Mon, 2 Aug 2021 23:34:37 +0000 (16:34 -0700)]
nir_to_tgsi: Fix indirect addressing of atomic counters.

It's not actually a given that the offset within the counter buffer is a
constant.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12781>

2 years agonir: Avoid visiting instructions multiple times in nir_instr_free_and_dce.
Bas Nieuwenhuizen [Sat, 4 Sep 2021 12:27:58 +0000 (14:27 +0200)]
nir: Avoid visiting instructions multiple times in nir_instr_free_and_dce.

Sadly need to poke a bit in the src internals to avoid using yet another
heap allocated datastructure.

Fixes: 52515485723 ("nir: Add a nir_instr_remove that recursively removes dead code.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5323
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12726>

2 years agovenus: separate physical device init and filter
Chia-I Wu [Fri, 3 Sep 2021 21:29:30 +0000 (14:29 -0700)]
venus: separate physical device init and filter

It is not an error when a physical device is filtered out.  But it is an
error when a physical device fails to initialize.

Fixed
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.

v2: separate success and fail paths

Fixes: 7dfac808 ("venus: no supported device is not an error")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12723>

2 years agovenus: refactor vn_instance_enumerate_physical_devices
Chia-I Wu [Fri, 3 Sep 2021 21:13:02 +0000 (14:13 -0700)]
venus: refactor vn_instance_enumerate_physical_devices

Move device enumeration to a new function.

v2: separate success and fail paths, rename functions
    (suggested by Ryan)

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12723>

2 years agoaux/trace: use private refcounts for samplerviews
Mike Blumenkrantz [Wed, 25 Aug 2021 16:54:46 +0000 (12:54 -0400)]
aux/trace: use private refcounts for samplerviews

this avoids having the driver bypass the samplerview wrapper and destroying
the samplerview prematurely, e.g., spec@sgis_generate_mipmap@gen-texsubimage

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

2 years agolavapipe: implement VK_EXT_depth_clip_enable
Roland Scheidegger [Fri, 6 Aug 2021 22:22:25 +0000 (00:22 +0200)]
lavapipe: implement VK_EXT_depth_clip_enable

v2: fix pipeline creation, need a deep copy for rasterization state now

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

2 years agogallium: add rasterizer depth_clamp enable bit
Roland Scheidegger [Fri, 6 Aug 2021 22:20:59 +0000 (00:20 +0200)]
gallium: add rasterizer depth_clamp enable bit

This is required for d3d10+, which has depth_clamp always enabled
regardless of depth_clip (in contrast to OpenGL, where enabling
depth_clamp disables depth_clip). There doesn't seem to be a GL
extension for it, but it will be used for lavapipe to implement
VK_EXT_depth_clip_enable.

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

2 years agomesa: skip fallback draw call if no primitives are being drawn
Mike Blumenkrantz [Tue, 31 Aug 2021 20:41:12 +0000 (16:41 -0400)]
mesa: skip fallback draw call if no primitives are being drawn

../src/mesa/main/draw.c: In function ‘_mesa_draw_gallium_fallback’:
../src/mesa/main/draw.c:1056:4: warning: ‘prim’ may be used uninitialized [-Wmaybe-uninitialized]
 1056 |    ctx->Driver.Draw(ctx, prim, num_prims, index_size ? &ib : NULL,
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1057 |                     index_bounds_valid, info->primitive_restart,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1058 |                     info->restart_index, min_index, max_index,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1059 |                     info->instance_count, info->start_instance);
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

2 years agomesa: fix default texture buffer format
Juan A. Suarez Romero [Wed, 8 Sep 2021 11:29:04 +0000 (13:29 +0200)]
mesa: fix default texture buffer format

According to ARB_tbo spec, default format is LUMINANCE8, but according
to core spec, it is R8.

This fixes piglit's spec@arb_texture_buffer_object@get test with drivers
supporting ARB_tbo spec but OpenGL/ES < 3.1.

v2:
 - Compare against compat profile (Ilia)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12774>

2 years agovbo/dlist: fix indentation in vbo_save_api.c
Pierre-Eric Pelloux-Prayer [Tue, 7 Sep 2021 11:29:39 +0000 (13:29 +0200)]
vbo/dlist: fix indentation in vbo_save_api.c

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

2 years agovbo/dlist: rework vertex_store management
Pierre-Eric Pelloux-Prayer [Wed, 1 Sep 2021 09:28:49 +0000 (11:28 +0200)]
vbo/dlist: rework vertex_store management

Simplify the whole thing:
- keep a single function (grow_vertex_storage) that extends the array
- call it when the array is full (in ATTR_UNION) or at the beginning of
  a primitive when the vertex count is known to avoid multiple reallocations.
- allocate save->vertex_store in vbo_save_NewList if needed

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

2 years agovbo/dlist: rework primitive store handling
Pierre-Eric Pelloux-Prayer [Wed, 1 Sep 2021 08:29:32 +0000 (10:29 +0200)]
vbo/dlist: rework primitive store handling

Simplify the logic by simply growing the primitive array when needed and
remove remove the call to compile_vertex_list in _save_End if the
array is full (it'll be resized later if needed instead).

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

2 years agovbo/dlist: rework buffer sizes
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 15:39:30 +0000 (17:39 +0200)]
vbo/dlist: rework buffer sizes

Use 20Mb as the default bo size and use the same limit when
allocating the CPU buffers in realloc_storage.

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

2 years agovbo/dlist: remove unused functions
Pierre-Eric Pelloux-Prayer [Tue, 31 Aug 2021 08:10:14 +0000 (10:10 +0200)]
vbo/dlist: remove unused functions

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

2 years agovbo/dlist: add documentation
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 14:16:32 +0000 (16:16 +0200)]
vbo/dlist: add documentation

Add a bit of documentation to describe the logic of vbo_save_api.

while at it improve the packing of vbo_save_context.

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

2 years agovbo/dlist: remove vbo_save_context::vert_count
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 13:39:17 +0000 (15:39 +0200)]
vbo/dlist: remove vbo_save_context::vert_count

The same property can be deduced directly from the vertex_store,
so remove this one to avoid sync problems between the two and
simplify the code.

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

2 years agovbo/dlist: remove vbo_save_copied_vtx
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 10:17:35 +0000 (12:17 +0200)]
vbo/dlist: remove vbo_save_copied_vtx

The copy_vertices() function is rarely called and removing
this decreases vbo_save_context's size by 20kb.

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

2 years agovbo/dlist: fix max_index_count value
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 15:11:51 +0000 (17:11 +0200)]
vbo/dlist: fix max_index_count value

We just need an upper bound anyway.

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

2 years agovbo/dlist: rework out of memory
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 15:17:12 +0000 (17:17 +0200)]
vbo/dlist: rework out of memory

We don't need to store/init a GLvertexformat (3kb) only to handle the
out of memory situation.
Instead, we can call _mesa_noop_vtxfmt_init when needed.

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

2 years agovbo/dlist: don't force list compilation if out of vertex space
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 15:16:56 +0000 (17:16 +0200)]
vbo/dlist: don't force list compilation if out of vertex space

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

2 years agovbo/dlist: limit allocation sizes
Pierre-Eric Pelloux-Prayer [Fri, 13 Aug 2021 15:16:19 +0000 (17:16 +0200)]
vbo/dlist: limit allocation sizes

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

2 years agovbo/dlist: remove vbo_save_context::max_vert
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 14:23:34 +0000 (16:23 +0200)]
vbo/dlist: remove vbo_save_context::max_vert

max_vert is easy to deduce from vertex_store so remove it to simplify
the code.

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

2 years agovbo/dlist: realloc vertex stores
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 14:06:41 +0000 (16:06 +0200)]
vbo/dlist: realloc vertex stores

Same logic that for the primitives: since we're using an intermediate
RAM storage, we don't need to artificially split lists when the buffer
is full.

Instead, we can simply realloc-ate it.

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

2 years agovbo/dlist: remove vbo_save_context::buffer_map
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 14:01:26 +0000 (16:01 +0200)]
vbo/dlist: remove vbo_save_context::buffer_map

buffer_map pointed to the first vertex in the store for the current list.

With the previous commit, the first vertex is always at index 0, so we
can drop buffer_map.

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

2 years agovbo/dlist: reset vertex_store::used in reset_counters
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 13:48:55 +0000 (15:48 +0200)]
vbo/dlist: reset vertex_store::used in reset_counters

This means that each list will start writing its vertices at index 0.

The previous mode (append) was useful in the past when the vertices
were written directly to a mapped-buffer object.

Now that there's an intermediate storage in RAM, the added complexity
of the append-mode has no value so drop it.

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

2 years agovbo/dlist: remove vbo_save_context::buffer_ptr
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 13:45:12 +0000 (15:45 +0200)]
vbo/dlist: remove vbo_save_context::buffer_ptr

buffer_ptr is always "buffer_in_ram + used" so compute it when needed
and drop it from the struct to avoid out-of-sync errors.

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

2 years agovbo/dlist: don't force list compilation if out of prim space
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 12:08:12 +0000 (14:08 +0200)]
vbo/dlist: don't force list compilation if out of prim space

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

2 years agovbo/dlist: realloc prims array instead of free/malloc
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 12:06:08 +0000 (14:06 +0200)]
vbo/dlist: realloc prims array instead of free/malloc

Now that we don't have links to the prim_store->prims pointers, we
can replace the free/malloc by a realloc version to grow the prim
storage as needed by a list.

This will be used in the next commit to avoid splitting lists in
multiple vbo_save_vertex_list instances because the prim_store was full.

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

2 years agovbo/dlist: use prim_store directly
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 11:59:23 +0000 (13:59 +0200)]
vbo/dlist: use prim_store directly

prim_store won't be shared anymore between multiple list, so use it
directly instead of proxies.

This simplifies the code and avoid to keep them in sync.

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

2 years agovbo/dlist: don't store prim_store
Pierre-Eric Pelloux-Prayer [Thu, 12 Aug 2021 06:58:03 +0000 (08:58 +0200)]
vbo/dlist: don't store prim_store

This is not used anywhere, so we can drop it from vbo_save_context.

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

2 years agovbo/dlist: remove vbo_save_vertex_store::bufferobj
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 17:11:32 +0000 (19:11 +0200)]
vbo/dlist: remove vbo_save_vertex_store::bufferobj

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

2 years agovbo/dlist: use a single buffer object
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 09:49:10 +0000 (11:49 +0200)]
vbo/dlist: use a single buffer object

Instead of using 2 bo, 1 for the indices, one for the vertices store
everything in the same buffer.

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

2 years agovbo/dlist: use buffer_in_ram_size
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 18:06:09 +0000 (20:06 +0200)]
vbo/dlist: use buffer_in_ram_size

The next commit will refactor buffer upload so we need to decouple
the size from the CPU buffer holding the vertices from the size of
the GPU buffer where we're uploading them.

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

2 years agovbo/dlist: move VAO update at the end
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 09:45:59 +0000 (11:45 +0200)]
vbo/dlist: move VAO update at the end

No functional changes but this is needed for future commits.

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

2 years agovbo/dlist: apply start_offset after indices construction
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 09:42:28 +0000 (11:42 +0200)]
vbo/dlist: apply start_offset after indices construction

This will make our life easier for the next commit.

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

2 years agovbo/dlist: simplify add_vertex function
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 09:28:27 +0000 (11:28 +0200)]
vbo/dlist: simplify add_vertex function

Use the correct pointer directly instead of adding/removing the same
offset.

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

2 years agofreedreno/a6xx: Fix VS primid with tess + GS.
Connor Abbott [Wed, 8 Sep 2021 13:05:20 +0000 (15:05 +0200)]
freedreno/a6xx: Fix VS primid with tess + GS.

Analogous to the previous commit.

Fixes: 8115cde3ba6 ("tu, freedreno/a6xx, ir3: Rewrite tess PrimID handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12768>

2 years agotu: Fix VS primid with tess + GS
Connor Abbott [Wed, 8 Sep 2021 12:59:28 +0000 (14:59 +0200)]
tu: Fix VS primid with tess + GS

If tess is enabled, then VS chains to the HS and we have to use the HS
value for the PrimID sysval. This is still true if GS is also enabled,
so we need to use the HS instead of the GS if both are enabled.  In
particular if the HS or DS uses gl_PrimitiveID but the GS doesn't then
we still need to setup the register.

This fixes a bunch of dEQP-VK.tessellation.invariance.primitive_set.*
cases on a650, although it seems they managed to still pass on a630 with
the broken PrimID handling.

Fixes: 8115cde3ba6 ("tu, freedreno/a6xx, ir3: Rewrite tess PrimID handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12768>

2 years agonir: fix serialization of loop/if control
Rhys Perry [Wed, 8 Sep 2021 17:09:18 +0000 (18:09 +0100)]
nir: fix serialization of loop/if control

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fixes: e76ae39ae22 ("nir: add support for user defined select control")
Fixes: b56451f82c1 ("nir: add support for user defined loop control")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12778>

2 years agoci: Use FDO_DISTRIBUTION_TAG where possible
Rohan Garg [Tue, 7 Sep 2021 13:58:45 +0000 (15:58 +0200)]
ci: Use FDO_DISTRIBUTION_TAG where possible

This allows for de duplicating some variables.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12750>

2 years agoradeonsi: enable nir option pack_varying_options
Qiang Yu [Thu, 26 Aug 2021 06:32:32 +0000 (14:32 +0800)]
radeonsi: enable nir option pack_varying_options

flat interpolation type is not enabled because we need to set
    SPI_PS_INPUT_CNTL_x.FLAT_SHADE=1
which is per vec4.

16 bit varying also need to set
    SPI_PS_INPUT_CNTL_x.FP16_INTERP_MODE
but varying packing only support 32 bit, so we don't need to
worry about this for now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12537>

2 years agonir/linker: pack varyings with different interpolation qualifier
Qiang Yu [Wed, 25 Aug 2021 06:07:50 +0000 (14:07 +0800)]
nir/linker: pack varyings with different interpolation qualifier

Driver like radeonsi load varying in a scalar manner, so prefer to pack
varying with different interpolation qualifier into same slot to save
space.

But driver like panfrost/bifrost can load varying in vector manner,
so prefer to pack varying with same interpolation qualifier.

Driver can add interpolation qualifiers which are able to be
packed into same varying slot to pack_varying_options nir option.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12537>

2 years agonir/lower_io_to_vector: check centroid & sample when merge variable
Qiang Yu [Wed, 25 Aug 2021 01:32:52 +0000 (09:32 +0800)]
nir/lower_io_to_vector: check centroid & sample when merge variable

These qualifiers should be respected for different varying load code
generation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12537>

2 years agomesa: fix glthread deadlock when EGL multi thread shared context
Qiang Yu [Wed, 11 Aug 2021 05:30:31 +0000 (13:30 +0800)]
mesa: fix glthread deadlock when EGL multi thread shared context

This fixes dEQP EGL tests when glthread is enabled:
dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random.images.texsubimage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_server_sync.images.teximage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_server_sync.images.texsubimage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.copyteximage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.texsubimage2d.*

Deadlock happens when:

  Thread A: call EGL context functions which will involve _mesa_glthread_finish(), like
  eglMakeCurrent() and eglDestroyContext(). It will hold the EGLDisplay.Mutex and wait
  on glthread job queue empty (util_queue_fence_wait(&last->fence)). glthread job thread
  executes batch holding gl_context.Shared.TexMutex (glthread_unmarshal_batch()).

  Thread B: call EGLImage import functions like EGLImageTargetTexture2DOES() which will
  hold gl_context.Shared.TexMutex (egl_image_target_texture()) then validate EGLImage
  and hold EGLDisplay.Mutex (dri2_lookup_egl_image()).

This fixes the deadlock by moving the EGLImage validation out of gl_context.Shared.TexMutex
lock area.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>

2 years agomesa: add ValidateEGLImage driver callback
Qiang Yu [Wed, 11 Aug 2021 02:26:00 +0000 (10:26 +0800)]
mesa: add ValidateEGLImage driver callback

Check EGLImage imported.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>

2 years agogallium/api: add validate_egl_image interface
Qiang Yu [Wed, 11 Aug 2021 02:10:07 +0000 (10:10 +0800)]
gallium/api: add validate_egl_image interface

For being used by mesa state tracker.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>

2 years agogallium/dri: add dri_screen egl image validate hooks
Qiang Yu [Tue, 10 Aug 2021 08:52:12 +0000 (16:52 +0800)]
gallium/dri: add dri_screen egl image validate hooks

For being used by EGLImage import in the following commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>

2 years agogbm/dri: implement image lookup extension version 2
Qiang Yu [Wed, 11 Aug 2021 08:59:05 +0000 (16:59 +0800)]
gbm/dri: implement image lookup extension version 2

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>

2 years agoegl/dri2: seperate EGLImage validate and lookup
Qiang Yu [Tue, 10 Aug 2021 06:49:12 +0000 (14:49 +0800)]
egl/dri2: seperate EGLImage validate and lookup

Version 2 of DRIImageLookupExtension add two interface for EGLImage
validate and lookup. This is for resolving deak lock in the following
commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>

2 years agodocs: update calendar and link releases notes for 21.1.8
Eric Engestrom [Wed, 8 Sep 2021 21:38:13 +0000 (22:38 +0100)]
docs: update calendar and link releases notes for 21.1.8

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

2 years agodocs: add release notes for 21.1.8
Eric Engestrom [Wed, 8 Sep 2021 21:18:24 +0000 (22:18 +0100)]
docs: add release notes for 21.1.8

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

2 years agogl.h: Remove dllimport
Jesse Natalie [Wed, 8 Sep 2021 16:26:02 +0000 (09:26 -0700)]
gl.h: Remove dllimport

__declspec(dllimport) isn't needed for linking to functions, extern
is sufficient. The preprocessor define used to determine when to
set it (_DLL) was incorrect, since that preprocessor define is set
anytime you're linking against dynamic CRT as opposed to static CRT.

Reviewed-by: Bill Kristiansen <billkris@Microsoft.com>
Reviewed-by: Marek Ol\9aák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12776>

2 years agoaux/trace: dump more pipe_vertex_element members
Mike Blumenkrantz [Tue, 7 Sep 2021 21:46:24 +0000 (17:46 -0400)]
aux/trace: dump more pipe_vertex_element members

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

2 years agomesa/st: use uint for instance_divisor instead of int
Mike Blumenkrantz [Tue, 7 Sep 2021 22:01:57 +0000 (18:01 -0400)]
mesa/st: use uint for instance_divisor instead of int

this is confusing

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

2 years agovenus: raise the ring buffer size to 64KB
Chia-I Wu [Thu, 26 Aug 2021 18:42:18 +0000 (11:42 -0700)]
venus: raise the ring buffer size to 64KB

When the renderer supports largeRing, raise the ring buffer size to 64KB
and raise the direct submit threshold to 4KB.  The numbers are randomly
picked.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: update venus-protocol headers
Chia-I Wu [Thu, 26 Aug 2021 18:25:33 +0000 (11:25 -0700)]
venus: update venus-protocol headers

There are some decoder changes.  But we mainly want to gain largeRing
support.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: make ring buffer size configurable
Chia-I Wu [Thu, 26 Aug 2021 18:30:18 +0000 (11:30 -0700)]
venus: make ring buffer size configurable

Until we can assume large ring support.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: rework vn_instance_submission
Chia-I Wu [Mon, 30 Aug 2021 16:44:29 +0000 (09:44 -0700)]
venus: rework vn_instance_submission

The goal is to remove local_cs_data.  To that end, vn_ring_submit is
modified to take a cs than a pointer.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: add and use VN_CS_ENCODER_INITIALIZER
Chia-I Wu [Mon, 30 Aug 2021 16:37:08 +0000 (09:37 -0700)]
venus: add and use VN_CS_ENCODER_INITIALIZER

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: init experimental features before the ring
Chia-I Wu [Mon, 30 Aug 2021 05:02:16 +0000 (22:02 -0700)]
venus: init experimental features before the ring

We can no longer use
vn_call_vkGetVenusExperimentalFeatureData100000MESA which requires the
ring to be initialized.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: support reply shmem without ring
Chia-I Wu [Mon, 30 Aug 2021 05:07:24 +0000 (22:07 -0700)]
venus: support reply shmem without ring

Let vn_instance_get_reply_shmem_locked use the renderer if it is called
before the ring is initialized.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: add vn_renderer_submit_simple_sync
Chia-I Wu [Mon, 30 Aug 2021 05:52:00 +0000 (22:52 -0700)]
venus: add vn_renderer_submit_simple_sync

It submits a command stream to the renderer and waits.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: init roundtrip fields in vn_instance later
Chia-I Wu [Mon, 30 Aug 2021 04:56:15 +0000 (21:56 -0700)]
venus: init roundtrip fields in vn_instance later

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agovenus: reorder version fields in vn_instance
Chia-I Wu [Mon, 30 Aug 2021 04:58:57 +0000 (21:58 -0700)]
venus: reorder version fields in vn_instance

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>

2 years agodocs: Update Windows llvmpipe doc for driver split
Jesse Natalie [Wed, 1 Sep 2021 14:28:30 +0000 (07:28 -0700)]
docs: Update Windows llvmpipe doc for driver split

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agowgl: Refactor drivers to a libgallium_wgl.dll
Jesse Natalie [Wed, 1 Sep 2021 14:07:57 +0000 (07:07 -0700)]
wgl: Refactor drivers to a libgallium_wgl.dll

I'd like to support EGL on Windows, using the same architecture as Linux.
On Linux, libgallium_dri.so is a "megadriver," containing the Mesa Gallium
state tracker, plus the actual driver implementations.

Now, on Windows, libgallium_wgl.dll is a proper OpenGL ICD, and OpenGL32.dll
is just a stub DLL which implements the wgl* APIs in terms of that ICD.

This is the more "architecturally clean" way to share the state tracker
between EGL and WGL.

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agowgl: Make overridden entrypoints local to stw_ext_context
Jesse Natalie [Fri, 3 Sep 2021 22:41:48 +0000 (15:41 -0700)]
wgl: Make overridden entrypoints local to stw_ext_context

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agowgl: Move wgl* non-extension definitions to libgl-gdi
Jesse Natalie [Wed, 1 Sep 2021 14:06:49 +0000 (07:06 -0700)]
wgl: Move wgl* non-extension definitions to libgl-gdi

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agowgl: Move opengl32.def to target instead of frontend
Jesse Natalie [Wed, 1 Sep 2021 14:04:02 +0000 (07:04 -0700)]
wgl: Move opengl32.def to target instead of frontend

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agowgl: Don't use BUILD_GL32 for wgl frontend
Jesse Natalie [Wed, 1 Sep 2021 14:01:31 +0000 (07:01 -0700)]
wgl: Don't use BUILD_GL32 for wgl frontend

The set of GL exports from OpenGL32.dll is controlled by a .def file,
there's no need to also use __declspec(dllexport) for all of them.

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agostatic-glapi: Fix MSVC preprocessor definitions
Jesse Natalie [Wed, 1 Sep 2021 13:58:14 +0000 (06:58 -0700)]
static-glapi: Fix MSVC preprocessor definitions

Previously, any DLL which links any function from libglapi-static would
end up exporting the entire GL API surface area, due to the dllexport
introduced by BUILD_GL32. This fix allows DLLs to internally include
definitions of gl* APIs without having to export the entire surface.

Also, remove unreachable with_shared_glapi branch already in an else block.

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agowgl: Fix unit test when using shared glapi
Jesse Natalie [Fri, 3 Sep 2021 22:43:15 +0000 (15:43 -0700)]
wgl: Fix unit test when using shared glapi

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agomapi: Fix shared-glapi build with MSVC
Jesse Natalie [Wed, 1 Sep 2021 13:57:40 +0000 (06:57 -0700)]
mapi: Fix shared-glapi build with MSVC

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

2 years agoglx: Prevent crashes when an extension isn't found
Corentin Noël [Tue, 7 Sep 2021 15:53:41 +0000 (17:53 +0200)]
glx: Prevent crashes when an extension isn't found

Avoid a NULL-pointer dereference.

Fixes: 2c8a85b712e ("glx: Stash a copy of the XExtCodes in the glx_display")
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12751>

2 years agofreedreno/ir3: Update physical_predecessors for streamout block
Rob Clark [Tue, 7 Sep 2021 22:23:56 +0000 (15:23 -0700)]
freedreno/ir3: Update physical_predecessors for streamout block

Caught by newly added ir3_validate checks.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742>

2 years agofreedreno/ir3: Improve error msg for block level validation
Rob Clark [Tue, 7 Sep 2021 21:45:51 +0000 (14:45 -0700)]
freedreno/ir3: Improve error msg for block level validation

Printing whatever happened to be the last instruction is misleading.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742>

2 years agofreedreno/ir3: Validate physical successors
Rob Clark [Tue, 7 Sep 2021 21:21:40 +0000 (14:21 -0700)]
freedreno/ir3: Validate physical successors

Each block's physical successors should be a superset of the logical
successors.

Also validate that the successors are sane (ie. we shouldn't have the
2nd one if we don't have the first)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742>