platform/upstream/mesa.git
3 years agozink: add barrier helper for buffer resources
Mike Blumenkrantz [Mon, 17 Aug 2020 19:07:41 +0000 (15:07 -0400)]
zink: add barrier helper for buffer resources

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8669>

3 years agoradv: fix centroid with VRS coarse shading
Samuel Pitoiset [Fri, 29 Jan 2021 08:51:26 +0000 (09:51 +0100)]
radv: fix centroid with VRS coarse shading

Ported from RadeonSI.

Cc: mesa-stable
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/8775>

3 years agoradv: re-disable TC-compat HTILE for D32S8 on all generations
Samuel Pitoiset [Fri, 29 Jan 2021 11:14:18 +0000 (12:14 +0100)]
radv: re-disable TC-compat HTILE for D32S8 on all generations

This actually introduced some VRS related regressions and some others.

Fixes: cc5b6a0e897 ("radv: enable TC-compat HTILE with D32S8 and MSAA on GFX9+")
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/8777>

3 years agointel/compiler: cache computed register pressure benefit
Marcin Ślusarz [Mon, 25 Jan 2021 17:43:06 +0000 (18:43 +0100)]
intel/compiler: cache computed register pressure benefit

This halves the number of calls to get_register_pressure_benefit
and decreases shader-db CPU time by ~1.5%.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8741>

3 years agoradeonsi/sqtt: forward string markers to sqtt
Pierre-Eric Pelloux-Prayer [Wed, 27 Jan 2021 10:59:59 +0000 (11:59 +0100)]
radeonsi/sqtt: forward string markers to sqtt

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

3 years agoradeonsi/sqtt: allow AMD_THREAD_TRACE_TRIGGER to be a frame number
Pierre-Eric Pelloux-Prayer [Wed, 27 Jan 2021 09:56:05 +0000 (10:56 +0100)]
radeonsi/sqtt: allow AMD_THREAD_TRACE_TRIGGER to be a frame number

This makes it easier to capture the exact same frame (for instance from an
apitrace replay).

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

3 years agoradeonsi/sqtt: fix SQTT bo size overflow
Pierre-Eric Pelloux-Prayer [Mon, 25 Jan 2021 15:04:53 +0000 (16:04 +0100)]
radeonsi/sqtt: fix SQTT bo size overflow

Ported from c40ea24ee009d8c9816ff6327f65be3fbd45deb7

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

3 years agoradeonsi/sqtt: use more event identifier
Pierre-Eric Pelloux-Prayer [Fri, 15 Jan 2021 17:09:59 +0000 (18:09 +0100)]
radeonsi/sqtt: use more event identifier

Using event identifiers allows to add a bit more context to the RGP trace.
Without this all draw calls are identified as vkCmdDraw.

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

3 years agoci: split src/mesa/**/* matching rule
Pierre-Eric Pelloux-Prayer [Wed, 27 Jan 2021 11:02:06 +0000 (12:02 +0100)]
ci: split src/mesa/**/* matching rule

Split the rule to avoid running useless tests when touching the driver specific
sources.

v2: removed src/mesa/drivers/x11/**/*

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8735>

3 years agoiris: Enable PIPE_CAP_SHAREABLE_SHADERS.
Kenneth Graunke [Tue, 17 Nov 2020 22:36:29 +0000 (14:36 -0800)]
iris: Enable PIPE_CAP_SHAREABLE_SHADERS.

Now that we store shader variants in the objects themselves rather
than a per-context hash table, they are actually global across
contexts.  We can enable this feature.

This makes shaders shared across contexts, so apps can compile in
one and use it in another.  This has always been allowed by GL,
but in the past we've simply recompiled the shaders in every context,
which is slow and painful.

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

3 years agoiris: Store a list of shader variants in the shader itself
Kenneth Graunke [Mon, 16 Nov 2020 21:17:08 +0000 (13:17 -0800)]
iris: Store a list of shader variants in the shader itself

We've traditionally stored shader variants in a per-context hash table,
based on a key with many per-stage fields.  On older hardware supported
by i965, there were potentially quite a few variants, as many features
had to be emulated in shaders, including things like texture swizzling.

However, on the modern hardware targeted by iris, our NOS dependencies
are much smaller.  We almost always guess the correct state when doing
the initial precompile, and so we have maybe 1-3 variants.  iris NOS
keys are also dramatically smaller (4 to 24 bytes) than i965's.

Unlike the classic world, Gallium also provides a single kind of object
for API shaders---pipe_shader_state aka iris_uncompiled_shader.  We can
simply store a list of shader variants there.  This makes it possible
to access shader variants across contexts, rather than compiling them
separately for each context, which better matches how the APIs work.

To look up variants, we simply walk the list and memcmp the keys.
Since the list is almost always singular (and rarely ever long),
and the keys are tiny, this should be quite low overhead.

We continue storing internally generated shaders for BLORP and
passthrough TCS in the per-context hash table, as they don't have
an associated pipe_shader_state / iris_uncompiled_shader object.
(There can also be many BLORP shaders, and the blit keys are large,
so having a hash table rather than a list makes sense there.)

Because iris_uncompiled_shaders are shared across multiple contexts,
we do require locking when accessing this list.  Fortunately, this
is a per-shader lock, rather than a global one.  Additionally, since
we only append variants to the list, and generate the first one at
precompile time (while only one context has the uncompiled shader),
we can assume that it is safe to access that first entry without
locking the list.  This means that we only have to lock when we
have multiple variants, which is relatively uncommon.

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

