mesa.git
4 years agogenxml: add new Gen11+ PIPE_CONTROL field
Lionel Landwerlin [Wed, 15 Jan 2020 13:11:08 +0000 (15:11 +0200)]
genxml: add new Gen11+ PIPE_CONTROL field

PIPE_CONTROL gained a new field in its first DWORD on Gen11. We had no
use for it so far, but we start using it on Gen12.

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

4 years agost/mesa: Allocate full miplevels if MaxLevel is explicitly set
Kenneth Graunke [Wed, 15 Jan 2020 00:25:11 +0000 (16:25 -0800)]
st/mesa: Allocate full miplevels if MaxLevel is explicitly set

Some applications explicitly call glTex[ture]Parameteri[v] to set
GL_TEXTURE_MAX_LEVEL and GL_TEXTURE_BASE_LEVEL before uploading any
texture data.  Core Mesa initializes MaxLevel to 1000, so if it isn't
that, we know they've set it.  (We check for < TEXTURE_MAX_LEVELS to
avoid hardcoding that value, however.)

If MaxLevel - BaseLevel > 0, then the app is trying to tell us that
this texture is going to have multiple miplevels.  In that case, go
ahead and allocate the space for it.

Avoids many resource_copy_region calls at texture finalization time
in the Civilization VI benchmark.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3401>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3401>

4 years agoaco: fix emitting SMEM instructions with no operands on GFX6-GFX7
Samuel Pitoiset [Wed, 15 Jan 2020 12:08:17 +0000 (13:08 +0100)]
aco: fix emitting SMEM instructions with no operands on GFX6-GFX7

Like s_memtime.

Fixes dEQP-VK.glsl.shader_clock.* on GFX6.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3407>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3407>

4 years agolima: fix handling of reverse depth range
Vasily Khoruzhick [Wed, 15 Jan 2020 03:53:29 +0000 (19:53 -0800)]
lima: fix handling of reverse depth range

Looks like we need to handle cases when near > far and near == far.
In first case we just need to swap near and far, and in second we
need subtract epsilon from near if it's not zero.

Fixes 10 tests in dEQP-GLES2.functional.depth_range.*

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3400>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3400>

4 years agonvc0: disable xfb's which don't have a stride
Ilia Mirkin [Thu, 16 Jan 2020 00:46:59 +0000 (19:46 -0500)]
nvc0: disable xfb's which don't have a stride

No stride / no attributes means that nothing is being written to the
buffer. However it might still prevent primitives from being written out
to the other buffers. Disabling it entirely seems to fix it.

Fixes GTF-GL45.gtf30.GL3Tests.transform_feedback.transform_feedback_overflow

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
4 years agolima/ppir: implement full liveness analysis for regalloc
Erico Nunes [Sun, 12 Jan 2020 14:11:55 +0000 (15:11 +0100)]
lima/ppir: implement full liveness analysis for regalloc

The existing liveness analysis in ppir still ultimately relies on a
single continuous live_in and live_out range per register and was
observed to be the bottleneck for register allocation on complicated
examples with several control flow blocks.
The use of live_in and live_out ranges was fine before ppir got control
flow, but now it ends up creating unnecessary interferences as live_in
and live_out ranges may span across entire blocks after blocks get
placed sequentially.

This new liveness analysis implementation generates a set of live
variables at each program point; before and after each instruction and
beginning and end of each block.
This is a global analysis and propagates the sets of live registers
across blocks independently of their sequence.
The resulting sets optimally represent all variables that cannot share a
register at each program point, so can be directly translated as
interferences to the register allocator.

Special care has to be taken with non-ssa registers. In order to
properly define their live range, their alive components also need to be
tracked. Therefore ppir can't use simple bitsets to keep track of live
registers.

The algorithm uses an auxiliary set data structure to keep track of the
live registers. The initial implementation used only trivial arrays,
however regalloc execution time was then prohibitive (>1minute on
Cortex-A53) on extreme benchmarks with hundreds of instructions,
hundreds of registers and several spilling iterations, mostly due to the
n^2 complexity to generate the interferences from the live sets. Since
the live registers set are only a very sparse subset of all registers at
each instruction, iterating only over this subset allows it to run very
fast again (a couple of seconds for the same benchmark).

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3358>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3358>

4 years agolima/ppir: remove orphan load node after cloning
Erico Nunes [Sun, 12 Jan 2020 13:30:26 +0000 (14:30 +0100)]
lima/ppir: remove orphan load node after cloning

