mesa.git
2 years agobump version to 20.0.7mesa-20.0.7
Dylan Baker [Thu, 14 May 2020 16:39:46 +0000 (14 09:39 -0700)]
bump version to 20.0.7

2 years agodocs: Add release notes for 20.0.7
Dylan Baker [Thu, 14 May 2020 16:38:57 +0000 (14 09:38 -0700)]
docs: Add release notes for 20.0.7

2 years agoradv: limit the Vulkan version to 1.1 for Android
Samuel Pitoiset [Mon, 11 May 2020 08:52:18 +0000 (11 10:52 +0200)]
radv: limit the Vulkan version to 1.1 for Android

Vulkan 1.2 seems rejected. This hardcodes the Android version to
1.1.107.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2936
Fixes: 7f5462e349a ("radv: enable Vulkan 1.2")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4985>
(cherry picked from commit 69430921fc123b9016d5bf1779c0ab0ed4d95931)

2 years agogallium/util: Fix leak in the live shader cache
Axel Davy [Sun, 10 May 2020 18:12:56 +0000 (10 20:12 +0200)]
gallium/util: Fix leak in the live shader cache

When the nir backend is used, the create_shader
call is supposed to release state->ir.nir.
When the cache hits, create_shader is not called,
thus state->ir.nir should be freed.

There is nothing to be done for the TGSI case as the
tokens release is done by the caller.

This fixes a leak noticed in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/2931

Fixes: 4bb919b0b8b4ed6f6a7049c3f8d294b74b50e198

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4980>
(cherry picked from commit 47bfc799da61aadd60ef9cc5c4bf0651c519cc77)

2 years agonir/algebraic: Optimize ushr of pack_half, not ishr
Ian Romanick [Thu, 2 Apr 2020 19:14:12 +0000 (2 12:14 -0700)]
nir/algebraic: Optimize ushr of pack_half, not ishr

When a = -1.0, pack_half_2x16(vec2(0x0000, 0xBC00)) will produce
0xBC000000.  The ishr will produce 0xFFFFBC00.  The replacement
pack_half_2x16(vec2(0xBC00, 0x0000)) will produce 0x0000BC00.

Fixes: 1f72857739b ("nir/algebraic: add some half packing optimizations")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4515>
(cherry picked from commit a2bf41ec6527fbedc2a75a8072d7222298bca347)

2 years ago.pick_status.json: Update to d76e722ed63607ecead2c66ef9f3a37a12b62bab
Dylan Baker [Tue, 12 May 2020 18:08:36 +0000 (12 11:08 -0700)]
.pick_status.json: Update to d76e722ed63607ecead2c66ef9f3a37a12b62bab

2 years agoaco: fix 64-bit trunc with negative exponents on GFX6
Samuel Pitoiset [Wed, 6 May 2020 13:34:07 +0000 (6 15:34 +0200)]
aco: fix 64-bit trunc with negative exponents on GFX6

v_frexp_exp returns the exponent as an unsigned value.

Also, v_ashr returns either 0 or -1 depending on the sign of the
source operand, but what we want is only the sign bit.

Fixes a bunch of recent dEQP-VK.glsl.builtin.precision_double.* tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4921>
(cherry picked from commit 3fba0a7a6f01496344ddb93e774b2d4bc9195e8a)

2 years agopanfrost: don't always build bifrost_compiler
Qiang Yu [Fri, 24 Apr 2020 08:20:25 +0000 (24 16:20 +0800)]
panfrost: don't always build bifrost_compiler

src/panfrost/shared is shared with lima driver, build
bifrost_compiler for lima driver is meaningless and
get link error when only lima driver is enabled.

So only build bifrost_compiler when configued with:
  meson -Dtools=panfrost

Fixes: ec2a59cd7aa4 "panfrost: Move non-Gallium files outside of Gallium"
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4960>
(cherry picked from commit 07b0fbea92a66499ef7c0f9b748b1034831201b1)

2 years ago.pick_status.json: Update to 0bea2a13212be10982e14617002a3ff851b84717
Dylan Baker [Mon, 11 May 2020 17:17:17 +0000 (11 10:17 -0700)]
.pick_status.json: Update to 0bea2a13212be10982e14617002a3ff851b84717

2 years agoanv: don't expose VK_INTEL_performance_query without kernel support
Lionel Landwerlin [Thu, 7 May 2020 08:36:36 +0000 (7 11:36 +0300)]
anv: don't expose VK_INTEL_performance_query without kernel support

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2b5f30b1d91b ("anv: implement VK_INTEL_performance_query")
Acked-by: Timothy Strelchun <timothy.strelchun@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4937>
(cherry picked from commit 4f17e9eef6f9f8a2986264b3da5157542983a1da)

2 years agointel/perf: store the probed i915-perf version
Lionel Landwerlin [Mon, 2 Mar 2020 12:00:55 +0000 (2 14:00 +0200)]
intel/perf: store the probed i915-perf version

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4344>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4344>
(cherry picked from commit aad0e6f81049c098fd3922d61aa228e4bf791317)

2 years agoradeonsi: Fix omitted flush when moving suballocated texture
Blaž Tomažič [Wed, 6 May 2020 19:34:10 +0000 (6 21:34 +0200)]
radeonsi: Fix omitted flush when moving suballocated texture

Fixes: 5e805cc74bc52f97de8f6308fc06bc96623e7e09 "radeonsi: flush the context after resource_copy_region for buffer exports"

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4925>
(cherry picked from commit 808eb20186a23be1a1917668e374243151e6699e)

2 years agoradeonsi: retab
Dylan Baker [Fri, 8 May 2020 17:15:37 +0000 (8 10:15 -0700)]
radeonsi: retab

To allow backports to apply

2 years ago.pick_status.json: Update to d11e4738a86ecac6bb4cfaf5cad5c1d32169b18f
Dylan Baker [Fri, 8 May 2020 17:14:36 +0000 (8 10:14 -0700)]
.pick_status.json: Update to d11e4738a86ecac6bb4cfaf5cad5c1d32169b18f

2 years agoradeonsi: fix compilation of monolithic PS
Marek Olšák [Wed, 6 May 2020 13:42:55 +0000 (6 09:42 -0400)]
radeonsi: fix compilation of monolithic PS