3 years agoiris: Refcount shader variants
Kenneth Graunke [Wed, 27 Jan 2021 21:46:26 +0000 (13:46 -0800)]
iris: Refcount shader variants

There is a small gap of time where the currently bound uncompiled
shaders, and compiled shader variant, are out of sync.  Specifically,
between pipe->bind_*_state() and the next draw.

Currently, shaders variants live entirely within a single context,
and when deleting an iris_uncompiled_shader, we check if any of its
variants are currently bound, and defer deleting those until the next
iris_update_compiled_shaders() hook runs and binds new shaders to
replace them.  (This is due to the time gap between binding new
uncompiled shaders, and updating variants at draw time when we have
the required NOS in place.)

This works pretty well in a single context world.  But as we move to
share compiled shader variants across multiple contexts, it breaks down.
When deleting a shader, we can't look at all contexts to see if its
variants are bound anywhere.  We can't even quantify whether those
contexts will run a future draw any time soon, to update and unbind.

One fairly crazy solution would be to delete the variants anyway, and
leave the stale pointers to dead variants in place.  This requires
removing any code that compares old and new variants.  Today, we do
that sometimes for seeing if the old/new shaders toggled some feature.
Worse than that, though, we don't just have to avoid dereferences, we'd
have to avoid pointer comparisons.  If we free a variant, and quickly
allocate a new variant, malloc may return the same pointer.  If it's
for the same shader stage, we may get a new different program that has
the same pointer as a previously bound stale one, causing us to think
nothing had changed when we really needed to do updates.  Again, this
is doable, but leaves the code fragile - we'd have to guard against
future patches adding such checks back in.

So, don't do that.  Instead, do basic reference counting.  When a
variant is bound in a context, up the reference.  When it's unbound,
decrement it.  When it hits zero, we know it's not bound anywhere and
is safe to delete, with no stale references.  This ends up being
reasonably cheap anyway, since the atomic is usually uncontested.

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

3 years agomicrosoft: Fix comma in variadic macro for MSVC
James Park [Thu, 28 Jan 2021 16:37:12 +0000 (08:37 -0800)]
microsoft: Fix comma in variadic macro for MSVC

New preprocessor seems to be enabled by default when C17 mode is active.

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

3 years agogallium/tessellator: Fix warning suppression
James Park [Mon, 14 Dec 2020 19:35:13 +0000 (11:35 -0800)]
gallium/tessellator: Fix warning suppression

Single-line version of MSVC warning suppression does not extend beyond
the #endif directive. Use push/disable/pop instead.

Also suppress 26452, which is a similar analysis warning.

This could also be fixed with constexpr if, but C++17 would be required.

Fixes: 790516db0bf ("gallium/swr: fix gcc warnings")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8093>

3 years agopanfrost: Add the tiler heap to fragment jobs
Icecream95 [Thu, 28 Jan 2021 23:48:56 +0000 (12:48 +1300)]
panfrost: Add the tiler heap to fragment jobs

In some cases the GPU reads from the tiler heap in fragment jobs, so
always add it to GPU jobs.

Fixes faults in many applications that use multiple windows
(e.g. Firefox, plasmashell).

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4157
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8773>

3 years agoglapi: guard against invalid XML definitions for glthread
Marek Olšák [Thu, 28 Jan 2021 04:12:54 +0000 (23:12 -0500)]
glapi: guard against invalid XML definitions for glthread

This would have prevented the bug that the previous commit fixes.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8753>

3 years agoglthread: fix glVertexAttribDivisor calls not being tracked by non-VBO uploads
Marek Olšák [Thu, 28 Jan 2021 03:21:32 +0000 (22:21 -0500)]
glthread: fix glVertexAttribDivisor calls not being tracked by non-VBO uploads

marshal_call_after is ignored if the function is an alias of another
function. Move it to the right place.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8753>

3 years agoglthread: fix interpreting vertex size == GL_BGRA for vertex attribs
Marek Olšák [Wed, 27 Jan 2021 23:40:16 +0000 (18:40 -0500)]
glthread: fix interpreting vertex size == GL_BGRA for vertex attribs

Fixes: c9c9f57b022 - glthread: track pointers and strides for Pointer & EXT_dsa attrib functions
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4116

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8753>

3 years agoci: Update baremetal kernel to 5.11-rc5 plus patches.
Eric Anholt [Wed, 27 Jan 2021 23:56:42 +0000 (15:56 -0800)]
ci: Update baremetal kernel to 5.11-rc5 plus patches.

The dr_mode hack is now folded into the git tree.  The uprev brings in a
shrinker fix for msm and a fix for the GPU_SET OOB messages on cheza
(possibly involved in piglit flakes).

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8768>

3 years agoiris: Move VS draw parameter dirty flagging to iris_bind_vs_state
Kenneth Graunke [Wed, 27 Jan 2021 02:27:00 +0000 (18:27 -0800)]
iris: Move VS draw parameter dirty flagging to iris_bind_vs_state

Now that we're looking at shader info system values rather than
vs_prog_data, there's no reason we have to do this when updating
the shader variants.  We can simply check it when binding a new
shader from the API point of view.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8759>

3 years agoiris: Minor code restyling in iris_bind_vs_state
Kenneth Graunke [Wed, 27 Jan 2021 02:26:31 +0000 (18:26 -0800)]
iris: Minor code restyling in iris_bind_vs_state