There are some cases in shades using control flow where the varying load
is cloned to every block, and then the original node is left orphan.
This is not harmful for program execution, but it complicates analysis
for register allocation as there is now a case of writing to a register
that is never read.
While ppir doesn't have a dead code elimination pass for its own
optimizations and it is not hard to detect when we cloned the last load,
let's remove it early.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3358>

4 years agoiris: Print warning and return *out = NULL when fd to syncobj fails
Kristian H. Kristensen [Wed, 15 Jan 2020 00:56:41 +0000 (16:56 -0800)]
iris: Print warning and return *out = NULL when fd to syncobj fails

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agoiris: Advertise PIPE_CAP_NATIVE_FENCE_FD
Kristian H. Kristensen [Thu, 19 Dec 2019 18:56:03 +0000 (10:56 -0800)]
iris: Advertise PIPE_CAP_NATIVE_FENCE_FD

Enables EGL_ANDROID_native_fence_sync.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agoiris: Fix export of fences that have already completed.
Kenneth Graunke [Thu, 19 Dec 2019 21:51:07 +0000 (13:51 -0800)]
iris: Fix export of fences that have already completed.

After flushing batches, iris_fence_flush() asks the kernel whether
each batch's last_syncpt has already signalled or not.  (The idea is
that either the compute or render batch may not have actually had any
work queued up, so last_syncpt there might have been signalled a long
time ago.)  If it's already completed, we don't bother to record it.

A strange corner is the case of repeated flushes.  For example, we
might flush for some reason, and hit a glFlush(), and hit SwapBuffers.
It's possible for all the batches to have been flushed previously, -and-
for them to have actually completed.  In this case, we'll see that there
are no syncobj's to wait on, and record fence->count == 0.

This works fine internally - fence_finish can see count == 0 and realize
that it doesn't need to wait, for example.  But when working with native
FDs, we may be asked to export a fence with count == 0.  So we need an
actual synchronization primitive we can hand off.  Because all of the
relevant batches had been signalled when creating the fence, we want the
new dummy fence to be signalled as well.

So we just make a signalled syncobj and export it.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
4 years agoandroid: Fix whitespace issue
Robert Foss [Wed, 15 Jan 2020 00:11:23 +0000 (01:11 +0100)]
android: Fix whitespace issue

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
4 years agopanfrost: Prefix schedule_program to prevent collision
Robert Foss [Wed, 15 Jan 2020 00:14:16 +0000 (01:14 +0100)]
panfrost: Prefix schedule_program to prevent collision

Currently the schedule_program implementation being used is picked
at compile time, which on the Android platform means that the
bifrost compiler & scheduler is used for all targets, including
midgard based hardware.

This commit disambiguates between the two schedule_program functions.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
4 years agoradeonsi: merge si_compile_llvm and si_llvm_compile functions
Marek Olšák [Wed, 15 Jan 2020 01:40:51 +0000 (20:40 -0500)]
radeonsi: merge si_compile_llvm and si_llvm_compile functions

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

4 years agoradeonsi: remove useless #includes
Marek Olšák [Wed, 15 Jan 2020 01:27:24 +0000 (20:27 -0500)]
radeonsi: remove useless #includes

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

4 years agoradeonsi: move code for shader resources into si_shader_llvm_resources.c
Marek Olšák [Wed, 15 Jan 2020 01:17:08 +0000 (20:17 -0500)]
radeonsi: move code for shader resources into si_shader_llvm_resources.c

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

4 years agoradeonsi: move geometry shader code into si_shader_llvm_gs.c
Marek Olšák [Wed, 15 Jan 2020 01:03:48 +0000 (20:03 -0500)]
radeonsi: move geometry shader code into si_shader_llvm_gs.c

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

4 years agoradeonsi: remove llvm_type_is_64bit
Marek Olšák [Wed, 15 Jan 2020 00:29:34 +0000 (19:29 -0500)]
radeonsi: remove llvm_type_is_64bit

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

4 years agoradeonsi: move tessellation shader code into si_shader_llvm_tess.c
Marek Olšák [Wed, 15 Jan 2020 00:13:42 +0000 (19:13 -0500)]
radeonsi: move tessellation shader code into si_shader_llvm_tess.c

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

4 years agoradeonsi: move si_insert_input_* functions
Marek Olšák [Tue, 24 Dec 2019 00:53:46 +0000 (19:53 -0500)]
radeonsi: move si_insert_input_* functions

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

4 years agoradeonsi: work around an LLVM crash when using llvm.amdgcn.icmp.i64.i1
Marek Olšák [Thu, 9 Jan 2020 02:52:26 +0000 (21:52 -0500)]
radeonsi: work around an LLVM crash when using llvm.amdgcn.icmp.i64.i1

Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3338>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3338>