This was totally broken. Monolithic PS is only used if FBFETCH or
interpolateAtSample are used.

When the PS prolog was built, it overwrote ctx->main_fn.

Discovered by @eefano.

Fixes: 8832a884345686e6a8b2c0c8aa7515ad3f775b9e "radeonsi: move PS LLVM code into si_shader_llvm_ps.c"
Closes: #2814

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4918>
(cherry picked from commit 29da52128090a1ef8ef782188c0f67c7f5ec8d19)

2 years agoradeonsi: retab si_shader_llvm_ps.c
Dylan Baker [Thu, 7 May 2020 16:56:05 +0000 (7 09:56 -0700)]
radeonsi: retab si_shader_llvm_ps.c

So that patches apply cleanly

Generated with sed -i 's@\t@   @g'

2 years agoradv: don't report error with other vendor DRM devices
Samuel Pitoiset [Wed, 29 Apr 2020 11:23:22 +0000 (29 13:23 +0200)]
radv: don't report error with other vendor DRM devices

Enumeration should just skip unsupported DRM devices.

Cc: <mesa-stable@lists.freedesktop.org>
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/4806>
(cherry picked from commit 8d993c9d2c23d70d48248c9a8f8bc2855e12b18f)

2 years agoradv: report INITIALIZATION_FAILED when the amdgpu winsys init failed
Samuel Pitoiset [Wed, 29 Apr 2020 11:24:36 +0000 (29 13:24 +0200)]
radv: report INITIALIZATION_FAILED when the amdgpu winsys init failed

The driver should be capable if it reaches the winsys initialization.

Cc: <mesa-stable@lists.freedesktop.org>
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/4806>
(cherry picked from commit f03abd504102fc71ec0b18704a2ea3a92542b5f8)

2 years agov3d: Include supported DXT formats to enable s3tc/dxt extensions
Jose Maria Casanova Crespo [Thu, 7 May 2020 01:50:16 +0000 (7 03:50 +0200)]
v3d: Include supported DXT formats to enable s3tc/dxt extensions

DXT1_RGBA and sRGB variants of DXT[135] formats are enabled as
valid format on V3D.

Once all S3TC formats supported by V3C are enabled the following
extensions become exposed by gallium.

    * GL_ANGLE_texture_compression_dxt3
    * GL_ANGLE_texture_compression_dxt5,
    * GL_EXT_texture_compression_dxt1
    * GL_EXT_texture_compression_s3tc
    * GL_S3_s3tc
    * GL_EXT_texture_compression_s3tc_srgb

This enables 206 passing piglit test related to gl_compressed.*s3tc_dxt

Cc: 20.0 20.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4934>
(cherry picked from commit 905edc376dd1ace6ac2af0fc351606210a0141a1)

2 years agov3d: Fix swizzle in DXT3 and DXT5 formats
Jose Maria Casanova Crespo [Thu, 7 May 2020 01:37:22 +0000 (7 03:37 +0200)]
v3d: Fix swizzle in DXT3 and DXT5 formats

Swizzles were ignoring the W component of the format DXT3_RGBA and
DXT5_RGBA.

This fixes 15 piglit tests:

spec/!opengl 1.1/copyteximage 2d
spec/!opengl 1.2/copyteximage 3d
spec/arb_texture_compression/fbo-generatemipmap-formats/gl_compressed_rgba
spec/arb_texture_compression/fbo-generatemipmap-formats/gl_compressed_rgba npot
spec/arb_texture_compression/texwrap formats bordercolor-swizzled/gl_compressed_rgba, swizzled, border color only
spec/arb_texture_compression/texwrap formats bordercolor/gl_compressed_rgba, border color only
spec/arb_texture_cube_map/copyteximage cube
spec/arb_texture_cube_map/copyteximage cube samples=2
spec/arb_texture_cube_map/copyteximage cube samples=4
spec/arb_texture_rectangle/copyteximage rect
spec/arb_texture_rectangle/copyteximage rect samples=2
spec/arb_texture_rectangle/copyteximage rect samples=4
spec/ext_texture_array/copyteximage 2d_array
spec/ext_texture_array/copyteximage 2d_array samples=2
spec/ext_texture_array/copyteximage 2d_array samples=4

Fixes: 469bbd8387d1 "broadcom/vc5: Move the formats table to per-V3D-version compile."
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4934>
(cherry picked from commit e3ecf48dda2ddabfbabdad83e19d280d0edb8246)

2 years agoclover/nir: Check the result of spirv_to_nir
Pierre Moreau [Tue, 5 May 2020 11:13:19 +0000 (5 13:13 +0200)]
clover/nir: Check the result of spirv_to_nir

Fixes: deb04adf2ae ("clover: add support for passing kernels as nir to the driver")
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4901>
(cherry picked from commit 38bbfd3a57d68abdc88a93b436eac9f30a397b0f)

2 years ago.pick_status.json: Update to 6d513eb0db25a272da65822f35907456b544f172
Dylan Baker [Thu, 7 May 2020 16:47:43 +0000 (7 09:47 -0700)]
.pick_status.json: Update to 6d513eb0db25a272da65822f35907456b544f172

2 years ago.pick_status.json: Mark 9392ddab4399d796fdf37602f586965ec17f2b2a as backported
Dylan Baker [Thu, 7 May 2020 02:31:20 +0000 (6 19:31 -0700)]
.pick_status.json: Mark 9392ddab4399d796fdf37602f586965ec17f2b2a as backported

2 years agoaco: consider blocks unreachable if they are in the logical cfg
Rhys Perry [Mon, 27 Apr 2020 12:53:59 +0000 (27 13:53 +0100)]
aco: consider blocks unreachable if they are in the logical cfg

backport of 9392ddab4399d796fdf37602f586965ec17f2b2a

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

2 years agoi965: Fix out-of-bounds access to brw_stage_state::surf_offset
Danylo Piliaiev [Fri, 27 Mar 2020 14:55:52 +0000 (27 16:55 +0200)]
i965: Fix out-of-bounds access to brw_stage_state::surf_offset

../src/mesa/drivers/dri/i965/brw_wm_surface_state.c:1378:32: runtime error: index 3503345872 out of bounds for type 'uint32_t [149]'