We'll be adding more code here shortly, this will make it easier.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8759>

3 years agoiris: Use shader_info rather than vs_prog_data for draw parameter checks
Kenneth Graunke [Wed, 27 Jan 2021 02:00:29 +0000 (18:00 -0800)]
iris: Use shader_info rather than vs_prog_data for draw parameter checks

brw_compile_vs sets the vs_prog_data fields based on the NIR program's
system values read info field.  We can use that directly, enabling more
cleanups in the next patches.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8759>

3 years agoradv: Expose VK_KHR_workgroup_memory_explicit_layout.
Bas Nieuwenhuizen [Fri, 6 Nov 2020 23:38:39 +0000 (00:38 +0100)]
radv: Expose VK_KHR_workgroup_memory_explicit_layout.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8752>

3 years agofreedreno: Remove duplicate bc invalidate on flush_write_batch().
Eric Anholt [Mon, 25 Jan 2021 23:03:55 +0000 (15:03 -0800)]
freedreno: Remove duplicate bc invalidate on flush_write_batch().

The fd_batch_flush() internals already do the invalidate at the end to
clean up the bc's references to the batch.

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

3 years agofreedreno: Early-out from the resource write path when we're the writer.
Eric Anholt [Mon, 25 Jan 2021 22:54:25 +0000 (14:54 -0800)]
freedreno: Early-out from the resource write path when we're the writer.

No need to do the other checks in this case, because then we know that
we've done the UBWC clears and recursed on stencil and added deps on read
batches.

Done as a separate patch to reduce behavior changes in my upcoming move of
the batch cache to the context.

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

3 years agofreedreno: Use a real type instead of void * for the fd_batch->key.
Eric Anholt [Mon, 25 Jan 2021 18:42:42 +0000 (10:42 -0800)]
freedreno: Use a real type instead of void * for the fd_batch->key.

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

3 years agomapi: Undefine MemoryBarrier
Jesse Natalie [Fri, 22 Jan 2021 21:51:43 +0000 (13:51 -0800)]
mapi: Undefine MemoryBarrier

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

3 years agoglapi: Undefine MemoryBarrier
Jesse Natalie [Fri, 22 Jan 2021 21:24:42 +0000 (13:24 -0800)]
glapi: Undefine MemoryBarrier

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

3 years agoanv: Support multiple engines with DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT
Jordan Justen [Sun, 24 Mar 2019 08:00:37 +0000 (01:00 -0700)]
anv: Support multiple engines with DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT

v2 (Jason Ekstrand):
 - Separate the anv_gem interface from anv_queue internals
 - Rework on top of the new anv_queue_family stuff

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

3 years agoanv: Add anv_gem_count_engines
Jordan Justen [Sun, 24 Mar 2019 06:50:44 +0000 (23:50 -0700)]
anv: Add anv_gem_count_engines

v2 (Jason Ekstrand):
 - Take a drm_i915_query_engine_info

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

3 years agoanv: Gather engine info from i915 if available
Jordan Justen [Sat, 23 Mar 2019 07:28:24 +0000 (00:28 -0700)]
anv: Gather engine info from i915 if available

v2 (Jason Ekstrand):
 - Don't take an anv_physical_device in anv_gem_get_engine_info()
 - Return the engine info from anv_gem_get_engine_info()
 - Free the engine info in anv_physical_device_destroy()

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

3 years agoanv: Support i915 query (DRM_IOCTL_I915_QUERY) from Linux v4.17
Jordan Justen [Sat, 23 Mar 2019 07:17:57 +0000 (00:17 -0700)]
anv: Support i915 query (DRM_IOCTL_I915_QUERY) from Linux v4.17

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

3 years agoanv: Print queue number with INTEL_DEBUG=bat
Jordan Justen [Tue, 24 Mar 2020 20:18:25 +0000 (13:18 -0700)]
anv: Print queue number with INTEL_DEBUG=bat

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

3 years agoanv: Turn device->queue into an array
Jordan Justen [Tue, 14 Aug 2018 09:34:16 +0000 (02:34 -0700)]
anv: Turn device->queue into an array

Rework: Lionel
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>

3 years agoanv: Add exec_flags to anv_queue
Jordan Justen [Sat, 6 Apr 2019 01:37:36 +0000 (18:37 -0700)]
anv: Add exec_flags to anv_queue

This may vary based on the newer kernel engines based contexts.

v2 (Jason Ekstrand):
 - Initialize anv_queue::exec_flags in anv_queue_init
 - Don't conflate this with refactors to get_reset_stats

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

3 years agoanv: Add an anv_queue_family struct
Jason Ekstrand [Tue, 26 Jan 2021 07:13:36 +0000 (01:13 -0600)]
anv: Add an anv_queue_family struct

This is modeled on anv_memory_type and anv_memory_heap which we already
use for managing memory types.  Each anv_queue_family contains some data
which is returned by vkGetPhysicalDeviceQueueFamilyProperties() verbatim
as well as some internal book-keeping bits.  An array of queue families
along with a count is stored in the physical device.  Each anv_queue
then contains a pointer to the anv_queue_family to which it belongs.

Reviewed-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/8667>

3 years agoanv: store queue creation flags on anv_queue
Lionel Landwerlin [Thu, 10 Dec 2020 16:34:52 +0000 (18:34 +0200)]
anv: store queue creation flags on anv_queue