4 years agoradeonsi: fix si_build_wrapper_function for compute-based primitive culling
Marek Olšák [Thu, 9 Jan 2020 02:51:23 +0000 (21:51 -0500)]
radeonsi: fix si_build_wrapper_function for compute-based primitive culling

Fixes: 3b143369a55 "ac/nir, radv, radeonsi: Switch to using ac_shader_args"
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3338>

4 years agoradeonsi/gfx10: separate code for determining the number of vertices for NGG
Marek Olšák [Fri, 3 Jan 2020 23:02:30 +0000 (18:02 -0500)]
radeonsi/gfx10: separate code for determining the number of vertices for NGG

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
4 years agoradeonsi/gfx10: separate code for getting edgeflags from the gs_invocation_id VGPR
Marek Olšák [Fri, 3 Jan 2020 21:25:48 +0000 (16:25 -0500)]
radeonsi/gfx10: separate code for getting edgeflags from the gs_invocation_id VGPR

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
4 years agoradeonsi: move VS_STATE.LS_OUT_PATCH_SIZE a few bits higher to make space there
Marek Olšák [Tue, 24 Dec 2019 01:17:46 +0000 (20:17 -0500)]
radeonsi: move VS_STATE.LS_OUT_PATCH_SIZE a few bits higher to make space there

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
4 years agoradeonsi: make si_insert_input_* functions non-static
Marek Olšák [Tue, 24 Dec 2019 00:53:46 +0000 (19:53 -0500)]
radeonsi: make si_insert_input_* functions non-static

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
4 years agoac/cull: don't read Position.Z if it's not needed for culling
Marek Olšák [Tue, 7 Jan 2020 00:19:40 +0000 (19:19 -0500)]
ac/cull: don't read Position.Z if it's not needed for culling

It could be NULL.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
4 years agoradeonsi: separate code computing info for small primitive culling
Marek Olšák [Tue, 24 Dec 2019 03:16:42 +0000 (22:16 -0500)]
radeonsi: separate code computing info for small primitive culling

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
4 years agointel/compiler: Fix illegal mutation in get_nir_image_intrinsic_image
Kenneth Graunke [Wed, 15 Jan 2020 08:31:49 +0000 (00:31 -0800)]
intel/compiler: Fix illegal mutation in get_nir_image_intrinsic_image

get_nir_image_intrinsic_image() was incorrectly mutating the value held
by the register which holds the intrinsic's first source (image index).

If this happened to be the register for an SSA def which is also used
elsewhere in the program, this meant that we would clobber that value
in subsequent uses.

Note that this only affects i965, because neither anv nor iris use the
binding table start sections, so nothing is ever added here.

Fixes KHR-GL46.compute_shader.resources-max on i965 with Eric Anholt's
MR !3240 applied.  That MR reorders SSBOs and ABOs, so that test uses
image 0 and SSBO 0, causing this code to brilliantly add binding table
index 45 to both the image (correct) and the SSBO (bzzt, wrong!).

Fixes: 09f1de97a76 ("anv,i965: Lower away image derefs in the driver")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3404>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3404>

4 years agogitlab-ci: fix missing caselist.css/xsl
Rob Clark [Wed, 15 Jan 2020 16:50:55 +0000 (08:50 -0800)]
gitlab-ci: fix missing caselist.css/xsl

My best guess is that this was broken by d62dd8b0

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

4 years agorelnotes: Add Vulkan 1.2
Jason Ekstrand [Wed, 15 Jan 2020 15:25:51 +0000 (09:25 -0600)]
relnotes: Add Vulkan 1.2

4 years agoradv: enable Vulkan 1.2
Samuel Pitoiset [Mon, 25 Nov 2019 20:29:01 +0000 (21:29 +0100)]
radv: enable Vulkan 1.2