brw_assign_common_binding_table_offsets has the following comment:
 "Unused groups are initialized to 0xd0d0d0d0 to make it obvious that they're
 unused but also make sure that addition of small offsets to them will
 trigger some of our asserts that surface indices are < BRW_MAX_SURFACES."

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4350>
(cherry picked from commit 784358bd6e6d59c521133c2a31fa9b88f8e18598)

2 years agollvmpipo/nir: free compute shader NIR
Dave Airlie [Tue, 5 May 2020 06:03:34 +0000 (5 16:03 +1000)]
llvmpipo/nir: free compute shader NIR

I forgot this in the last round.

Fixes: 18f896e55d96 (llvmpipe: add initial nir support)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4899>
(cherry picked from commit 870b6a60509e2dd547dc75fee9290224ad306779)

2 years agonir: add missing group_memory_barrier handling
Rhys Perry [Mon, 4 May 2020 17:54:11 +0000 (4 18:54 +0100)]
nir: add missing group_memory_barrier handling

Totals from 2 (0.00% of 127638) affected shaders:
VGPRs: 164 -> 168 (+2.44%)
CodeSize: 18420 -> 18756 (+1.82%)
Instrs: 3658 -> 3700 (+1.15%)
Cycles: 82912 -> 83080 (+0.20%)
VMEM: 70 -> 69 (-1.43%)
PreVGPRs: 155 -> 168 (+8.39%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
CC: <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4889>
(cherry picked from commit a46aa3dc2e4c5462630d40e152904b7d163c9233)

2 years ago.pick_status.json: Mark d80fb024302aa6058945826a79ba0caf9611fcc1 as backported
Dylan Baker [Wed, 6 May 2020 23:05:58 +0000 (6 16:05 -0700)]
.pick_status.json: Mark d80fb024302aa6058945826a79ba0caf9611fcc1 as backported

2 years ago.pick_status.json: Update to 6292059662dccd3e151c731a3b108fd0b9e4c606
Dylan Baker [Wed, 6 May 2020 23:05:45 +0000 (6 16:05 -0700)]
.pick_status.json: Update to 6292059662dccd3e151c731a3b108fd0b9e4c606

2 years agoegl/wayland: Fix zwp_linux_dmabuf usage
Christopher James Halse Rogers [Tue, 24 Mar 2020 03:19:51 +0000 (24 14:19 +1100)]
egl/wayland: Fix zwp_linux_dmabuf usage

There's no guarantee that the formats advertised by wl_drm and the formats
advertised by zwp_linux_dmabuf_v1 are the same.

get_back_bo() handles this by falling back from createImageWithModifiers() to
createImage() when there's a wl_drm format but no corresponding linux_dmabuf
format, but create_wl_buffer() unconditionally tries to create a linux_dmabuf
buffer unless DRIimage has DRM_FORMAT_MOD_INVALID.

Fix this by always checking if the DRIimage modifier has been advertised
by zwp_linux_dmabuf_v1, and falling back to wl_drm if not.

If DRM_FORMAT_MOD_INVALID has been advertised then we trust the client
has allocated something appropriate and treat any modifier as matching.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2220
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
(cherry picked from commit 98675d34c115e3a8db9b6b74e8eca01af5fff101)

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

2 years agoegl: allow INVALID format for linux_dmabuf
Ivan Molodetskikh [Thu, 26 Sep 2019 21:45:39 +0000 (27 00:45 +0300)]
egl: allow INVALID format for linux_dmabuf

As per
https://gitlab.freedesktop.org/wayland/wayland-protocols/commit/fb9b2a87317c77e26283da5f6c9559d709f6fdcd,
the compositor may advertise DRM_FORMAT_MOD_INVALID as a supported
modifier. This patch makes mesa recognize this fact and allow
linux_dmabuf usage with the INVALID modifier in this case.

In case the driver doesn't support modifiers, we can still use
linux-dmabuf protocol instead of the legacy wl_drm interface to create
wl_buffers. This will help compositors to handle these buffers better.

In this commit, the INVALID modifier is allowed to be added to the list
of supported modifiers, and create_wl_buffer will be able to use
linux_dmabuf with an INVALID modifier if the compositor advertised it as
supported.

Signed-off-by: Ivan Molodetskikh <yalterz@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2147>
(cherry picked from commit c376865f5eeca535c4aa8e33bcf166052c1ce2f2)

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

2 years agowinsys/amdgpu: Retrieve WC flags from imported buffers.
Bas Nieuwenhuizen [Mon, 13 Apr 2020 23:44:10 +0000 (14 01:44 +0200)]
winsys/amdgpu: Retrieve WC flags from imported buffers.

Otherwise reading from an imported mapped GTT+WC linear texture
is painfully slow.

Sadly no radeon winsys implementation, as I don't know a suitable
kernel driver operation.

Hit this  in vaGetImage with an image imported from minigbm (which
we are switching to allocate WC for SCANOUT images).

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit d80fb024302aa6058945826a79ba0caf9611fcc1)

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

2 years agoci: disable t820/mali4xx tests
Neil Armstrong [Thu, 23 Apr 2020 07:53:28 +0000 (23 09:53 +0200)]
ci: disable t820/mali4xx tests

The BayLibre LAVA lab is down for a week now and requires more work
than anticipated to make it available again.

Let's disable the tests running on these lab until the lab is up again.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2 years ago.pick_status.json: Mark bdd2f284d90b7f07ac5e878490be8d216d0d23c6 as denominated
Dylan Baker [Mon, 4 May 2020 20:58:54 +0000 (4 13:58 -0700)]
.pick_status.json: Mark bdd2f284d90b7f07ac5e878490be8d216d0d23c6 as denominated

2 years agoiris: don't assert on unfinished aux import in copy paths
Lionel Landwerlin [Tue, 21 Apr 2020 09:25:44 +0000 (21 12:25 +0300)]
iris: don't assert on unfinished aux import in copy paths

After a resource is created the first command using it could be a copy
command.

In iris_state we finish the import on surface/view creation but we
don't do that for copies.