v2 (Jason Ekstrand):
 - Pass the whole VkDeviceQueueCreateInfo into anv_queue_init()

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@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/8667>

3 years agoanv: Refactor anv_queue_finish()
Jason Ekstrand [Mon, 25 Jan 2021 22:36:01 +0000 (16:36 -0600)]
anv: Refactor anv_queue_finish()

By moving vk_object_base_finish() to the end and putting the thread
clean-up in an if block we both better mimic anv_queue_init() and have a
more correct object destruction order.  It comes at the cost of a level
of indentation but that seems to actually make the function more clear.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>

3 years agoanv: pass context to reset stats helper
Lionel Landwerlin [Fri, 11 Dec 2020 13:36:40 +0000 (15:36 +0200)]
anv: pass context to reset stats helper

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@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/8667>

3 years agoanv: Fix an old parameter name in GetDeviceQueue
Jason Ekstrand [Fri, 22 Jan 2021 22:51:44 +0000 (16:51 -0600)]
anv: Fix an old parameter name in GetDeviceQueue

I don't know if this is a typo or an artifact of ancient versions of the
Vulkan API.  In any case, it's wrong.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>

3 years agoanv: Drop anv_dump
Jason Ekstrand [Fri, 22 Jan 2021 22:45:12 +0000 (16:45 -0600)]
anv: Drop anv_dump

I originally wrote this several years ago to aid in app debugging.  Now
that we have nice tools like RenderDoc, it's no longer needed.  I don't
think anyone's really used it in 4 years or more.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>

3 years agoutil: Use explicit relaxed reads for u_queue
Witold Baryluk [Thu, 28 Jan 2021 17:55:29 +0000 (17:55 +0000)]
util: Use explicit relaxed reads for u_queue

These are no-op, but make clang thread sanitizer happy.

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

3 years agointel/fs: Add an ex_desc field to fs_inst for SHADER_OPCODE_SEND
Jason Ekstrand [Wed, 27 Jan 2021 21:28:24 +0000 (15:28 -0600)]
intel/fs: Add an ex_desc field to fs_inst for SHADER_OPCODE_SEND

I meant to do this years ago when I first added SHADER_OPCODE_SEND.  At
the time, the only use for the extended descriptor was bindless handles
which were always one thing and never non-constant.  However, it doesn't
actually require any extra instructions because we have to OR in ex_mlen
anyway.

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

3 years agod3d12: fix for upside-down multisample stencil blit
BillKristiansen [Mon, 25 Jan 2021 20:21:01 +0000 (12:21 -0800)]
d3d12: fix for upside-down multisample stencil blit

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

3 years agovc4: add drm-shim
Christian Gmeiner [Wed, 27 Jan 2021 12:32:57 +0000 (13:32 +0100)]
vc4: add drm-shim

Is enought to run shader-db.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8736>

3 years agoci: disable glcpp tests for now
Mike Blumenkrantz [Wed, 27 Jan 2021 14:25:28 +0000 (09:25 -0500)]
ci: disable glcpp tests for now

these are too flaky to continue running for now

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8738>

3 years agomeson: add enable-glcpp-tests option
Mike Blumenkrantz [Wed, 27 Jan 2021 14:03:45 +0000 (09:03 -0500)]
meson: add enable-glcpp-tests option

these are too intermittent to be left enabled on CI for now

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8738>

3 years agoRevert "glcpp: disable 'windows' tests"
Mike Blumenkrantz [Wed, 27 Jan 2021 13:50:57 +0000 (08:50 -0500)]
Revert "glcpp: disable 'windows' tests"

This reverts commit f7527f7f652814a700dddc13a5b737571248c86d.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8738>

3 years agozink: export ssbo caps
Mike Blumenkrantz [Fri, 7 Aug 2020 23:17:57 +0000 (19:17 -0400)]
zink: export ssbo caps

PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT is needed

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

3 years agozink: flatten out ssbo/ubo variable decls in ntv
Mike Blumenkrantz [Wed, 2 Dec 2020 17:22:51 +0000 (12:22 -0500)]
zink: flatten out ssbo/ubo variable decls in ntv

we were using a system of block=array<uvec4> here, but we can really
just simplify this to block=array<uint> to make all the related code much
simpler

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

3 years agozink: implement get_ssbo_size nir intrinsic
Mike Blumenkrantz [Sun, 9 Aug 2020 13:30:29 +0000 (09:30 -0400)]
zink: implement get_ssbo_size nir intrinsic

this is a little hacky since we're still using unpacked layout for everything,
requiring that we "adjust" the value we pass back to the user for std430 to
be the expected value as though we were using packed layout

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

3 years agozink: support nir_intrinsic_store_ssbo
Mike Blumenkrantz [Fri, 7 Aug 2020 23:17:34 +0000 (19:17 -0400)]
zink: support nir_intrinsic_store_ssbo

this is gross, but it works

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

3 years agozink: rework ssbo indexing and binding
Mike Blumenkrantz [Fri, 7 Aug 2020 23:16:01 +0000 (19:16 -0400)]
zink: rework ssbo indexing and binding

this is actually crazy, but there's no other way to do it from the variable.
ideally, nir would have a separate type for atomic counters to simplify this
and then also stop mangling binding/block index during lower_buffers

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