This bumps the Vulkan version to 1.2.128.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: implement Vulkan 1.2 features and properties
Samuel Pitoiset [Tue, 26 Nov 2019 07:34:33 +0000 (08:34 +0100)]
radv: implement Vulkan 1.2 features and properties

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: implement Vulkan 1.1 features and properties
Samuel Pitoiset [Tue, 26 Nov 2019 07:13:14 +0000 (08:13 +0100)]
radv: implement Vulkan 1.1 features and properties

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_timeline_semaphore for Vulkan 1.2
Samuel Pitoiset [Mon, 25 Nov 2019 19:50:12 +0000 (20:50 +0100)]
radv: update VK_KHR_timeline_semaphore for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_uniform_buffer_standard_layout for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 08:21:20 +0000 (10:21 +0200)]
radv: update VK_KHR_uniform_buffer_standard_layout for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_shader_subgroup_extended_types for Vulkan 1.2
Samuel Pitoiset [Tue, 26 Nov 2019 13:08:00 +0000 (14:08 +0100)]
radv: update VK_KHR_shader_subgroup_extended_types for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_shader_float_controls for Vulkan 1.2
Samuel Pitoiset [Tue, 26 Nov 2019 13:07:07 +0000 (14:07 +0100)]
radv: update VK_KHR_shader_float_controls for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_shader_float16_int8 for Vulkan 1.2
Samuel Pitoiset [Tue, 26 Nov 2019 13:05:13 +0000 (14:05 +0100)]
radv: update VK_KHR_shader_float16_int8 for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_shader_atomic_int64 for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 08:16:37 +0000 (10:16 +0200)]
radv: update VK_KHR_shader_atomic_int64 for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_imageless_framebuffer for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 08:15:04 +0000 (10:15 +0200)]
radv: update VK_KHR_imageless_framebuffer for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_image_format_list for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:26:20 +0000 (09:26 +0200)]
radv: update VK_KHR_image_format_list for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_driver_properties for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:24:07 +0000 (09:24 +0200)]
radv: update VK_KHR_driver_properties for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_draw_indirect_count for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:22:04 +0000 (09:22 +0200)]
radv: update VK_KHR_draw_indirect_count for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_depth_stencil_resolve for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:20:48 +0000 (09:20 +0200)]
radv: update VK_KHR_depth_stencil_resolve for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_create_renderpass2 for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:09:41 +0000 (09:09 +0200)]
radv: update VK_KHR_create_renderpass2 for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_buffer_device_address for Vulkan 1.2
Samuel Pitoiset [Tue, 26 Nov 2019 08:59:27 +0000 (09:59 +0100)]
radv: update VK_KHR_buffer_device_address for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_KHR_8bit_storage for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:03:28 +0000 (09:03 +0200)]
radv: update VK_KHR_8bit_storage for Vulkan 1.2

Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_EXT_scalar_block_layout for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:00:19 +0000 (09:00 +0200)]
radv: update VK_EXT_scalar_block_layout for Vulkan 1.2

Promoted to Vulkan 1.2 with the EXT suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_EXT_sampler_filter_minmax for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 06:58:55 +0000 (08:58 +0200)]
radv: update VK_EXT_sampler_filter_minmax for Vulkan 1.2

Promoted to Vulkan 1.2 with the EXT suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_EXT_host_query_reset for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 06:55:07 +0000 (08:55 +0200)]
radv: update VK_EXT_host_query_reset for Vulkan 1.2

Promoted to Vulkan 1.2 with the EXT suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: update VK_EXT_descriptor_indexing for Vulkan 1.2
Samuel Pitoiset [Tue, 26 Nov 2019 13:01:43 +0000 (14:01 +0100)]
radv: update VK_EXT_descriptor_indexing for Vulkan 1.2

Promoted to Vulkan 1.2 with the EXT suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoanv: Enable Vulkan 1.2 support
Iván Briano [Mon, 16 Sep 2019 22:41:45 +0000 (15:41 -0700)]
anv: Enable Vulkan 1.2 support

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
4 years agoanv: Implement the new core version property queries
Jason Ekstrand [Mon, 13 Jan 2020 19:44:16 +0000 (13:44 -0600)]
anv: Implement the new core version property queries

Vulkan 1.2 introduces some new structures to get the properties and
features of a device from extensions that were promoted to core in 1.1
and 1.2.  This commit implements the new property queries and makes all
of the corresponding extension queries map to them.

Reviewed-by: Iván Briano <ivan.briano@intel.com>
4 years agoanv: Implement the new core version feature queries
Jason Ekstrand [Mon, 13 Jan 2020 18:57:56 +0000 (12:57 -0600)]
anv: Implement the new core version feature queries

Vulkan 1.2 introduces some new structures to get the properties and
features of a device from extensions that were promoted to core in 1.1
and 1.2.  This commit implements the new feature queries and makes all
of the corresponding extension queries map to them.

Reviewed-by: Iván Briano <ivan.briano@intel.com>
4 years agoanv,nir: Lower quad_broadcast with dynamic index in NIR
Jason Ekstrand [Mon, 16 Dec 2019 16:43:18 +0000 (10:43 -0600)]
anv,nir: Lower quad_broadcast with dynamic index in NIR