v2: Move finish call to gallium entrypoints (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2725
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4657>
(cherry picked from commit 612e35c8d94241b07b32a6010ccd1a3edd473439)

2 years agoradeonsi: unify and align down the max SSBO/TBO/UBO buffer binding size
Marek Olšák [Sun, 26 Apr 2020 05:23:11 +0000 (26 01:23 -0400)]
radeonsi: unify and align down the max SSBO/TBO/UBO buffer binding size

Rounding down the size fixes:
    KHR-GL45.enhanced_layouts.ssb_member_invalid_offset_alignment

Fixes: 03e2adc990d239119619f22599204c1b37b83134

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4761>
(cherry picked from commit e58dcc47c3bd4d3f22e9d0a943e339b4866bc616)

2 years agoradeonsi: Retab si_get.c
Dylan Baker [Mon, 4 May 2020 17:37:46 +0000 (4 10:37 -0700)]
radeonsi: Retab si_get.c

This was done on master, and is making applying backports awful.

2 years agovulkan: Allow destroying NULL debug report callbacks
Jason Ekstrand [Tue, 21 Apr 2020 16:29:21 +0000 (21 11:29 -0500)]
vulkan: Allow destroying NULL debug report callbacks

Fixes: 086cfa5652 "anv: implementation of VK_EXT_debug_report extension"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4690>
(cherry picked from commit 9d10bde5a878aac440ea34dfb304812cd00b231c)

2 years agost/mesa: destroy only own program variants when program is released
Tapani Pälli [Thu, 30 Apr 2020 10:03:48 +0000 (30 13:03 +0300)]
st/mesa: destroy only own program variants when program is released

Earlier commit tried to achieve this but actually did more. This makes
sure the variants for other contexts continue to live.

Fixes: de3d7dbed52 ("mesa/st: release variants for active programs before unref")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2865
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4831>
(cherry picked from commit 46b3cb011fd1c9198aeec33d453206846b579817)

2 years agoradeonsi: fix export count
Pierre-Eric Pelloux-Prayer [Mon, 4 May 2020 08:50:47 +0000 (4 10:50 +0200)]
radeonsi: fix export count

Fixes: 17acff01a00 ("radeonsi: skip vs output optimizations for some outputs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2877
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4871>
(cherry picked from commit 7e7bb38bd8b12fec09afc0e515480bb6c5a8475a)

2 years agoradv: Extend tiling flags to 64-bit.
Bas Nieuwenhuizen [Sat, 2 May 2020 11:59:59 +0000 (2 13:59 +0200)]
radv: Extend tiling flags to 64-bit.

SCANOUT is bit 63 ....

Fixes: bfd9e7ff243 "radv: Use new scanout gfx9 metadata flag."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2879
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4859>
(cherry picked from commit df9629e593ee7faee617e90b644b52f049801e34)

2 years agoanv,iris: Fix input vertex max for tcs on gen12
D Scott Phillips [Thu, 30 Apr 2020 23:12:07 +0000 (30 23:12 +0000)]
anv,iris: Fix input vertex max for tcs on gen12

gen12 does away with the single patch dispatch mode for tcs, and
increases some limits so that 8_patch mode can always work. Make the
necessary changes so we don't try to fall back to single patch mode.

Fixes KHR-GL46.tessellation_shader.single.max_patch_vertices and others

Fixes: 44754279ace7 ("intel/fs/gen12: Use TCS 8_PATCH mode.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4843>
(cherry picked from commit 65b05ebdda18c1cebd88c72cc8f50530addb80c6)

2 years agointel/fs: Update location of Render Target Array Index for gen12
D Scott Phillips [Thu, 30 Apr 2020 17:38:33 +0000 (30 17:38 +0000)]
intel/fs: Update location of Render Target Array Index for gen12

Render Target Array Index has moved from R0.0[26:16] to
R1.1[26:16] on gen12.

Fixes dEQP-VK.multiview.input_attachments.*

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4836>
(cherry picked from commit 7bd15135a6dc105939a3e1c349217e6346dcf729)

2 years ago.pick_status.json: Update to b97cc41aa203fd9fb9f5cf5f5aa7fd40f567917d
Dylan Baker [Mon, 4 May 2020 17:20:56 +0000 (4 10:20 -0700)]
.pick_status.json: Update to b97cc41aa203fd9fb9f5cf5f5aa7fd40f567917d

2 years ago.pick_status.json: Mark 3fac55ce0d066d767d6c6c8308f79d0c3e566ec0 as denominated
Dylan Baker [Thu, 30 Apr 2020 16:54:07 +0000 (30 09:54 -0700)]
.pick_status.json: Mark 3fac55ce0d066d767d6c6c8308f79d0c3e566ec0 as denominated

2 years ago.pick_status.json: Update to 3fac55ce0d066d767d6c6c8308f79d0c3e566ec0
Dylan Baker [Thu, 30 Apr 2020 16:52:36 +0000 (30 09:52 -0700)]
.pick_status.json: Update to 3fac55ce0d066d767d6c6c8308f79d0c3e566ec0

2 years agointel/fs: Don't delete coalesced MOVs if they have a cmod
Jason Ekstrand [Mon, 27 Apr 2020 20:31:12 +0000 (27 15:31 -0500)]
intel/fs: Don't delete coalesced MOVs if they have a cmod

Shader-db results on ICL:

    total instructions in shared programs: 17133088 -> 17133287 (<.01%)
    instructions in affected programs: 61300 -> 61499 (0.32%)
    helped: 0
    HURT: 199

This means it's likely fixing 199 bugs. :-)  All the changed shaders are
in Mad Max.  It's surprisingly difficult to get the back-end compiler to
generate a pattern that hits this we don't tend to emit a lot coalescable
MOVs.  The pattern in Mad Max that's able to hit is fsign(fsat(x)) under
the right conditions.

Closes: #2820
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4773>
(cherry picked from commit e581ddeeeecf9475d0634794ee126096d0f23135)

2 years agomesa: report GL_INVALID_OPERATION for invalid glTextureBuffer target
Marek Olšák [Mon, 27 Apr 2020 05:03:38 +0000 (27 01:03 -0400)]
mesa: report GL_INVALID_OPERATION for invalid glTextureBuffer target

This fixes:
    KHR-GL46.direct_state_access.textures_buffer_errors
    KHR-GL46.direct_state_access.textures_buffer_range_errors

Fixes: 98e64e538af - main: Added entry point for glTextureBuffer

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4759>
(cherry picked from commit a2542deb63adb3b5536947bcf9610c0ceca9da28)

2 years agonir/copy_prop_vars: Report progress when deleting self-copies
Jason Ekstrand [Mon, 27 Apr 2020 15:38:31 +0000 (27 10:38 -0500)]
nir/copy_prop_vars: Report progress when deleting self-copies

Fixes: 62332d139c8f6 "nir: Add a local variable-based copy prop..."

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4767>
(cherry picked from commit ed677171675fe8ee204deac1e2089f480681b1b4)

2 years ago.pick_status.json: Update to 2efa76f795cb2b2bf00b317c580aeeeddd1e9bc2
Dylan Baker [Wed, 29 Apr 2020 22:21:30 +0000 (29 15:21 -0700)]
.pick_status.json: Update to 2efa76f795cb2b2bf00b317c580aeeeddd1e9bc2

2 years agodocs: Add SHA256 sums for 20.0.6
Dylan Baker [Wed, 29 Apr 2020 23:10:57 +0000 (29 16:10 -0700)]
docs: Add SHA256 sums for 20.0.6

2 years agoVERSION: bump to 20.0.6mesa-20.0.6
Dylan Baker [Wed, 29 Apr 2020 22:35:17 +0000 (29 15:35 -0700)]
VERSION: bump to 20.0.6

2 years agodocs: Add release notes for 20.0.6
Dylan Baker [Wed, 29 Apr 2020 22:33:42 +0000 (29 15:33 -0700)]
docs: Add release notes for 20.0.6

2 years agoanv: Expose CS workgroup sizes based on a maximum of 64 threads
Jason Ekstrand [Sat, 25 Apr 2020 00:07:44 +0000 (24 19:07 -0500)]
anv: Expose CS workgroup sizes based on a maximum of 64 threads

Otherwise, we'll hit asserts in brw_compile_cs.

Fixes: cf12faef614ab "intel/compiler: Restrict cs_threads to 64"
Closes: #2835
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4746>
(cherry picked from commit 81ac741f8929b90a16a0b4251f3e6da02dde6133)

2 years agointel/devinfo: Compute the correct L3$ size for Gen12
Jason Ekstrand [Tue, 28 Apr 2020 03:43:42 +0000 (27 22:43 -0500)]
intel/devinfo: Compute the correct L3$ size for Gen12

Fixes: 8125d7960b6 "intel/dev: Add preliminary device info for Tigerlake"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Clayton Craft <clayton.a.craft@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4782>
(cherry picked from commit 86f67952d31554b8b4b5a9943b43ace988c6401f)

2 years agoradv: Use actual memory type count for setting app-visible bitset.
Bas Nieuwenhuizen [Sat, 25 Apr 2020 21:39:21 +0000 (25 23:39 +0200)]
radv: Use actual memory type count for setting app-visible bitset.

Otherwise we might make a bitset that is too large.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4751>
(cherry picked from commit 4a8d172d3f81ef981e386f0cc6c259c36818f697)

2 years agofreedreno: Fix calculation of the const buffer cmdstream size.
Eric Anholt [Fri, 17 Apr 2020 17:45:17 +0000 (17 10:45 -0700)]
freedreno: Fix calculation of the const buffer cmdstream size.

The HW packet requires padding the number of pointers you emit, and we
would assertion fail about running out of buffer space if the number of
UBOs to be uploaded was odd.

Fixes: b4df115d3f3c ("freedreno/a6xx: pre-calculate userconst stateobj size")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4621>
(cherry picked from commit 69c8dfd49f565283f599b3be9af3f1327ea78803)

2 years ago.pick_status.json: Update to 6b551d9f360e45ba4e74867dbe79ae212e4766c5
Dylan Baker [Tue, 28 Apr 2020 19:01:45 +0000 (28 12:01 -0700)]
.pick_status.json: Update to 6b551d9f360e45ba4e74867dbe79ae212e4766c5

2 years agost/mesa: Treat vertex inputs absent in inputMapping as zero in mesa_to_tgsi
Danylo Piliaiev [Thu, 23 Apr 2020 09:41:34 +0000 (23 12:41 +0300)]
st/mesa: Treat vertex inputs absent in inputMapping as zero in mesa_to_tgsi

After updating vertex inputs being read based on optimized NIR, they may go out
of sync with inputs in mesa IR. Which is translated to TGSI and used together
with NIR if draw doesn't have llvm.

It's much easier to treat such inputs as zero because there is no pass to
entirely get rid of them and they don't contribute to shader's output.

Fixes: d684fb37bfbc47d098158cb03c0672119a4469fe
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2815
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4705>
(cherry picked from commit eeab9c93db84e5759145891e8fdde66a5cdcf917)

2 years agonir/lower_subgroups: Mask off unused bits in ballot ops
Jason Ekstrand [Thu, 23 Apr 2020 02:35:48 +0000 (22 21:35 -0500)]
nir/lower_subgroups: Mask off unused bits in ballot ops

Thanks to VK_EXT_subgroup_size_control, we can end up with
gl_SubgroupSize being as low as 8 on Intel.

Fixes: d10de253097 "anv: Implement VK_EXT_subgroup_size_control"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4694>
(cherry picked from commit fdf9b674ee3a17c98fd266750dec3475910542f6)

2 years agoanv: Drop an assert
Jason Ekstrand [Thu, 23 Apr 2020 02:18:03 +0000 (22 21:18 -0500)]
anv: Drop an assert

Ever since Vulkan 1.2, this feature has been in core so enabling the
extension is no longer required.

Fixes: 4ef3f7e3d37e "anv: Enable Vulkan 1.2 support"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4694>
(cherry picked from commit 9c009da208b77496011f149fd1e289656da0f226)

2 years agospirv: Fix passing combined image/samplers through function calls
Jason Ekstrand [Wed, 22 Apr 2020 20:49:25 +0000 (22 15:49 -0500)]
spirv: Fix passing combined image/samplers through function calls

Fixes dEQP-VK.spirv_assembly.instruction.function_params.sampler_param

cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4684>
(cherry picked from commit bc5c43828970b49a9c6b2d08d9fb7f46a3300ae4)

2 years agonir/opt_deref: Remove certain sampler type casts
Jason Ekstrand [Wed, 22 Apr 2020 20:47:28 +0000 (22 15:47 -0500)]
nir/opt_deref: Remove certain sampler type casts

The SPIR-V parser sometimes generates casts from specific sampler types
like sampler2D to the bare sampler type.  This results in a cast which
causes heartburn for drivers but is harmless to remove.

cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4684>
(cherry picked from commit a1a08a58025a6026aae0f73b67451198f5befb42)

2 years agoturnip: Properly handle all sizes of specialization constants
Jason Ekstrand [Wed, 22 Apr 2020 18:43:51 +0000 (22 13:43 -0500)]
turnip: Properly handle all sizes of specialization constants

cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4675>
(cherry picked from commit 6211e79ba5f4be57c088fdf6140854f67c9a37ec)

2 years agoradv: Properly handle all sizes of specialization constants
Jason Ekstrand [Wed, 22 Apr 2020 18:42:12 +0000 (22 13:42 -0500)]
radv: Properly handle all sizes of specialization constants

cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4675>
(cherry picked from commit a4885df9f82130132fe361a547b9e61c96787d61)

2 years agoanv: Properly handle all sizes of specialization constants
Jason Ekstrand [Wed, 22 Apr 2020 18:41:14 +0000 (22 13:41 -0500)]
anv: Properly handle all sizes of specialization constants

Closes: #2812
cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4675>
(cherry picked from commit a44e63398b045f0a5f56e4d719d25a8501ab53cd)

2 years agospirv: Allow constants and NULLs in SpvOpConvertUToPtr
Jason Ekstrand [Wed, 22 Apr 2020 07:50:30 +0000 (22 02:50 -0500)]
spirv: Allow constants and NULLs in SpvOpConvertUToPtr

We were accidentally asserting that the value had to be a vtn_ssa_value
which isn't true if it, for instance, comes from a spec constant.

Fixes: fb282a68bc46 "spirv: Implement OpConvertPtrToU and OpConvertUToPtr"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4675>
(cherry picked from commit 64e4297629a1c4be501b40fb3529ff11441eff99)

2 years agomeson: Use dependency.partial_dependency()
Quentin Glidic [Thu, 23 Apr 2020 08:47:05 +0000 (23 10:47 +0200)]
meson: Use dependency.partial_dependency()

It avoids calling pkg-config which was searched for in a wrong way, thus
breaking setup where unprefixed pkg-config was banned (e.g. on Exherbo).

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Fixes: 53f9131205a63fa8b282ab2a7e96c48209447da0
       ("meson: fix getting cflags from pkg-config")

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4701>
(cherry picked from commit 00f5ea9fdc8f5a8d460767cfa8a10639646fb665)

2 years ago.pick_status.json: Update to 42b1696ef627a5bfee29911a780fa0a4dbf04610
Dylan Baker [Mon, 27 Apr 2020 17:33:04 +0000 (27 10:33 -0700)]
.pick_status.json: Update to 42b1696ef627a5bfee29911a780fa0a4dbf04610

2 years agointel/perf: Enable MDAPI queries for Gen12
Lionel Landwerlin [Thu, 16 Apr 2020 10:03:47 +0000 (16 13:03 +0300)]
intel/perf: Enable MDAPI queries for Gen12

We're missing the cases for gen12 leading to those metrics going
missing.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 15b7b56eb2fb41 ("intel/perf: add TGL support")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4586>
(cherry picked from commit 086ea1ac7ee41fbb6bd031bfdf281a7e276cfe7a)

2 years agointel/perf: move mdapi query definitions to their own file
Lionel Landwerlin [Wed, 4 Sep 2019 11:10:22 +0000 (4 14:10 +0300)]
intel/perf: move mdapi query definitions to their own file

Where they belong.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4344>
(cherry picked from commit dde96d31b75f7895900405ab771fb3dd0dd78069)

2 years agointel/perf: break GL query stuff away
Lionel Landwerlin [Wed, 4 Sep 2019 10:52:13 +0000 (4 13:52 +0300)]
intel/perf: break GL query stuff away

This stuff is somewhat specific to the GL extension & drivers. On
Vulkan we won't use this, it also made a rather large file.

v2: Fix Android build (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4344>
(cherry picked from commit 33b9c7a7f68bb5a4362751ba7daf1ba2b10ece95)

2 years agointel/perf: move register definition to special file
Lionel Landwerlin [Wed, 13 Nov 2019 13:21:00 +0000 (13 15:21 +0200)]
intel/perf: move register definition to special file

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4344>
(cherry picked from commit f5c5574f427c710fa2ed7413dc970ccb649b16d7)

2 years agomeson: correct windows-version define
Erik Faye-Lund [Wed, 22 Apr 2020 15:54:38 +0000 (22 17:54 +0200)]
meson: correct windows-version define

The macro "_WINVER" does nothing, the macro definitions that matter for
windows API version selection are "_WIN32_WINNT" and "WINVER".

The header "sdkddkver.h" (which is included from thousands of
different windows-headers) defines "WINVER" to the same value as
"_WIN32_WINNT" of only the latter is defined, which explains why this
works right now. But we shouldn't depend on that kind of luck, and
instead define the right maco.

Fixes: 3aee462781a ("meson: add windows compiler checks and libraries")
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4681>
(cherry picked from commit 7f17a0a809195cefa2240f55d30f00e3fe0572b3)

2 years agoradv: Use TRUNC_COORD on samplers
Joshua Ashton [Tue, 25 Feb 2020 19:24:15 +0000 (25 19:24 +0000)]
radv: Use TRUNC_COORD on samplers

The default behaviour (0) is: "round-nearest-even to n.6 and drop fraction when point sampling" whereas the Vulkan spec simply wants us to floor it (1) "truncate when point sampling".

See 15.6.1 in the Vulkan spec.
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-normalized-operations

The Direct3D spec also mandates this (https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpec.htm#7.18.7%20Point%20Sample%20Addressing)

This fixes some point-sampling texture precision issues in some Direct3D 9 titles such as Guild Wars 2 and htoL#NiQ: The Firefly Diary that are not present on other vendors.

Fixes dEQP-VK.pipeline.sampler.exact_sampling.*

https://github.com/Joshua-Ashton/d9vk/issues/450
https://github.com/doitsujin/dxvk/issues/1433

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3951>
(cherry picked from commit 58f25098a0dc4f4976dadacdc4e7a9db42ec0c50)

2 years agoradv: make sure to export the viewport index if FS needs it
Samuel Pitoiset [Wed, 22 Apr 2020 20:21:55 +0000 (22 22:21 +0200)]
radv: make sure to export the viewport index if FS needs it

If FS reads gl_ViewportIndex but VS doesn't export it, it should
be zero to avoid reading garbage.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2818
Fixes: b424d49ac05 ("radv/llvm: fix exporting the viewport index if the fragment shader needs it")
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/4687>
(cherry picked from commit 7086b38c81ebe2f0520461c1bc1a7b92863cf871)

2 years ago.pick_status.json: Update to efdb7fa9a83b0a216b1837a5912b71669bf3f984
Dylan Baker [Thu, 23 Apr 2020 16:27:39 +0000 (23 09:27 -0700)]
.pick_status.json: Update to efdb7fa9a83b0a216b1837a5912b71669bf3f984

2 years ago.pick_status.json: Update to 51c1c4d95a05b6eb6fce74e8d624615e4a1b38ab
Dylan Baker [Thu, 23 Apr 2020 05:09:38 +0000 (22 22:09 -0700)]
.pick_status.json: Update to 51c1c4d95a05b6eb6fce74e8d624615e4a1b38ab

2 years agoradeonsi: skip vs output optimizations for some outputs
Pierre-Eric Pelloux-Prayer [Tue, 14 Apr 2020 16:04:35 +0000 (14 18:04 +0200)]
radeonsi: skip vs output optimizations for some outputs

If PT_SPRITE_TEX is enabled, PS inputs are overriden at runtime so
we can't apply the vs output optim.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2747
Fixes: 3ec9975555d ("radeonsi: eliminate trivial constant VS outputs")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4559>
(cherry picked from commit 17acff01a00109c87d59b9d876fc735dd5fbe3d1)

2 years agoanv: Apply any needed PIPE_CONTROLs before emitting state
Jason Ekstrand [Thu, 16 Apr 2020 20:33:43 +0000 (16 15:33 -0500)]
anv: Apply any needed PIPE_CONTROLs before emitting state

Push constants in particular can get picked up by the hardware at weird
times that happen *before* 3DPRIMITIVE.  Therefore, we need to flush
before we emit all our state to ensure that any data they may pick up is
in memory in time.  This fixes an app which does vkCmdCopyBuffers
immediately followed by a vkCmdBeginRenderPass and vkCmdDraw which uses
the destination of the copy as a UBO which we push.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4601>
(cherry picked from commit 969aeb6a93aefd037b130e4b37f58043fef493c3)

2 years agoanv: Move vb_emit setup closer to where it's used in flush_state
Jason Ekstrand [Thu, 16 Apr 2020 20:31:15 +0000 (16 15:31 -0500)]
anv: Move vb_emit setup closer to where it's used in flush_state

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4601>
(cherry picked from commit ffc84eac0d5a0c30e445fcdb2f0cfd0c5bf5321d)

2 years ago.pick_status.json: Update to 51c1c4d95a05b6eb6fce74e8d624615e4a1b38ab
Dylan Baker [Thu, 23 Apr 2020 04:42:01 +0000 (22 21:42 -0700)]
.pick_status.json: Update to 51c1c4d95a05b6eb6fce74e8d624615e4a1b38ab

2 years ago.pick_status.json: Mark 0123b8f63415d3d320929e6112da2be2d837b262 as denominated
Dylan Baker [Wed, 22 Apr 2020 22:03:25 +0000 (22 15:03 -0700)]
.pick_status.json: Mark 0123b8f63415d3d320929e6112da2be2d837b262 as denominated

2 years agospirv: Expand workaround for OpControlBarrier on old GLSLang
Danylo Piliaiev [Tue, 21 Apr 2020 15:20:39 +0000 (21 18:20 +0300)]
spirv: Expand workaround for OpControlBarrier on old GLSLang

In SPIRV of compute shader in Aztec Ruins benchmark there is:

OpControlBarrier %uint_1 %uint_1 %uint_0
// ControlBarrier(Device, Device, rdcspv::MemorySemantics(0));

which is an incorrect translation of glsl barrier().

GLSLang, prior to c3f1cdfa, emitted the OpControlBarrier with
Device instead of Workgroup for execution scope.

2365520c covers similar case but isn't applied when execution_scope
is SpvScopeDevice.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2742
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Tested-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4660>
(cherry picked from commit 66229aa16968eb60dd631a8f48f593a4fa8478d5)

2 years agoiris: fail screen creation when kernel support is not there
Lionel Landwerlin [Mon, 20 Apr 2020 14:09:42 +0000 (20 17:09 +0300)]
iris: fail screen creation when kernel support is not there

v2: Bump check to I915_PARAM_HAS_CONTEXT_ISOLATION (v4.16) (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2803
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4643>
(cherry picked from commit f402b7c57641dd2ab4d39032574294c03d75b595)

2 years agomesa/gallium: do not use enum for bit-allocated member
Erik Faye-Lund [Fri, 13 Mar 2020 12:56:44 +0000 (13 13:56 +0100)]
mesa/gallium: do not use enum for bit-allocated member

The signedness of enums are undefined, so on platforms with signed
enums, this isn't going to work. One such platform is Microsoft Windows.

So let's just use an unsigned here instead.

Fixes: b1c4c4c7f53 ("mesa/gallium: automatically lower alpha-testing")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4648>
(cherry picked from commit 013d9e40feed336d983b728357e4ce77b871c36d)

2 years agomeson: update llvm dependency logic for meson 0.54.0
Dylan Baker [Tue, 14 Apr 2020 17:06:35 +0000 (14 10:06 -0700)]
meson: update llvm dependency logic for meson 0.54.0

In meson 0.54.0 I fixed the llvm cmake dependency to return "not found"
if shared linking is requested. This means that for 0.54.0 and later we
don't need to do anything, and for earlier versions we only need to
change the logic to force the config-tool method if shared linking is
required.

Fixes: 821cf6942a390f5f64d8a2cff9933b24c84f7dc1
       ("meson: Use cmake to find LLVM when building for window")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4556>
(cherry picked from commit fdd0ce12ac88e433c7712acd5226fa07dc870057)

2 years agoanv/android: fix assert in anv_import_ahw_memory
Abhishek Kumar [Tue, 21 Apr 2020 06:28:31 +0000 (21 06:28 +0000)]
anv/android: fix assert in anv_import_ahw_memory

Commit fixes assert that triggers when running
   dEQP-VK.api.external.memory.android_hardware_buffer.dedicated.buffer#bind_export_import_bind

on a debug build of Mesa.

Fixes: c79a528d ("anv/android: support import/export of AHardwareBuffer objects")
Signed-off-by: Abhishek Kumar <abhishek4.kumar@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4655>
(cherry picked from commit f06e4ab3190a0a715447c4df4017892adb8708dc)

2 years agost/mesa: Re-assign vs in locations after updating nir info for ffvp/ARB_vp
Danylo Piliaiev [Mon, 20 Apr 2020 14:17:53 +0000 (20 17:17 +0300)]
st/mesa: Re-assign vs in locations after updating nir info for ffvp/ARB_vp

After call to nir_shader_gather_info - inputs_read may have changed so
st_nir_assign_vs_in_locations should be called for shader to remain in
sync with vbo state.

Fixes piglit tests:
  gl-1.0-fpexceptions
  gl-1.1-color-material-unused-normal-array
  arb_vertex_program-unused-attributes
regression on several gallium drivers.

Fixes: d684fb37bfbc47d098158cb03c0672119a4469fe
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4645>
(cherry picked from commit 829013d0cad0fa2513b32ae07cf8d745f6e5c62d)

2 years ago.pick_status.json: Update to c552b5fd1d106adc04f62fcbe71d650a9a17f7e0
Dylan Baker [Wed, 22 Apr 2020 22:02:59 +0000 (22 15:02 -0700)]
.pick_status.json: Update to c552b5fd1d106adc04f62fcbe71d650a9a17f7e0

2 years agodocs: Add sha256 sums for 20.0.5
Dylan Baker [Wed, 22 Apr 2020 21:55:34 +0000 (22 14:55 -0700)]
docs: Add sha256 sums for 20.0.5

2 years agoVERSION: bump for 20.0.5mesa-20.0.5
Dylan Baker [Wed, 22 Apr 2020 21:35:13 +0000 (22 14:35 -0700)]
VERSION: bump for 20.0.5

2 years agodocs: Add relnotes for 20.0.5
Dylan Baker [Wed, 22 Apr 2020 21:34:51 +0000 (22 14:34 -0700)]
docs: Add relnotes for 20.0.5

2 years agoanv: Report correct SLM size
Jason Ekstrand [Wed, 15 Apr 2020 21:06:03 +0000 (15 16:06 -0500)]
anv: Report correct SLM size

Fixes: d787a2d0 "anv: Implement VK_KHR_pipeline_executable_properties"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4597>
(cherry picked from commit b8acf9a3d4af33cf8b6b8c870167c2aa348990a0)

2 years agointel: Add _const versions of prog_data cast helpers
Jason Ekstrand [Wed, 15 Apr 2020 21:05:43 +0000 (15 16:05 -0500)]
intel: Add _const versions of prog_data cast helpers

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4597>
(cherry picked from commit e003104605f506333d2ac8a9c2baf9f04eaebb81)

2 years agonir: Lower returns correctly inside nested loops
Arcady Goldmints-Orlov [Thu, 16 Apr 2020 21:28:12 +0000 (16 16:28 -0500)]
nir: Lower returns correctly inside nested loops

Inside nested flow control, nir_lower_returns inserts predicated breaks
in the outer block. However, it would omit doing this if the remainder
of the outer block (after the inner block) was empty. This is not
correct in the case of loops, as execution just wraps back around to the
start of the loop, so this change doesn't skip the predication inside
loops.

Fixes: 79dec93ead6e (nir: Add return lowering pass)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2724

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4603>
(cherry picked from commit ec1b96fdc8bccaf2c1a4e1e3cca32b4aacbe4f7c)

2 years agoutil/sparse_free_list: manipulate node pointers using atomic primitives
Lionel Landwerlin [Fri, 17 Apr 2020 17:42:41 +0000 (17 20:42 +0300)]
util/sparse_free_list: manipulate node pointers using atomic primitives

Probably doesn't fix anything but those should be accessed in an
atomic way just like the head pointer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e4f01eca3b3cd1 ("util: Add a free list structure for use with util_sparse_array")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4613>
(cherry picked from commit cdc43775917e301a7ca654fcebb94fad08dc4131)

2 years agospirv: Handle OOB vector extract operations
Jason Ekstrand [Thu, 9 Apr 2020 21:44:33 +0000 (9 16:44 -0500)]
spirv: Handle OOB vector extract operations

We use vtn_vector_extract to handle vector component level derefs.  This
makes us gracefully handle the case where your vector component is OOB
and give you an undef.  The SPIR-V working group is still working out
whether or not this is technically legal but it's very little code for
us to handle it so we may as well.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4495>
(cherry picked from commit 380bf556bfe34357f802dc49e1e104dc8fdf951a)

2 years agoutil/sparse_array: don't stomp head's counter on pop operations
D Scott Phillips [Fri, 17 Apr 2020 17:28:06 +0000 (17 10:28 -0700)]
util/sparse_array: don't stomp head's counter on pop operations

By temporarily storing the new_head by a uint32_t, we wipe out the
counter section of the head pointer.

Fixes: e4f01eca ("util: Add a free list structure for use with util_sparse_array")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4612>
(cherry picked from commit dc3a17997b479f91f36b2421e9c41c11a025de47)

2 years agost/mesa: Update shader info of ffvp/ARB_vp after translation to NIR
Danylo Piliaiev [Thu, 16 Apr 2020 13:34:25 +0000 (16 16:34 +0300)]
st/mesa: Update shader info of ffvp/ARB_vp after translation to NIR

We must update stp->Base.info after translation and before
st_prepare_vertex_program is called, because inputs_read
may become outdated after NIR optimization passes.

For ffvp/ARB_vp inputs_read is populated based on declared
attributes without taking their usage into consideration.
When creating shader variants we expect that their inputs_read
would match the base ones for input mapping to work properly.

Cc: <mesa-stable@lists.freedesktop.org>
Fixes: 8a0dd0af3f1a6c0310a08daf4220132ec6815b31
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2758
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4598>
(cherry picked from commit d684fb37bfbc47d098158cb03c0672119a4469fe)