3 years agozink: handle more ssbo ops in ntv
Mike Blumenkrantz [Fri, 7 Aug 2020 23:14:01 +0000 (19:14 -0400)]
zink: handle more ssbo ops in ntv

this is easiest with a macro since it's already implemented for images

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

3 years agozink: handle null ssbo attachments without crashing
Mike Blumenkrantz [Fri, 7 Aug 2020 23:12:20 +0000 (19:12 -0400)]
zink: handle null ssbo attachments without crashing

basically the same as any other null buffer descriptor attachment

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

3 years agozink: flag ssbo buffer resources as having pending writes per stage
Mike Blumenkrantz [Tue, 12 Jan 2021 23:40:23 +0000 (18:40 -0500)]
zink: flag ssbo buffer resources as having pending writes per stage

I meant to squash this down but didn't get around to it

Fixes: e79d905f5a0 ("zink: flag ssbo buffer resources as having pending writes on batch")

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

3 years agozink: add spirv builder function for OpAtomicStore
Mike Blumenkrantz [Fri, 7 Aug 2020 18:57:39 +0000 (14:57 -0400)]
zink: add spirv builder function for OpAtomicStore

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

3 years agoglsl: redeclare built-in variable with separate shader
cheyang [Tue, 15 Dec 2020 08:18:13 +0000 (16:18 +0800)]
glsl: redeclare built-in variable with separate shader

according to :
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_separate_shader_objects.gles.txt
properly handle the declaration of these interface block varibales

Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8101>

3 years agoiris: Properly handle new unbind_num_trailing_slots parameters
Kenneth Graunke [Thu, 28 Jan 2021 07:27:02 +0000 (23:27 -0800)]
iris: Properly handle new unbind_num_trailing_slots parameters

Commits 0278d1fa323cf1f289..b688ea31fcf7e20436 added a new parameter
to set_vertex_buffers(), set_shader_images(), and set_sampler_views()
which specifies a number of trailing slots to unbind.  They updated
the iris functions to do the unbinding, but didn't update the code
to mark which things are bound in the bitfields.  This meant that
later code would assume those unbound slots were bound, and crash
on a NULL dereference.  All that's needed is to add that slot count
when unbinding things in the bitfield.

Fixes: 0278d1fa323 ("gallium: add unbind_num_trailing_slots to set_vertex_buffers")
Fixes: 72ff66c3d73 ("gallium: add unbind_num_trailing_slots to set_shader_images")
Fixes: b688ea31fcf ("gallium: add unbind_num_trailing_slots to set_sampler_views")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8758>

3 years agoi965: Don't parse driconf again
Ian Romanick [Wed, 27 Jan 2021 20:01:26 +0000 (12:01 -0800)]
i965: Don't parse driconf again

It was already parsed in intelInitScree2, and the results are stored in
the screen.

Fixes: d67ef485804 ("i965/screen: Allow drirc to set 'allow_rgb10_configs' again.")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7387>

3 years agoi965: Use allow_higher_compat_version option during screen initialization
Ian Romanick [Fri, 30 Oct 2020 19:28:22 +0000 (12:28 -0700)]
i965: Use allow_higher_compat_version option during screen initialization

Currently, `allow_higher_compat_version` is only used during context
creation.  Doing that means an application that doesn't request a
specific version can be given a version higher than 3.0.

However, an application still cannot request a higher version via
glXCreateContextAttribsARB.  The GLX and DRI layers will only see that
version 3.0 is supported, so context creation will fail before the drive
is called.  For this to work, max_gl_compat_version must be set to a
higher version.

This enables running many piglit tests on i965 with
allow_higher_compat_version.

v2: Fix a typo in a comment.  Noticed by Tim.  Fix a typo in the commit
message.  Noticed by the spell checker. :)

v3: Don't parse driconf again.  Suggested by Tim.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7387>

3 years agoi965: Don't advertise OpenGL 3.3+ if driconf disables GL_ARB_blend_func_extended
Ian Romanick [Wed, 27 Jan 2021 19:55:01 +0000 (11:55 -0800)]
i965: Don't advertise OpenGL 3.3+ if driconf disables GL_ARB_blend_func_extended

This prevents the assertion added in "i965: Use
allow_higher_compat_version option during screen initialization" from
failing when disable_blend_func_extended=true.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7387>

3 years agoegl/dri2: enable EGL_WL_bind_wayland_display in EGL device platform
Simon Zeni [Thu, 21 Jan 2021 04:19:37 +0000 (23:19 -0500)]
egl/dri2: enable EGL_WL_bind_wayland_display in EGL device platform

EGL_WL_bind_wayland_display was previously supported on all platforms,
except the EGL device platform.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8638>

3 years agoradeonsi: fix centroid with VRS coarse shading
Marek Olšák [Tue, 26 Jan 2021 20:26:18 +0000 (15:26 -0500)]
radeonsi: fix centroid with VRS coarse shading

This has no effect on other shading. It should have been the default value.

Fixes: c3432ad8524 - radeonsi: add an option to enable 2x2 coarse shading for non-GUI elements

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

3 years agogallium/u_vbuf: skip draws with 0 vertices
Marek Olšák [Tue, 26 Jan 2021 05:35:10 +0000 (00:35 -0500)]
gallium/u_vbuf: skip draws with 0 vertices

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

3 years agost/mesa: set take_index_buffer_ownership to skip an atomic in u_threaded
Marek Olšák [Sat, 2 Jan 2021 22:53:13 +0000 (17:53 -0500)]
st/mesa: set take_index_buffer_ownership to skip an atomic in u_threaded