This is required for the subgroupBroadcastDynamicId feature that was
added in Vulkan 1.2.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
4 years agoanv: Bump the patch version to 131
Jason Ekstrand [Wed, 15 Jan 2020 14:08:32 +0000 (08:08 -0600)]
anv: Bump the patch version to 131

4 years agovulkan/overlay: Fix for Vulkan 1.2
Samuel Pitoiset [Tue, 15 Oct 2019 07:22:30 +0000 (09:22 +0200)]
vulkan/overlay: Fix for Vulkan 1.2

v2 (Jason Ekstrand):
 - Add duplicate hooks for both the 1.2 and KHR versions of
   vkCmdDraw[Indexed]IndirectCount.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoturnip: Pretend to support Vulkan 1.2
Jason Ekstrand [Wed, 15 Jan 2020 14:34:06 +0000 (08:34 -0600)]
turnip: Pretend to support Vulkan 1.2

It doesn't really support any Vulkan properly yet so why not claim 1.2?
This was an easier way of fixing the build than trying to roll it
forward to a later version of ANV's entrypoint generator scripts.

4 years agovulkan: Update the XML and headers to 1.2.131
Jason Ekstrand [Wed, 15 Jan 2020 13:59:32 +0000 (07:59 -0600)]
vulkan: Update the XML and headers to 1.2.131

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agogitlab-ci: Stop using manual jobs for merge requests
Michel Dänzer [Mon, 13 Jan 2020 08:45:57 +0000 (09:45 +0100)]
gitlab-ci: Stop using manual jobs for merge requests

They were causing trouble with Marge Bot: The project settings require
that the pipeline succeeds before a merge request (MR) can be merged,
otherwise Marge doesn't wait for the pipeline to succeed before merging
an MR assigned to her. But Marge can't start manual jobs, so she would
always time out waiting for pipelines with manual jobs.

To avoid this, use these rules:
* Run the pipeline by default for MRs and main project branches changing
  any files affecting it.
* For other MRs, run a single dummy job which always succeeds.
* Don't run any jobs for main project branch changes (e.g. from an MR
  having been merged) not affecting the pipeline.
* Allow jobs to be started manually on branches of forked projects, as
  before.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3361>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3361>

4 years agoradeonsi: drop the negation from fmask_is_not_identity
Pierre-Eric Pelloux-Prayer [Fri, 20 Dec 2019 12:39:07 +0000 (13:39 +0100)]
radeonsi: drop the negation from fmask_is_not_identity

This change eases code reading ("fmask_is_identity = true" is clearer than
"fmask_is_not_identity = false").
Initialization is not changed so fmask_is_identity is false when a texture is
created.

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

4 years agoradeonsi: unbind image before compute clear
Pierre-Eric Pelloux-Prayer [Fri, 20 Dec 2019 12:33:42 +0000 (13:33 +0100)]
radeonsi: unbind image before compute clear

It's not used and avoid infinite recursion when used from si_compute_expand_fmask

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

4 years agoradeonsi: make sure fmask expand is done if needed
Pierre-Eric Pelloux-Prayer [Thu, 19 Dec 2019 18:54:16 +0000 (19:54 +0100)]
radeonsi: make sure fmask expand is done if needed

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2248
Fixes: 095a58204d9 ("radeonsi: expand FMASK before MSAA image stores are used")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3174>

4 years agoradeonsi: fix fmask expand compute shader
Pierre-Eric Pelloux-Prayer [Thu, 19 Dec 2019 18:09:54 +0000 (19:09 +0100)]
radeonsi: fix fmask expand compute shader

'coord' variable was using TGSI_WRITEMASK_XYZ so subsequent uses of
TGSI_WRITEMASK_W were dropped.
The result for a 2 samples program was:

  0: UMAD TEMP[0].xy, SV[1].xyyy, IMM[0].xxxx, SV[0].xyyy
  1: STORE IMAGE[0], TEMP[0], TEMP[1], RESTRICT, 2D_MSAA
  2: STORE IMAGE[0], TEMP[0], TEMP[2], RESTRICT, 2D_MSAA
  3: END

