platform/upstream/mesa.git
2 years agoglthread: only log glthread destroy reason when it's not NULL
Pierre-Eric Pelloux-Prayer [Thu, 16 Dec 2021 11:09:16 +0000 (12:09 +0100)]
glthread: only log glthread destroy reason when it's not NULL

Fixes: 670759a208d ("glthread: inline _mesa_glthread_restore_dispatch and merge disable & destroy")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14226>

2 years agoradeonsi: don't use perp. end caps when line smoothing is on
Pierre-Eric Pelloux-Prayer [Thu, 16 Dec 2021 11:06:52 +0000 (12:06 +0100)]
radeonsi: don't use perp. end caps when line smoothing is on

The line smoothing algorithm causes the diagonal line to be visible.

See: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13700#note_1187405

Fixes: 45717780082 ("radeonsi: set PERPENDICULAR_ENDCAP_ENA for wide AA lines")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14226>

2 years agoaco: fix check_vop3_operands() for f16vec2 ffma fneg combine
Rhys Perry [Thu, 16 Dec 2021 15:47:53 +0000 (15:47 +0000)]
aco: fix check_vop3_operands() for f16vec2 ffma fneg combine

For v_pk_fma_f16, we should consider all three operands, not the first
two.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 15a375b4c86 ("radv,aco: don't lower some ffma instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14229>

2 years agonir/print: print const value near each use of const ssa variable
Marcin Ślusarz [Fri, 19 Nov 2021 14:47:56 +0000 (15:47 +0100)]
nir/print: print const value near each use of const ssa variable

Without/with NIR_DEBUG=print,print_const:

-vec4 32 ssa_60 = fadd ssa_59, ssa_58
+vec4 32 ssa_60 = fadd ssa_59 /*(0xbf800000, 0x3e800000, 0x00000000, 0x3f800000) = (-1.000000, 0.250000, 0.000000, 1.000000)*/, ssa_58

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13880>

2 years agonir/print: group hex and float vectors together
Marcin Ślusarz [Fri, 19 Nov 2021 14:35:37 +0000 (15:35 +0100)]
nir/print: group hex and float vectors together

Vectors are much easier to follow in this format, because developer cares
either about hex or float values, never both.

Before/after:

-vec4 32 ssa_222 = load_const (0x00000000 /* 0.000000 */, 0x00000000 /* 0.000000 */, 0x3f800000 /* 1.000000 */, 0x3f800000 /* 1.000000 */)
+vec4 32 ssa_222 = load_const (0x00000000, 0x00000000, 0x3f800000, 0x3f800000) = (0.000000, 0.000000, 1.000000, 1.000000)

-vec1 32 ssa_174 = load_const (0xbf800000 /* -1.000000 */)
+vec1 32 ssa_174 = load_const (0xbf800000 = -1.000000)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13880>

2 years agonir/print: move print_load_const_instr up
Marcin Ślusarz [Fri, 19 Nov 2021 14:28:49 +0000 (15:28 +0100)]
nir/print: move print_load_const_instr up

... to avoid forward declarations in future commit

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13880>

2 years agobroadcom/ci: restructure expected results
Juan A. Suarez Romero [Tue, 30 Nov 2021 09:03:29 +0000 (10:03 +0100)]
broadcom/ci: restructure expected results

Sort/rename the files so expected tests are classified by device.

No need to split the tests by driver (e.g., V3D vs V3DV).

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13983>

2 years agoradv/amdgpu: Only wait on queue_syncobj when needed.
Bas Nieuwenhuizen [Thu, 16 Dec 2021 00:01:27 +0000 (01:01 +0100)]
radv/amdgpu: Only wait on queue_syncobj when needed.

If signalled on the same queue it is totally useless, so only wait
if we have a syncobj that is explicitly being waited on, which can
be from potentially another queue/ctx. (Ideally we'd check but there
is no way to do so currently. Might revisit when we integrate the
common sync framework)

Fixes: 7675d066caa ("radv/amdgpu: Add support for submitting 0 commandbuffers.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14214>

2 years agoanv: Drop anv_sync_create_for_bo
Jason Ekstrand [Thu, 16 Dec 2021 20:27:50 +0000 (14:27 -0600)]
anv: Drop anv_sync_create_for_bo

The older helper is unused so we can roll it all into
anv_create_sync_for_memory.

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

2 years agoanv,wsi: simplify WSI synchronization
Lionel Landwerlin [Wed, 15 Dec 2021 09:52:44 +0000 (11:52 +0200)]
anv,wsi: simplify WSI synchronization

Rather than using 2 vfuncs, use one since we've unified the
synchronization framework in the runtime with a single vk_sync object.

v2 (Jason Ekstrand):
 - create_sync_for_memory is now in vk_device

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agoanv: Implement vk_device::create_sync_for_memory
Jason Ekstrand [Thu, 16 Dec 2021 20:14:19 +0000 (14:14 -0600)]
anv: Implement vk_device::create_sync_for_memory

Fixes: 36ea90a3619f ("anv: Convert to the common sync and submit framework")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agovulkan/queue: Handle WSI memory signal information
Jason Ekstrand [Thu, 16 Dec 2021 16:29:03 +0000 (10:29 -0600)]
vulkan/queue: Handle WSI memory signal information

We handle it by asking the driver to create a vk_sync that wraps a
VkDeviceMemory object and gets passed as one of the signal ops.

Fixes: 9bffd81f1cb7 ("vulkan: Add common implementations of vkQueueSubmit and vkQueueWaitIdle")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agovulkan: fix missing handling of WSI memory signal
Lionel Landwerlin [Wed, 15 Dec 2021 09:08:17 +0000 (11:08 +0200)]
vulkan: fix missing handling of WSI memory signal

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b996fa8efaa4 ("anv: implement VK_KHR_synchronization2")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5744
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agointel/stub: Implement shell versions of DRM_I915_GEM_GET_TILING and DRM_I915_SEM_GET_...
Ian Romanick [Thu, 16 Dec 2021 01:53:04 +0000 (17:53 -0800)]
intel/stub: Implement shell versions of DRM_I915_GEM_GET_TILING and DRM_I915_SEM_GET_TILING

This is necessary to use intel_stub_gpu with Crocus.

v2: Remove unused i915_bo::swizzle_mode. Noticed by Emma.

Fixes: 953a4ca6fec ("intel: Add has_bit6_swizzle to devinfo")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14218>

2 years agointel/stub: Silence "initialized field overwritten" warning
Ian Romanick [Thu, 9 Dec 2021 20:06:39 +0000 (12:06 -0800)]
intel/stub: Silence "initialized field overwritten" warning

src/intel/tools/intel_noop_drm_shim.c:459:36: warning: initialized field overwritten [-Woverride-init]
  459 |    [DRM_I915_GEM_EXECBUFFER2_WR] = i915_ioctl_noop,
      |                                    ^~~~~~~~~~~~~~~

Fixes: 0f4f1d70bfe ("intel: add stub_gpu tool")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14218>

2 years agoci/freedreno: Add known flakes from the last month.
Emma Anholt [Thu, 16 Dec 2021 22:14:09 +0000 (14:14 -0800)]
ci/freedreno: Add known flakes from the last month.

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

2 years agoglx: Fix GLX_NV_float_buffer fbconfig handling
Adam Jackson [Wed, 16 Jun 2021 18:01:04 +0000 (14:01 -0400)]
glx: Fix GLX_NV_float_buffer fbconfig handling

Since we didn't record this attribute from the server, we wouldn't
account for it in glXChooseFBConfig, and glXGetFBConfigAttrib wouldn't
know about it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14221>

2 years agovenus: add some trace points
Chia-I Wu [Mon, 17 May 2021 17:25:52 +0000 (10:25 -0700)]
venus: add some trace points

Add trace points for

 - vn_AcquireNextImage2KHR and vn_QueuePresentKHR
 - vn_AcquireImageANDROID and vn_QueueSignalReleaseImageANDROID
 - vn_BeginCommandBuffer and vn_EndCommandBuffer
 - vn_*Wait*
 - vn_Queue*
 - vn_instance_wait_roundtrip
 - shmem allocations and cache miss/skip

v2: fix cache miss/skip trace points (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/14215>

2 years agomeson: correctly detect linker arguments
Michel Zou [Thu, 25 Nov 2021 20:51:07 +0000 (21:51 +0100)]
meson: correctly detect linker arguments

Fixes: 22673a98 ("meson: Check arguments before adding")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13961>

2 years agor300: Remove unused RC_OPCODE_DPH
Emma Anholt [Wed, 8 Dec 2021 20:30:20 +0000 (12:30 -0800)]
r300: Remove unused RC_OPCODE_DPH

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_SFL
Emma Anholt [Wed, 8 Dec 2021 20:28:43 +0000 (12:28 -0800)]
r300: Remove unused RC_OPCODE_SFL

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_CLAMP.
Emma Anholt [Wed, 8 Dec 2021 20:24:13 +0000 (12:24 -0800)]
r300: Remove unused RC_OPCODE_CLAMP.

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_SWZ.
Emma Anholt [Wed, 8 Dec 2021 20:21:11 +0000 (12:21 -0800)]
r300: Remove unused RC_OPCODE_SWZ.

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_XPD.
Emma Anholt [Wed, 8 Dec 2021 20:19:56 +0000 (12:19 -0800)]
r300: Remove unused RC_OPCODE_XPD.

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_ABS.
Emma Anholt [Wed, 8 Dec 2021 20:17:43 +0000 (12:17 -0800)]
r300: Remove unused RC_OPCODE_ABS.

Nothing generates it in the backend.

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

2 years agor300: Remove support for SCS.
Emma Anholt [Wed, 8 Dec 2021 19:51:30 +0000 (11:51 -0800)]
r300: Remove support for SCS.

Nothing generates this meta-op in the backend, so we don't need it.

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

2 years agor300: Remove some dead compiler code.
Emma Anholt [Wed, 8 Dec 2021 19:45:22 +0000 (11:45 -0800)]
r300: Remove some dead compiler code.

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

2 years agonir/print: compact printing of intrinsic indices
Marcin Ślusarz [Tue, 19 Oct 2021 09:27:40 +0000 (11:27 +0200)]
nir/print: compact printing of intrinsic indices

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>

2 years agonir/print: expand printing of io semantics.gs_streams
Marcin Ślusarz [Mon, 18 Oct 2021 13:40:13 +0000 (15:40 +0200)]
nir/print: expand printing of io semantics.gs_streams

gs_streams can be set for at least 2 other intrinsics.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>

2 years agonir/print: simplify printing of IO semantics
Marcin Ślusarz [Mon, 18 Oct 2021 13:29:23 +0000 (15:29 +0200)]
nir/print: simplify printing of IO semantics

Some of the tested flags are set for other intrinsics and they are
printed only when set, so there's no point in checking exact intrinsic
name or shader stage.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>

2 years agointel/compiler: Use uppercase enum values in brw_ir_performance.cpp
Kenneth Graunke [Thu, 4 Jun 2020 01:06:45 +0000 (18:06 -0700)]
intel/compiler: Use uppercase enum values in brw_ir_performance.cpp

This is by far the more common style in Mesa.  It also gives a cue that
e.g. num_dependency_ids is a fixed definition rather than some kind of
local variable maintaining a count.

While hre, we also rename the enums to have full prefixes to prepare for
a future where we use them in multiple files for future backend work.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14182>

2 years agointel/vec4: Inline emit_texture and move helpers to brw_vec4_nir.cpp
Kenneth Graunke [Tue, 14 Dec 2021 00:52:57 +0000 (16:52 -0800)]
intel/vec4: Inline emit_texture and move helpers to brw_vec4_nir.cpp

emit_texture() only has one caller, nir_emit_texture().  We may as well
inline that.  Move the associated helper functions for emitting sampler
messages there as well, to keep associated code nearby.

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

2 years agointel/vec4: Use nir_texop in emit_texture instead of translating
Kenneth Graunke [Tue, 14 Dec 2021 00:46:23 +0000 (16:46 -0800)]
intel/vec4: Use nir_texop in emit_texture instead of translating

We eliminated the GLSL IR -> vec4 backend ages ago, so the only caller
uses a nir_texop enum.  Drop a layer of translating.

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

2 years agointel/vec4: Use ir_texture_opcode less in emit_texture()
Kenneth Graunke [Tue, 14 Dec 2021 00:35:46 +0000 (16:35 -0800)]
intel/vec4: Use ir_texture_opcode less in emit_texture()

This replaces a bunch of uses of the GLSL IR ir_texture_opcode enum with
the backend opcode, in preparation for removing it altogether.

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

2 years agoradv,aco: do not disable anisotropy filtering for non-mipmap images
Samuel Pitoiset [Mon, 13 Dec 2021 10:13:40 +0000 (11:13 +0100)]
radv,aco: do not disable anisotropy filtering for non-mipmap images

This fixes
dEQP-VK.texture.filtering_anisotropy.single_level.anisotropy_*.mag_linear_min_linear.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14171>

2 years agoac/nir: add an option to disable anisotropic filtering for single level images
Samuel Pitoiset [Mon, 13 Dec 2021 16:39:01 +0000 (17:39 +0100)]
ac/nir: add an option to disable anisotropic filtering for single level images

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14171>

2 years agoglx: fix querying GLX_FBCONFIG_ID for Window
Pierre-Eric Pelloux-Prayer [Mon, 13 Dec 2021 14:07:13 +0000 (15:07 +0100)]
glx: fix querying GLX_FBCONFIG_ID for Window

This commit fixes apps using the following sequence:
1. XCreateWindow(dpy) -> win
2. glXCreateContextAttribsARB(dpy, ...) -> ctx
3. glXMakeCurrent(dpy, win, ctx)
4. glXQueryDrawable(dpy, win, GLX_FBCONFIG_ID, ...)

glXQueryDrawable returned 0 (while correctly returning a valid
GLXFCONFIG_ID for other types of drawables).

This commit adds the same dance as driInferDrawableConfig to get
the GLX visual from the Window, and then the GLXFBCONFIG_ID of
this visual.

This fixes:
* piglit: glx-query-drawable --attr=GLX_FBCONFIG_ID --type=WINDOW
* Maya which uses the config ID from step 4 as an input to
glXChooseFBConfig.

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

2 years agodri: Remove unused driGetRendererString
Adam Jackson [Thu, 9 Dec 2021 20:53:27 +0000 (15:53 -0500)]
dri: Remove unused driGetRendererString

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agodri: Remove unused driUpdateFramebufferSize
Adam Jackson [Thu, 9 Dec 2021 20:52:07 +0000 (15:52 -0500)]
dri: Remove unused driUpdateFramebufferSize

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agodri: Remove unused driContextSetFlags
Adam Jackson [Thu, 9 Dec 2021 20:51:30 +0000 (15:51 -0500)]
dri: Remove unused driContextSetFlags

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agomesa: Remove unused _mesa_initialize_visual
Adam Jackson [Thu, 9 Dec 2021 20:20:58 +0000 (15:20 -0500)]
mesa: Remove unused _mesa_initialize_visual

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agoanv, iris: Implement Wa_14014890652 for DG2
Sagar Ghuge [Fri, 10 Sep 2021 22:17:54 +0000 (15:17 -0700)]
anv, iris: Implement Wa_14014890652 for DG2

Workaround is to set:

3DSTATE_VFG::GranularityThresholdDisable = 1
3DSTATE_VFG::DistributionGranularity = BATCH
3DSTATE_VF::GeometryDistributionEnable = 1

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>

2 years agoanv, iris: Add Wa_22011440098 for DG2
Anuj Phogat [Wed, 12 May 2021 17:42:41 +0000 (10:42 -0700)]
anv, iris: Add Wa_22011440098 for DG2

Rework:
 * Jordan: Set MOCS after
   7b78b2fcac6 ("intel/genxml: Assert that all MOCS fields are non-zero on Gfx7+")

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
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/14212>

2 years agoanv, iris: Add Wa_16011773973 for DG2
Anuj Phogat [Tue, 4 May 2021 00:39:28 +0000 (17:39 -0700)]
anv, iris: Add Wa_16011773973 for DG2

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>

2 years agoRevert "nir: disable a NIR test due to undebuggable & locally unreproducible CI failures"
Caio Oliveira [Wed, 15 Dec 2021 09:31:53 +0000 (01:31 -0800)]
Revert "nir: disable a NIR test due to undebuggable & locally unreproducible CI failures"

This reverts commit 6eb3fe2d4fa2c42d7ee1e20b390b3117a8980eaf.  The root cause was
a bug in Meson when using the new gtest protocol and a test failed before producing
the XML file expected by it.  This was fixed in later versions of Meson, so
we've bumped the required meson version to use that feature.  The failure should
now be properly identified, so re-enabling the NIR test.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>

2 years agomeson: Bump version required for gtest protocol
Caio Oliveira [Wed, 15 Dec 2021 09:30:36 +0000 (01:30 -0800)]
meson: Bump version required for gtest protocol

The feature was added in 0.55 but there was a bug when tests
crashed (and no XML file was generated) that was only fixed in 0.59.2.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>

2 years agonir: Initialize nir_register::divergent
Caio Oliveira [Wed, 15 Dec 2021 08:47:36 +0000 (00:47 -0800)]
nir: Initialize nir_register::divergent

Fixes: c7fc44f9ebb ("nir/from_ssa: Respect and populate divergence information")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14205>

2 years agonir_to_tgsi: Set the TGSI Precise flag for exact ALU instructions.
Emma Anholt [Tue, 14 Dec 2021 23:51:13 +0000 (15:51 -0800)]
nir_to_tgsi: Set the TGSI Precise flag for exact ALU instructions.

This flag is used by the nv50, r600, and svga backends for instruction
exactness.  It was easier to plumb it in as an override in tgsi_ureg than
to make all of ALU instruction emit do it.

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

2 years agomesa: OpenGL 1.3 and OpenGL ES 1.0 are not optional
Ian Romanick [Wed, 15 Dec 2021 01:19:01 +0000 (17:19 -0800)]
mesa: OpenGL 1.3 and OpenGL ES 1.0 are not optional

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_env_dot3 is not optional
Ian Romanick [Wed, 15 Dec 2021 01:18:37 +0000 (17:18 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_env_dot3 is not optional

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_env_combine is not optional
Ian Romanick [Wed, 15 Dec 2021 01:10:43 +0000 (17:10 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_env_combine is not optional

v2: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, and GL_ONE_MINUS_SRC_ALPHA
should always be supported now. Noticed by Marek.

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optional
Ian Romanick [Wed, 15 Dec 2021 01:06:49 +0000 (17:06 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optional

Cheatsheet:

_mesa_has_ARB_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGL_COMPAT and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGL_COMPAT).

_mesa_has_OES_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGLES and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGLES).

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optional
Ian Romanick [Wed, 15 Dec 2021 00:43:32 +0000 (16:43 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optional

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

2 years agointel/fs: Use HF as destination type for F32TOF16 in fquantize2f16
Ian Romanick [Thu, 9 Dec 2021 23:25:20 +0000 (15:25 -0800)]
intel/fs: Use HF as destination type for F32TOF16 in fquantize2f16

Having an integer destination type instead of a float destination type
confuses the SWSB code.  This causes problems on some Intel GPUs.  Fix
this by using the correct type in the destination of the F32TOF16
opcode.

Gfx7 doesn't have the HF type, so continue to emit W on that platform.
The assertions in brw_F32TO16 (brw_eu_emit.c) are updated to reflect
this.  In scalar mode, UD is never emitted as a destination type for
this opcode, so remove it from the allowed types in the assertion.

I also condidered doing something like de55fd358fa ("intel/fs/xehp:
Teach SWSB pass about the exec pipeline of
FS_OPCODE_PACK_HALF_2x16_SPLIT."), but Curro recommended that just using
the correct types is a better fix.  I agree.

v2: Add missing changes to fs_generator::generate_pack_half_2x16_split.
I'm not sure how I (and the Intel CI) missed that the first time. :(

v3: Fix copy-and-paste issue in the v2 fix. Noticed by Tapani.

Reviewed-by: Francisco Jerez <currojerez@riseup.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14181>

2 years agovenus: cache shmems
Chia-I Wu [Fri, 10 Dec 2021 23:38:05 +0000 (15:38 -0800)]
venus: cache shmems

Shmems are allocated internally and are only for CPU access.  They can
be easily cached.

Venus have 4 sources of shmem allocations

 - the ring buffer
 - the reply stream
 - the indirection submission upload cs
 - one cs for each vn_command_buffer

The first one is allocated only once.  The other three reallocate
occasionally.  The frequencies depend on the workloads.

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

2 years agovenus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer
Chia-I Wu [Wed, 8 Dec 2021 23:55:12 +0000 (15:55 -0800)]
venus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer

It suballocates from a shmem pool owned by vn_instance.  The goals are
to speed up shmem allocations for VkCommandBuffer and to reduce the
number of BOs.  Both are crucial when shmems are HOST3D BOs, because
they require roundtrips to the renderer to allocate and they take up KVM
memslots.

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

2 years agovenus: add vn_cs_encoder_storage_type
Chia-I Wu [Wed, 8 Dec 2021 23:24:04 +0000 (15:24 -0800)]
venus: add vn_cs_encoder_storage_type

It generalizes cs->indirect.

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

2 years agovenus: use vn_renderer_shmem_pool for reply shmems
Chia-I Wu [Fri, 10 Dec 2021 01:08:15 +0000 (17:08 -0800)]
venus: use vn_renderer_shmem_pool for reply shmems

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

2 years agovenus: add vn_renderer_shmem_pool
Chia-I Wu [Wed, 8 Dec 2021 23:32:19 +0000 (15:32 -0800)]
venus: add vn_renderer_shmem_pool

It provides shmem suballocations.  It is designed to be used with
short-lived shmems.  A long-lived shmem can hold on to some large
allocation while only using a likely small region of the large
allocation.

v2: cleanups suggested by Yiwei

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

2 years agovenus: add vn_renderer_util.[ch]
Chia-I Wu [Thu, 9 Dec 2021 22:12:01 +0000 (14:12 -0800)]
venus: add vn_renderer_util.[ch]

Move helpers built on top of vn_renderer.h to the new files.

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

2 years agomesa: inline mesa_initialize_buffer_object.
Dave Airlie [Thu, 9 Dec 2021 04:23:56 +0000 (14:23 +1000)]
mesa: inline mesa_initialize_buffer_object.

This has no other users now.

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

2 years agomesa/st: remove st_cb_bufferobjects*
Dave Airlie [Thu, 9 Dec 2021 04:05:58 +0000 (14:05 +1000)]
mesa/st: remove st_cb_bufferobjects*

this has all been merged into mesa now

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

2 years agomesa/bufferobj: move invalidate buffer to optional feature
Dave Airlie [Thu, 9 Dec 2021 03:57:08 +0000 (13:57 +1000)]
mesa/bufferobj: move invalidate buffer to optional feature

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

2 years agomesa/st: rename access flag to transfer flag function
Dave Airlie [Thu, 9 Dec 2021 03:55:32 +0000 (13:55 +1000)]
mesa/st: rename access flag to transfer flag function

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

2 years agobufferobj: cleanup subdata copies
Dave Airlie [Thu, 9 Dec 2021 03:41:42 +0000 (13:41 +1000)]
bufferobj: cleanup subdata copies

This moves the common dst min/max invalidation and renames
to be a bit more consistent

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

2 years agobufferobj: inline page commitment
Dave Airlie [Thu, 9 Dec 2021 03:38:14 +0000 (13:38 +1000)]
bufferobj: inline page commitment

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

2 years agobufferobj: inline buffer clearing
Dave Airlie [Thu, 9 Dec 2021 03:36:59 +0000 (13:36 +1000)]
bufferobj: inline buffer clearing

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

2 years agobufferobj: make sw clear buffer static, move it and rename it
Dave Airlie [Thu, 9 Dec 2021 03:30:59 +0000 (13:30 +1000)]
bufferobj: make sw clear buffer static, move it and rename it

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

2 years agomesa/bufferobj: rename bufferobj functions to be more consistent.
Dave Airlie [Thu, 9 Dec 2021 03:24:54 +0000 (13:24 +1000)]
mesa/bufferobj: rename bufferobj functions to be more consistent.

After all the refactoring, start consolidating a bit and get the API
names more consistent

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

2 years agomesa/st: make static the buffer object funcs that can be
Dave Airlie [Thu, 9 Dec 2021 03:04:33 +0000 (13:04 +1000)]
mesa/st: make static the buffer object funcs that can be

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

2 years agomesa/st: migrate most of state tracker buffer objects into mesa
Dave Airlie [Thu, 9 Dec 2021 03:00:08 +0000 (13:00 +1000)]
mesa/st: migrate most of state tracker buffer objects into mesa

This moves all of non-optional st functions into the main bufferobj.c
file.

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

2 years agomesa: add pointer to cso_context to gl_context
Dave Airlie [Thu, 9 Dec 2021 19:13:14 +0000 (05:13 +1000)]
mesa: add pointer to cso_context to gl_context

Makes migrating code easier

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

2 years agomesa: add a pointer to st_config_options to gl_context
Dave Airlie [Thu, 9 Dec 2021 02:51:47 +0000 (12:51 +1000)]
mesa: add a pointer to st_config_options to gl_context

Allows porting out of st code easier

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

2 years agomesa: add a pipe_context pointer to gl context
Dave Airlie [Thu, 9 Dec 2021 02:46:51 +0000 (12:46 +1000)]
mesa: add a pipe_context pointer to gl context

This will be used to move more code over

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

2 years agomesa/st: start moving bufferobject alloc/free/reference to main.
Dave Airlie [Thu, 9 Dec 2021 01:58:35 +0000 (11:58 +1000)]
mesa/st: start moving bufferobject alloc/free/reference to main.

This moves these out of the state tracker code

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

2 years agomesa/st: merge st buffer object into GL
Dave Airlie [Thu, 9 Dec 2021 01:37:58 +0000 (11:37 +1000)]
mesa/st: merge st buffer object into GL

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

2 years agobroadcom/compiler: avoid unneeded sint/unorm clamping when lowering stores
Alejandro Piñeiro [Mon, 13 Dec 2021 14:25:47 +0000 (15:25 +0100)]
broadcom/compiler: avoid unneeded sint/unorm clamping when lowering stores

They are being used on integer to integer stores. From Vulkan sec,
final paragraph of 16.4.4 "Texel Output Format Conversion":
    "Each component is converted based on its type and size (as
     defined in the Format Definition section for each
     VkFormat). ... Integer outputs are converted such that their value
     is preserved. The converted value of any integer that cannot be
     represented in the target format is undefined."

I didn't find a equivalent quote for OpenGL as all conversion entries
are forcused on float to integer, fixed-point to integer, etc, and not
on integer to integer. Didn't find any test failure with this change.

We didn't get any shader-db stats change with shaderdb (even
overriding to OpenGL 4.4 to get more shaders built), so as a reference
Vulkan shader-db stats with the pattern
dEQP-VK.image.*.with_format.*.*
   total instructions in shared programs: 37534 -> 36522 (-2.70%)
   instructions in affected programs: 12080 -> 11068 (-8.38%)
   helped: 241
   HURT: 0
   Instructions are helped.

   total uniforms in shared programs: 9100 -> 8550 (-6.04%)
   uniforms in affected programs: 3004 -> 2454 (-18.31%)
   helped: 229
   HURT: 0

   total max-temps in shared programs: 6110 -> 6014 (-1.57%)
   max-temps in affected programs: 402 -> 306 (-23.88%)
   helped: 43
   HURT: 0
   Max-temps are helped.

   total nops in shared programs: 1523 -> 1526 (0.20%)
   nops in affected programs: 21 -> 24 (14.29%)
   helped: 3
   HURT: 6
   Inconclusive result (value mean confidence interval includes 0).

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

2 years agoradv/winsys: update sparse mappings with OP_REPLACE instead of OP_MAP/OP_UNMAP
Samuel Pitoiset [Tue, 14 Dec 2021 08:54:07 +0000 (09:54 +0100)]
radv/winsys: update sparse mappings with OP_REPLACE instead of OP_MAP/OP_UNMAP

When the BO is NULL, AMDGPU will reset the PTE VA range to the initial
state. Otherwise, it will first unmap all existing VA that overlap the
requested range and then map. This seems better than using MAP/UNMAP.

This reduces stuttering in Forza Horizon 5.

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

2 years agoradv/winsys: stop using reference counting for virtual BOs
Samuel Pitoiset [Mon, 6 Dec 2021 17:43:27 +0000 (18:43 +0100)]
radv/winsys: stop using reference counting for virtual BOs

This shouldn't be necessary because applications have to manage
resources and memory themselves.

This also prevented memory to be freed if an application doesn't unbind
a sparse memory object and free it, which is legal as long as the
resource isn't used afterwards.

This was introduced to unmap the sparse mappings when destroying
a virtual BO, but now that the driver uses OP_CLEAR it's no longer
needed.

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

2 years agoradv/winsys: clear the PRT VA range when destroying a virtual BO
Samuel Pitoiset [Mon, 6 Dec 2021 17:35:19 +0000 (18:35 +0100)]
radv/winsys: clear the PRT VA range when destroying a virtual BO

Instead of unmapping every range.

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

2 years agoradv/winsys: remove useless has_sparse_vm_mappings checks
Samuel Pitoiset [Mon, 6 Dec 2021 17:32:46 +0000 (18:32 +0100)]
radv/winsys: remove useless has_sparse_vm_mappings checks

Sparse is only exposed on GFX8+, so this is always TRUE.

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

2 years agoRevert "anv: Stop doing too much per-sample shading"
Jason Ekstrand [Tue, 14 Dec 2021 17:55:06 +0000 (11:55 -0600)]
Revert "anv: Stop doing too much per-sample shading"

This reverts commit 1f559930b6b7a633d93cd4e9cc4965b3f5e7c607.  Turns
out, this approach won't work.

Fixes: 1f559930b6b7 ("anv: Stop doing too much per-sample shading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14196>

2 years agomesa: use nop dispatch for ColorTable/Convolution/Histogram
Marek Olšák [Tue, 7 Dec 2021 22:50:35 +0000 (17:50 -0500)]
mesa: use nop dispatch for ColorTable/Convolution/Histogram

The nop dispatch generates GL_INVALID_OPERATION too.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa: remove all GL func forward declarations because they are autogenerated
Marek Olšák [Tue, 7 Dec 2021 21:48:11 +0000 (16:48 -0500)]
mesa: remove all GL func forward declarations because they are autogenerated

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa,vbo: make ES wrapper functions static
Marek Olšák [Tue, 14 Dec 2021 17:11:09 +0000 (12:11 -0500)]
mesa,vbo: make ES wrapper functions static

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglapi: add missing no_error settings for implemented functions
Marek Olšák [Tue, 14 Dec 2021 17:02:32 +0000 (12:02 -0500)]
glapi: add missing no_error settings for implemented functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa: remove COPY_DISPATCH code that doesn't do anything
Marek Olšák [Thu, 2 Dec 2021 00:55:30 +0000 (19:55 -0500)]
mesa: remove COPY_DISPATCH code that doesn't do anything

When we get into create_beginend_table, ctx->Exec only contains nops
set by _mesa_alloc_dispatch_table. This function calls
_mesa_alloc_dispatch_table too, so table and ctx->Exec are identical,
and then it copies identical entries from one table to the other.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa: rename _ae_ArrayElement -> _mesa_ArrayElement to match glapi
Marek Olšák [Wed, 1 Dec 2021 21:59:23 +0000 (16:59 -0500)]
mesa: rename _ae_ArrayElement -> _mesa_ArrayElement to match glapi

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa: use ctx->GLThread.enabled now that it's correct
Marek Olšák [Mon, 29 Nov 2021 19:04:42 +0000 (14:04 -0500)]
mesa: use ctx->GLThread.enabled now that it's correct

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglthread: disable glthread if the context is lost
Marek Olšák [Tue, 30 Nov 2021 13:28:35 +0000 (08:28 -0500)]
glthread: disable glthread if the context is lost

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglthread: fix restoring the dispatch in destroy when the context is not current
Marek Olšák [Mon, 29 Nov 2021 18:51:23 +0000 (13:51 -0500)]
glthread: fix restoring the dispatch in destroy when the context is not current

also remove an invalid comment in mtypes.h

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglthread: inline _mesa_glthread_restore_dispatch and merge disable & destroy
Marek Olšák [Mon, 29 Nov 2021 18:58:59 +0000 (13:58 -0500)]
glthread: inline _mesa_glthread_restore_dispatch and merge disable & destroy

No change in behavior.

This fixes ctx->GLThread.enabled, which was only set to false by destroy.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglthread: set marshal functions in dispatch only if they exist in the API
Marek Olšák [Mon, 29 Nov 2021 00:39:45 +0000 (19:39 -0500)]
glthread: set marshal functions in dispatch only if they exist in the API

We now have proper nop dispatch for the unset functions.

The autogenerated code looks like this:

   if ((ctx->API == API_OPENGLES2 && ctx->Version >= 31)) {
      if (_gloffset_DepthRangeArrayfvOES >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_DepthRangeArrayfvOES] = (_glapi_proc)_mesa_marshal_DepthRangeArrayfvOES;
      if (_gloffset_DepthRangeIndexedfOES >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_DepthRangeIndexedfOES] = (_glapi_proc)_mesa_marshal_DepthRangeIndexedfOES;
   }
   if (_mesa_is_desktop_gl(ctx)) {
      if (_gloffset_AlphaToCoverageDitherControlNV >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_AlphaToCoverageDitherControlNV] = (_glapi_proc)_mesa_marshal_AlphaToCoverageDitherControlNV;
      if (_gloffset_AttachObjectARB >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_AttachObjectARB] = (_glapi_proc)_mesa_marshal_AttachObjectARB;
      if (_gloffset_BeginQueryIndexed >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_BeginQueryIndexed] = (_glapi_proc)_mesa_marshal_BeginQueryIndexed;
      if (_gloffset_BindBufferOffsetEXT >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_BindBufferOffsetEXT] = (_glapi_proc)_mesa_marshal_BindBufferOffsetEXT;
   ...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglthread: add nop dispatch
Marek Olšák [Mon, 29 Nov 2021 11:11:35 +0000 (06:11 -0500)]
glthread: add nop dispatch

so that glthread behaves the same as the main dispatch.

Also fix the SetError function for GLES 1.0.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agovbo: expose all exec entrypoints for glthread and match api_exec_decl.h names
Marek Olšák [Mon, 29 Nov 2021 23:52:48 +0000 (18:52 -0500)]
vbo: expose all exec entrypoints for glthread and match api_exec_decl.h names

Autogenerated glthread code will call these directly.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa: remove GLvertexformat
Marek Olšák [Mon, 29 Nov 2021 14:02:07 +0000 (09:02 -0500)]
mesa: remove GLvertexformat

Function pointers were first set in GLvertexformat, and then
GLvertexformat was copied to the dispatch.

This just sets the function pointers in the dispatch directly,
skipping the intermediate GLvertexformat structure.

The code with SET_* calls is autogenerated by api_vtxfmt_init_h.py.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglapi: autogenerate install_vtxfmt with python
Marek Olšák [Mon, 29 Nov 2021 01:31:06 +0000 (20:31 -0500)]
glapi: autogenerate install_vtxfmt with python

This is a prerequisite for the GLvertexformat removal.

The autogenerated file looks like this:

if (_mesa_is_desktop_gl(ctx) || (ctx->API == API_OPENGLES2 && ctx->Version >= 30)) {
   SET_VertexAttribI4iEXT(tab, NAME(VertexAttribI4iEXT));
   SET_VertexAttribI4ivEXT(tab, NAME(VertexAttribI4ivEXT));
   SET_VertexAttribI4uiEXT(tab, NAME(VertexAttribI4uiEXT));
   SET_VertexAttribI4uivEXT(tab, NAME(VertexAttribI4uivEXT));
}
if (ctx->API == API_OPENGLES2) {
   SET_VertexAttrib1fARB(tab, NAME_ES(VertexAttrib1fARB));
   SET_VertexAttrib1fvARB(tab, NAME_ES(VertexAttrib1fvARB));
   SET_VertexAttrib2fARB(tab, NAME_ES(VertexAttrib2fARB));
   SET_VertexAttrib2fvARB(tab, NAME_ES(VertexAttrib2fvARB));
   SET_VertexAttrib3fARB(tab, NAME_ES(VertexAttrib3fARB));
   SET_VertexAttrib3fvARB(tab, NAME_ES(VertexAttrib3fvARB));
   SET_VertexAttrib4fARB(tab, NAME_ES(VertexAttrib4fARB));
   SET_VertexAttrib4fvARB(tab, NAME_ES(VertexAttrib4fvARB));
}
if (ctx->API == API_OPENGL_COMPAT) {
   SET_ArrayElement(tab, NAME_AE(ArrayElement));
   SET_Begin(tab, NAME(Begin));
   SET_CallList(tab, NAME_CALLLIST(CallList));
   SET_CallLists(tab, NAME_CALLLIST(CallLists));
   SET_Color3b(tab, NAME(Color3b));
   SET_Color3bv(tab, NAME(Color3bv));
   ...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglapi: autogenerate all _mesa_* forward declarations in api_exec_decl.h
Marek Olšák [Mon, 29 Nov 2021 21:27:35 +0000 (16:27 -0500)]
glapi: autogenerate all _mesa_* forward declarations in api_exec_decl.h

We could remove them from other header files now.

This purposefully omits "_exec" in _mesa_exec such as _mesa_exec_Begin
to make it pretty. Later commits will remove _exec from names, e.g. it
will become _mesa_Begin. The only other variants are really just
save_Begin (dlist) and _save_Begin (vbo).

The autogenerated file looks like this:

void GLAPIENTRY _mesa_NewList(GLuint list, GLenum mode);
void GLAPIENTRY _mesa_EndList(void);
void GLAPIENTRY _mesa_CallList(GLuint list);
void GLAPIENTRY _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists);
void GLAPIENTRY _mesa_DeleteLists(GLuint list, GLsizei range);
GLuint GLAPIENTRY _mesa_GenLists(GLsizei range);
void GLAPIENTRY _mesa_ListBase(GLuint base);
void GLAPIENTRY _mesa_Begin(GLenum mode);
void GLAPIENTRY _mesa_Bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
void GLAPIENTRY _mesa_Color3b(GLbyte red, GLbyte green, GLbyte blue);
void GLAPIENTRY _mesa_Color3bv(const GLbyte * v);
...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agomesa: remove api_exec.h and move its contents into context.h
Marek Olšák [Mon, 29 Nov 2021 21:16:51 +0000 (16:16 -0500)]
mesa: remove api_exec.h and move its contents into context.h

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>

2 years agoglapi: autogenerate api_save.h with save_* function declarations
Marek Olšák [Mon, 29 Nov 2021 12:55:42 +0000 (07:55 -0500)]
glapi: autogenerate api_save.h with save_* function declarations

This is planned to be used by glthread for its own dispatch mechanism.

The autogenerated file looks like this:

void GLAPIENTRY save_NewList(GLuint list, GLenum mode);
void GLAPIENTRY save_ListBase(GLuint base);
void GLAPIENTRY save_Bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
void GLAPIENTRY save_RasterPos2d(GLdouble x, GLdouble y);
void GLAPIENTRY save_RasterPos2dv(const GLdouble * v);
void GLAPIENTRY save_RasterPos2f(GLfloat x, GLfloat y);
void GLAPIENTRY save_RasterPos2fv(const GLfloat * v);
void GLAPIENTRY save_RasterPos2i(GLint x, GLint y);
void GLAPIENTRY save_RasterPos2iv(const GLint * v);
...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>