This reduces overhead by skipping the atomic, which is slow on AMD Zen.
It uses the same mechanism as vertex buffers.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>

3 years agogallium,u_threaded: add pipe_draw_info::take_index_buffer_ownership
Marek Olšák [Sat, 2 Jan 2021 22:52:04 +0000 (17:52 -0500)]
gallium,u_threaded: add pipe_draw_info::take_index_buffer_ownership

to skip atomics in u_threaded_context. This will decrease CPU overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>

3 years agogallium/util: optimize pipe_vertex_buffer_reference binding the same buffer
Marek Olšák [Sat, 2 Jan 2021 21:35:15 +0000 (16:35 -0500)]
gallium/util: optimize pipe_vertex_buffer_reference binding the same buffer

This eliminates atomic ops when the buffer doesn't change.

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

3 years agogallium/u_threaded: unify user and non-user codepaths in set_constant_buffer
Marek Olšák [Sat, 12 Dec 2020 22:10:00 +0000 (17:10 -0500)]
gallium/u_threaded: unify user and non-user codepaths in set_constant_buffer

We can do this cleanup thanks to take_ownership.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>

3 years agogallium/u_threaded: add a null constant buffer codepath
Marek Olšák [Sat, 12 Dec 2020 21:02:49 +0000 (16:02 -0500)]
gallium/u_threaded: add a null constant buffer codepath

This consumes less space in the batch buffer.

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

3 years agogallium/u_upload_mgr: eliminate all atomics for the upload buffer
Marek Olšák [Sat, 26 Dec 2020 15:09:48 +0000 (10:09 -0500)]
gallium/u_upload_mgr: eliminate all atomics for the upload buffer

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

3 years agost/mesa: skip atomics when binding UBOs
Marek Olšák [Sat, 2 Jan 2021 23:06:53 +0000 (18:06 -0500)]
st/mesa: skip atomics when binding UBOs

This uses the same mechanism as vertex buffers.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>

3 years agost/mesa: eliminate all atomic ops when setting vertex buffers
Marek Olšák [Sat, 2 Jan 2021 21:40:11 +0000 (16:40 -0500)]
st/mesa: eliminate all atomic ops when setting vertex buffers

This implements the same optimization as u_upload_mgr.

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

3 years agocso_context,u_vbuf: add take_ownership param into set_vertex_buffers
Marek Olšák [Sat, 2 Jan 2021 21:32:42 +0000 (16:32 -0500)]
cso_context,u_vbuf: add take_ownership param into set_vertex_buffers

st/mesa will use this to skip atomic ops for reference counting.

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

3 years agogallium: add take_ownership param into set_vertex_buffers to eliminate atomics
Marek Olšák [Sat, 26 Dec 2020 22:29:45 +0000 (17:29 -0500)]
gallium: add take_ownership param into set_vertex_buffers to eliminate atomics

There are a few places (mainly u_threaded_context) that do:
   set_vertex_buffers(...);
   for (i = 0; i < count; i++)
      pipe_resource_reference(&buffers[i].resource.buffer, NULL);

set_vertex_buffers increments the reference counts while the loop
decrements them.

This commit eliminates those reference count changes by adding a parameter
into set_vertex_buffers that tells the callee to accept all buffers
without incrementing the reference counts.

AMD Zen benefits from this because it has slow atomics if they come from
different CCXs.

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

3 years agogallium: add unbind_num_trailing_slots to set_sampler_views
Marek Olšák [Mon, 21 Dec 2020 08:01:34 +0000 (03:01 -0500)]
gallium: add unbind_num_trailing_slots to set_sampler_views

Instead of calling this functions again to unbind trailing slots,
extend it to do it when binding. This reduces CPU overhead.

A lot of drivers ignore "start" and always unbind all slots after "count".
Such drivers don't need any changes here.

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

3 years agogallium: add unbind_num_trailing_slots to set_shader_images
Marek Olšák [Mon, 21 Dec 2020 08:01:34 +0000 (03:01 -0500)]
gallium: add unbind_num_trailing_slots to set_shader_images

Instead of calling this function again to unbind trailing slots,
extend it to do it when images are being set. This reduces CPU overhead.
Only st/mesa benefits.

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

3 years agogallium: add unbind_num_trailing_slots to set_vertex_buffers
Marek Olšák [Mon, 21 Dec 2020 08:01:34 +0000 (03:01 -0500)]
gallium: add unbind_num_trailing_slots to set_vertex_buffers

Instead of calling this functions again to unbind trailing slots,
extend it to do it as part of the call that sets vertex buffers.
This reduces CPU overhead. Only st/mesa benefits from this.

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

3 years agogallium: add take_ownership param into set_constant_buffer to eliminate atomics
Marek Olšák [Sat, 26 Dec 2020 17:01:10 +0000 (12:01 -0500)]
gallium: add take_ownership param into set_constant_buffer to eliminate atomics

We often do this:
    pipe->set_constant_buffer(pipe, shader, slot, &cb);
    pipe_resource_reference(&cb->buffer, NULL);

That results in atomic increment in set_constant_buffer followed by
atomic decrement after set_constant_buffer. This new interface
eliminates those atomics.

For the case above, this should be used instead:
    pipe->set_constant_buffer(pipe, shader, slot, true, &cb);
    cb->buffer = NULL; // if cb is not a local variable, else do nothing