instead of the expected:

  0: UMAD TEMP[0].xy, SV[1].xyyy, IMM[0].xxxx, SV[0].xyyy
  1: MOV TEMP[0].w, IMM[0].yyyy
  2: LOAD TEMP[1], IMAGE[0], TEMP[0], RESTRICT, 2D_MSAA
  3: MOV TEMP[0].w, IMM[0].zzzz
  4: LOAD TEMP[2], IMAGE[0], TEMP[0], RESTRICT, 2D_MSAA
  5: MOV TEMP[0].w, IMM[0].yyyy
  6: STORE IMAGE[0], TEMP[0], TEMP[1], RESTRICT, 2D_MSAA
  7: MOV TEMP[0].w, IMM[0].zzzz
  8: STORE IMAGE[0], TEMP[0], TEMP[2], RESTRICT, 2D_MSAA
  9: END

This fixes half of https://gitlab.freedesktop.org/mesa/mesa/issues/2248

Fixes: 095a58204d9 ("radeonsi: expand FMASK before MSAA image stores are used")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3174>

4 years agoegl/android: Restrict minimum triple buffering for android color_buffers
Nataraj Deshpande [Fri, 10 Jan 2020 16:58:00 +0000 (08:58 -0800)]
egl/android: Restrict minimum triple buffering for android color_buffers

The patch restricts triple buffering as minimum at driver for android
color_buffers in order to fix onscreen performance hit for T-Rex and
Manhattan.

v2: Update min_buffer check condition (Tapani Pälli)
v3: further code cleanup (Eric Engestrom)

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2332
Fixes: 0661c357c60 ("egl/android: Update color_buffers querying for buffer age")
Signed-off-by: Nataraj Deshpande <nataraj.deshpande@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3384>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3384>

4 years agoanv: fix pipeline switch back for non pipelined states
Lionel Landwerlin [Tue, 14 Jan 2020 22:05:30 +0000 (00:05 +0200)]
anv: fix pipeline switch back for non pipelined states

Setting state base address can happen even before pipeline is
selected. Also we must ensure it is set to 3D for Gen12, we can't
switch back to an invalid pipeline value (UINT32_MAX).