AMD Zen benefits from this. The perf improvement is ~3% for Viewperf13/Catia.

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

3 years agoRevert "gallium/u_upload_mgr: allow use of FLUSH_EXPLICIT with persistent mappings"
Marek Olšák [Mon, 21 Dec 2020 06:27:44 +0000 (01:27 -0500)]
Revert "gallium/u_upload_mgr: allow use of FLUSH_EXPLICIT with persistent mappings"

It's no longer needed after radeonsi had its SDMA uploads removed.

This reverts commit 54f7545cd7925db9ff78b9dccbff7406dd2ad4a4.

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

3 years agolavapipe: handle shader draw parameters
Dave Airlie [Wed, 23 Dec 2020 23:51:23 +0000 (09:51 +1000)]
lavapipe: handle shader draw parameters

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8219>

3 years agollvmpipe: handle firstvertex for vulkan draw parameters
Dave Airlie [Wed, 23 Dec 2020 23:50:45 +0000 (09:50 +1000)]
llvmpipe: handle firstvertex for vulkan draw parameters

Vulkan defines this a bit differently, so add support for
load_first_vertex.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8219>

3 years agoanv: Enabled the VK_EXT_sample_locations extension
Eleni Maria Stea [Thu, 14 Mar 2019 19:52:07 +0000 (21:52 +0200)]
anv: Enabled the VK_EXT_sample_locations extension

Enabled the VK_EXT_sample_locations for Intel Gen >= 7.

v2: Replaced device.info->gen >= 7 with True, as Anv doesn't support
    anything below Gen7. (Lionel Landwerlin)

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-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/1887>

3 years agoanv: Removed unused header file
Eleni Maria Stea [Thu, 14 Mar 2019 19:52:06 +0000 (21:52 +0200)]
anv: Removed unused header file

In src/intel/vulkan/genX_blorp_exec.c we included the file:
common/gen_sample_positions.h but not use it. Removed.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1887>

3 years agoanv: Add support for sample locations
Eleni Maria Stea [Thu, 14 Mar 2019 19:52:02 +0000 (21:52 +0200)]
anv: Add support for sample locations

Allowing the user to set custom sample locations, by filling the
extension structs and chaining them to the pipeline structs according
to the Vulkan specification section [26.5. Custom Sample Locations]
for the following structures:

'VkPipelineSampleLocationsStateCreateInfoEXT'
'VkSampleLocationsInfoEXT'
'VkSampleLocationEXT'

Once custom locations are used, the default locations are lost and need
to be re-emitted again in the next pipeline creation. For that, we emit
the 3DSTATE_SAMPLE_PATTERN at every pipeline creation.

v2: In v1, we used the custom anv_sample struct to store the location
    and the distance from the pixel center because we would then use
    this distance to sort the locations and send them in increasing
    monotonical order to the GPU. That was because the Skylake PRM Vol.
    2a "3DSTATE_SAMPLE_PATTERN" says that the samples must have
    monotonically increasing distance from the pixel center to get the
    correct centroid computation in the device. However, the Vulkan
    spec seems to require that the samples occur in the order provided
    through the API and this requirement is only for the standard
    locations. As long as this only affects centroid calculations as
    the docs say, we should be ok because OpenGL and Vulkan only
    require that the centroid be some lit sample and that it's the same
    for all samples in a pixel; they have no requirement that it be the
    one closest to center. (Jason Ekstrand)
    For that we made the following changes:
    1- We removed the custom structs and functions from anv_private.h
       and anv_sample_locations.h and anv_sample_locations.c (the last
       two files were removed). (Jason Ekstrand)
    2- We modified the macros used to take also the array as parameter
       and we renamed them to start by GEN_. (Jason Ekstrand)
    3- We don't sort the samples anymore. (Jason Ekstrand)

v3 (Jason Ekstrand):
    Break the refactoring out into multiple commits

v4: Merge dynamic/non-dynamic changes into a single commit (Lionel)

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

3 years agointel/common: store sample position in plain arrays
Lionel Landwerlin [Thu, 5 Nov 2020 07:58:21 +0000 (09:58 +0200)]
intel/common: store sample position in plain arrays

Allows to extract the values in different ways than just the genxml
format.

v2 (Jason Ekstrand):
 - Add a struct gen_sample_location so that we can re-use the array
   macros from the earlier commit.

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

3 years agoanv/state: Take explicit sample locations in emit helpers
Eleni Maria Stea [Thu, 14 Mar 2019 23:20:12 +0000 (18:20 -0500)]
anv/state: Take explicit sample locations in emit helpers

This commit adds a "locations" parameter to emit_multisample and
emit_sample_pattern which, if provided, will override the default
sample locations.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1887>

3 years agoanv: Break SAMPLE_PATTERN and MULTISAMPLE emit into helpers
Jason Ekstrand [Thu, 14 Mar 2019 23:02:49 +0000 (18:02 -0500)]
anv: Break SAMPLE_PATTERN and MULTISAMPLE emit into helpers

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

3 years agoanv: Implement physical device properties for VK_EXT_sample_locations
Eleni Maria Stea [Thu, 14 Mar 2019 19:52:00 +0000 (21:52 +0200)]
anv: Implement physical device properties for VK_EXT_sample_locations

The VkPhysicalDeviceSampleLocationPropertiesEXT struct is filled with
implementation dependent values and according to the table from the
Vulkan Specification section [36.1. Limit Requirements]:

pname | max | min
pname:sampleLocationSampleCounts   |-            |ename:VK_SAMPLE_COUNT_4_BIT
pname:maxSampleLocationGridSize    |-            |(1, 1)
pname:sampleLocationCoordinateRange|(0.0, 0.9375)|(0.0, 0.9375)
pname:sampleLocationSubPixelBits   |-            |4
pname:variableSampleLocations      | true        |implementation dependent

The hardware only supports setting the same sample location for all the
pixels, so we only support 1x1 grids.

Also, variableSampleLocations is set to true because we can set sample
locations per draw.

Implement the vkGetPhysicalDeviceMultisamplePropertiesEXT according to
the Vulkan Specification section [36.2. Additional Multisampling
Capabilities].

v2: 1- Replaced false with VK_FALSE for consistency. (Sagar Ghuge)
    2- Used the isl_device_sample_count to take the number of samples
    per platform to avoid extra checks. (Sagar Ghuge)

v3: 1- Replaced VK_FALSE with false as Jason has sent a patch to replace
    VK_FALSE with false in other places. (Jason Ekstrand)
    2- Removed unecessary defines and set the grid size to 1 (Jason Ekstrand)

v4: Fix properties reporting in GetPhysicalDeviceProperties2, not
    GetPhysicalDeviceFeatures2 (Lionel)
    Use same alignment as other functions (Lionel)
    Report variableSampleLocations=true (Lionel)

v5: Don't overwrite the pNext in GetPhysicalDeviceMultisamplerPropertiesEXT

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com> (v3)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1887>

3 years agoanv: Added the VK_EXT_sample_locations extension to the anv_extensions list
Eleni Maria Stea [Thu, 14 Mar 2019 19:51:59 +0000 (21:51 +0200)]
anv: Added the VK_EXT_sample_locations extension to the anv_extensions list

Added the VK_EXT_sample_locations to the anv_extensions.py list to
generate the related entrypoints.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-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/1887>

3 years agoci/freedreno: Make a630 piglit_shader run a manual run, too.
Eric Anholt [Wed, 27 Jan 2021 20:24:08 +0000 (12:24 -0800)]
ci/freedreno: Make a630 piglit_shader run a manual run, too.

We haven't been able to stabilize the remaining flakes (scattered through
a bunch of innocuous-looking tests), so disable it until we can fix it or
replace the piglit runner with one that can handle flakes.

Closes: #4170
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8747>

3 years agoanv: Implement VK_KHR_workgroup_memory_explicit_layout
Caio Marcelo de Oliveira Filho [Fri, 5 Jun 2020 17:23:35 +0000 (10:23 -0700)]
anv: Implement VK_KHR_workgroup_memory_explicit_layout

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8699>

3 years agospirv: Implement SPV_KHR_workgroup_memory_explicit_layout
Caio Marcelo de Oliveira Filho [Wed, 28 Oct 2020 21:55:05 +0000 (14:55 -0700)]
spirv: Implement SPV_KHR_workgroup_memory_explicit_layout

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8699>

3 years agonir: Two shared memory *blocks* may alias each other
Caio Marcelo de Oliveira Filho [Wed, 8 Jul 2020 00:38:03 +0000 (17:38 -0700)]
nir: Two shared memory *blocks* may alias each other

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8699>

3 years agospirv: Update headers and metadata from latest Khronos commit
Caio Marcelo de Oliveira Filho [Fri, 5 Jun 2020 20:35:29 +0000 (13:35 -0700)]
spirv: Update headers and metadata from latest Khronos commit

This corresponds to faa570afbc91ac73d594d787486bcf8f2df1ace0
("Merge pull request #192 from cmarcelo/SPV_KHR_workgroup_memory_explicit_layout") in
https://github.com/KhronosGroup/SPIRV-Headers.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8699>

3 years agovulkan: Update XML and headers to 1.2.168
Caio Marcelo de Oliveira Filho [Fri, 5 Jun 2020 17:15:50 +0000 (10:15 -0700)]
vulkan: Update XML and headers to 1.2.168

This brings in the following extensions:

- VK_KHR_workgroup_memory_explicit_layout
- VK_KHR_zero_initialize_workgroup_memory

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8699>

3 years agoci/freedreno: Ban more flaky clip-enables tests.
Eric Anholt [Wed, 27 Jan 2021 17:51:46 +0000 (09:51 -0800)]
ci/freedreno: Ban more flaky clip-enables tests.

Same cause as vs-clip-vertex-enable, presumably.

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

3 years agoegl: Fix error string returned by eglQueryDeviceAttribEXT
Adam Jackson [Tue, 26 Jan 2021 16:14:18 +0000 (11:14 -0500)]
egl: Fix error string returned by eglQueryDeviceAttribEXT

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8725>

3 years agolavapipe: add support for external memory/fd/sempahore extensions
Dave Airlie [Tue, 22 Dec 2020 05:07:08 +0000 (15:07 +1000)]
lavapipe: add support for external memory/fd/sempahore extensions

These are just dummy versions of these but enough to pass CTS

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

3 years agost/mesa: don't enable smoothing if multisampling is enabled
Marek Olšák [Tue, 12 Jan 2021 08:23:23 +0000 (03:23 -0500)]
st/mesa: don't enable smoothing if multisampling is enabled

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