v2: Reuse helpers (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b34422db5e66 ("anv: Implement Gen12 workaround for non pipelined state")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3396>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3396>

4 years agoradv/gfx10: simplify some duplicated NGG GS code
Samuel Pitoiset [Mon, 13 Jan 2020 08:17:47 +0000 (09:17 +0100)]
radv/gfx10: simplify some duplicated NGG GS code

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3382>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3382>

4 years agoradv/gfx10: enable all CUs if NGG is never used
Samuel Pitoiset [Mon, 13 Jan 2020 09:37:01 +0000 (10:37 +0100)]
radv/gfx10: enable all CUs if NGG is never used

Ported from RadeonSI.

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

4 years agoradv: only use VkSamplerCreateInfo::compareOp if enabled
Samuel Pitoiset [Tue, 14 Jan 2020 17:03:29 +0000 (18:03 +0100)]
radv: only use VkSamplerCreateInfo::compareOp if enabled

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2350
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3392>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3392>

4 years agov3d: fix bug when checking result of syncobj fence import
Iago Toral Quiroga [Mon, 13 Jan 2020 14:42:46 +0000 (15:42 +0100)]
v3d: fix bug when checking result of syncobj fence import

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3383>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3383>

4 years agost/mesa: run st_nir_lower_tex_src_plane for lowered xyuv/ayuv
Jonathan Marek [Fri, 6 Sep 2019 13:30:25 +0000 (09:30 -0400)]
st/mesa: run st_nir_lower_tex_src_plane for lowered xyuv/ayuv

Has the effect of removing the nir_tex_src_plane for these formats too.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1896>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1896>

4 years agost/mesa: don't lower YUV when driver supports it natively
Jonathan Marek [Fri, 6 Sep 2019 13:26:08 +0000 (09:26 -0400)]
st/mesa: don't lower YUV when driver supports it natively

This fixes YUYV support on etnaviv.

Fixes: 7404833c "gallium: add handling for YUV planar surfaces"
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1896>

4 years agoradv: Disable VK_EXT_sample_locations on GFX10.
Bas Nieuwenhuizen [Mon, 30 Dec 2019 14:27:21 +0000 (15:27 +0100)]
radv: Disable VK_EXT_sample_locations on GFX10.

Workaround for https://gitlab.freedesktop.org/mesa/mesa/issues/2163

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3236>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3236>

4 years agost/mesa: implement EGLImageTargetTexStorage
Gurchetan Singh [Tue, 14 Jan 2020 02:03:23 +0000 (18:03 -0800)]
st/mesa: implement EGLImageTargetTexStorage

We can now support this extension.

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

4 years agost/mesa: refactor egl image binding a bit
Gurchetan Singh [Tue, 14 Jan 2020 01:56:41 +0000 (17:56 -0800)]
st/mesa: refactor egl image binding a bit

We'll need it for egl image tex storage.

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

4 years agost/dri: track if image is created by a dmabuf
Gurchetan Singh [Tue, 14 Jan 2020 00:07:38 +0000 (16:07 -0800)]
st/dri: track if image is created by a dmabuf

Will be used by EXT_EGL_image_storage later.

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

4 years agofreedreno/ir3: rename instructions
Rob Clark [Tue, 14 Jan 2020 22:46:11 +0000 (14:46 -0800)]
freedreno/ir3: rename instructions

Turns out this range of opcodes are more general purpose if/else/endif
instructions.

We should re-work tess to create a basic block and use normal flow
control.  And possibly (for a6xx+) optimize cases to use if/else/endif
when appropriate.

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

4 years agonir/algebraic: sqrt(x)*sqrt(x) -> fabs(x)
Elie Tournier [Fri, 24 May 2019 11:16:25 +0000 (12:16 +0100)]
nir/algebraic: sqrt(x)*sqrt(x) -> fabs(x)

total instructions in shared programs: 12840840 -> 12839341 (-0.01%)
instructions in affected programs: 122581 -> 121082 (-1.22%)
helped: 559
HURT: 0

total cycles in shared programs: 302505756 -> 302490031 (<.01%)
cycles in affected programs: 2022900 -> 2007175 (-0.78%)
helped: 1090
HURT: 130

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/948>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/948>

4 years agonir/algebraic: i2f(f2i()) -> trunc()
Elie Tournier [Thu, 23 May 2019 16:16:18 +0000 (17:16 +0100)]
nir/algebraic: i2f(f2i()) -> trunc()

total instructions in shared programs: 12840968 -> 12840784 (<.01%)
instructions in affected programs: 17886 -> 17702 (-1.03%)
helped: 77
HURT: 0

total cycles in shared programs: 302508917 -> 302505592 (<.01%)
cycles in affected programs: 249964 -> 246639 (-1.33%)
helped: 70
HURT: 7

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/948>

4 years agoi965: Reuse the new core glsl_count_dword_slots().
Eric Anholt [Mon, 6 Jan 2020 21:09:25 +0000 (13:09 -0800)]
i965: Reuse the new core glsl_count_dword_slots().

The only difference I could see was treating interfaces like structs.
Maintain that case.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3297>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3297>

4 years agomesa/st: Move the dword slot counting function to glsl_types as well.
Eric Anholt [Mon, 6 Jan 2020 20:00:57 +0000 (12:00 -0800)]
mesa/st: Move the dword slot counting function to glsl_types as well.

To implement NIR-to-TGSI, we need to be able to get the size of the
uniform variable for the TGSI declaration, not just the
.driver_location.  With its location in mesa/st, drivers couldn't link
to it from nir-to-tgsi.

This feels like a common enough function to want, so let's share it in
the core compiler.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3297>

4 years agomesa/prog: Reuse count_vec4_slots() from ir_to_mesa.
Eric Anholt [Mon, 6 Jan 2020 21:19:30 +0000 (13:19 -0800)]
mesa/prog: Reuse count_vec4_slots() from ir_to_mesa.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3297>

4 years agomesa/st: Move the vec4 type size function into core GLSL types.
Eric Anholt [Mon, 6 Jan 2020 19:37:38 +0000 (11:37 -0800)]
mesa/st: Move the vec4 type size function into core GLSL types.

The only bit that gallium varied on was handling of bindless.  We can
retain previous behavior for count_attribute_slots() by passing in
"true" (though I suspect this is just giving a silly answer to a silly
question), and delete our recursive function from mesa/st.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3297>

4 years agomesa/st: Deduplicate the NIR uniform lowering code.
Eric Anholt [Mon, 6 Jan 2020 19:47:03 +0000 (11:47 -0800)]
mesa/st: Deduplicate the NIR uniform lowering code.

Just a little refactor as I go looking at the type size functions.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3297>

4 years agoradeonsi: move PS LLVM code into si_shader_llvm_ps.c
Marek Olšák [Sat, 11 Jan 2020 02:19:46 +0000 (21:19 -0500)]
radeonsi: move PS LLVM code into si_shader_llvm_ps.c

This is an attempt to clean up si_shader.c.

v2: don't move code that is not specific to LLVM

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (v1)
4 years agoradeonsi: remove always constant ballot_mask_bits from si_llvm_context_init
Marek Olšák [Sat, 11 Jan 2020 01:25:28 +0000 (20:25 -0500)]
radeonsi: remove always constant ballot_mask_bits from si_llvm_context_init

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: fold si_create_function into si_llvm_create_func
Marek Olšák [Sat, 11 Jan 2020 01:22:47 +0000 (20:22 -0500)]
radeonsi: fold si_create_function into si_llvm_create_func

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: rename si_shader_create -> si_create_shader_variant for clarity
Marek Olšák [Sat, 11 Jan 2020 01:13:54 +0000 (20:13 -0500)]
radeonsi: rename si_shader_create -> si_create_shader_variant for clarity

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: rename si_compile_tgsi_main -> si_build_main_function
Marek Olšák [Fri, 10 Jan 2020 23:26:01 +0000 (18:26 -0500)]
radeonsi: rename si_compile_tgsi_main -> si_build_main_function

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: clean up si_shader_info
Marek Olšák [Fri, 10 Jan 2020 23:22:27 +0000 (18:22 -0500)]
radeonsi: clean up si_shader_info

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: merge si_tessctrl_info into si_shader_info
Marek Olšák [Fri, 10 Jan 2020 23:09:04 +0000 (18:09 -0500)]
radeonsi: merge si_tessctrl_info into si_shader_info

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: fork tgsi_shader_info and tgsi_tessctrl_info
Marek Olšák [Fri, 10 Jan 2020 23:06:56 +0000 (18:06 -0500)]
radeonsi: fork tgsi_shader_info and tgsi_tessctrl_info

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: rename si_shader_info -> si_shader_binary_info
Marek Olšák [Fri, 10 Jan 2020 22:04:33 +0000 (17:04 -0500)]
radeonsi: rename si_shader_info -> si_shader_binary_info

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: remove TGSI from comments
Marek Olšák [Fri, 10 Jan 2020 21:57:17 +0000 (16:57 -0500)]
radeonsi: remove TGSI from comments

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: rename DBG_NO_TGSI -> DBG_NO_NIR
Marek Olšák [Fri, 10 Jan 2020 21:50:41 +0000 (16:50 -0500)]
radeonsi: rename DBG_NO_TGSI -> DBG_NO_NIR

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agoradeonsi: don't adjust depth and stencil PS output locations
Marek Olšák [Fri, 10 Jan 2020 21:47:04 +0000 (16:47 -0500)]
radeonsi: don't adjust depth and stencil PS output locations

this was for compatibility with TGSI

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agonir: Add missing nir_var_mem_global to various passes
Caio Marcelo de Oliveira Filho [Sat, 11 Jan 2020 07:52:30 +0000 (23:52 -0800)]
nir: Add missing nir_var_mem_global to various passes

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

4 years agospirv: Handle PhysicalStorageBuffer in memory barriers
Caio Marcelo de Oliveira Filho [Wed, 8 Jan 2020 21:30:43 +0000 (13:30 -0800)]
spirv: Handle PhysicalStorageBuffer in memory barriers

PhysicalStorageBuffer is lowered to nir_var_mem_global, and
SPIR-V 1.5rev1 in section "3.25. Memory Semantics <id>" says

    UniformMemory

    Apply the memory-ordering constraints to StorageBuffer,
    PhysicalStorageBuffer, or Uniform Storage Class memory.

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

4 years agospirv: Drop EXT for PhysicalStorageBuffer symbols
Caio Marcelo de Oliveira Filho [Wed, 8 Jan 2020 21:25:59 +0000 (13:25 -0800)]
spirv: Drop EXT for PhysicalStorageBuffer symbols

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

4 years agoaco: Flip s_cbranch / s_cselect to optimize out an s_not if possible.
Timur Kristóf [Tue, 19 Nov 2019 12:29:54 +0000 (13:29 +0100)]
aco: Flip s_cbranch / s_cselect to optimize out an s_not if possible.

When possible, get rid of an s_not when all it does is invert the SCC,
and its successor s_cbranch / s_cselect can be inverted instead.

Also modify some parts of instruction_selection to take advantage of
this feature.

Example:
s2: %3900,  s1: %3899:scc = s_andn2_b64 %0:exec, %406
s2: %3902 = s_cselect_b64 -1, 0, %3900:scc
s2: %407,  s1: %3903:scc = s_not_b64 %3902
s2: %3906,  s1: %3905:scc = s_and_b64 %407, %0:exec
p_cbranch_z %3905:scc
Can now be optimized to:
s2: %3900,  s1: %3899:scc = s_andn2_b64 %0:exec, %406
p_cbranch_nz %3900:scc

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>