platform/upstream/mesa.git
3 years agoamd: Simplify ac_addrlib_create
James Park [Fri, 27 Nov 2020 12:14:19 +0000 (04:14 -0800)]
amd: Simplify ac_addrlib_create

Rework ac_addrlib_create to rely solely on radeon_info without
amdgpu_gpu_info.

No longer need <amdgpu.h> to create ac_addrlib instance.

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

3 years agomesa/st: choose S/D format depending on gl_format passed for readpixels
Tapani Pälli [Fri, 20 Nov 2020 09:31:16 +0000 (11:31 +0200)]
mesa/st: choose S/D format depending on gl_format passed for readpixels

This makes sure we create correct type of a sampler view for reading.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3775
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/7707>

3 years agov3dv/pipeline: avoid unused warning on release build
Alejandro Piñeiro [Fri, 27 Nov 2020 12:14:47 +0000 (13:14 +0100)]
v3dv/pipeline: avoid unused warning on release build

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

3 years agodocs: grammar fixes
Theogen Ratkin [Thu, 26 Nov 2020 22:38:16 +0000 (18:38 -0400)]
docs: grammar fixes

Signed-off-by: Theogen Ratkin <feogenratkin@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7804>

3 years agoradv: Deal with unused attachments in mip flush
Bas Nieuwenhuizen [Fri, 27 Nov 2020 14:07:17 +0000 (15:07 +0100)]
radv: Deal with unused attachments in mip flush

Fixes: 4cce4d22a72 ("radv: Fix a hang on CB change by adding flushes.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7813>

3 years agofreedreno/a6xx: add support for ARB_shader_stencil_export
Danylo Piliaiev [Thu, 26 Nov 2020 17:57:26 +0000 (19:57 +0200)]
freedreno/a6xx: add support for ARB_shader_stencil_export

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7810>

3 years agoradv: disable SQTT support for unsupported GPUs
Samuel Pitoiset [Thu, 26 Nov 2020 09:39:23 +0000 (10:39 +0100)]
radv: disable SQTT support for unsupported GPUs

Like GFX10.3 which is currently broken.

Cc: 20.2 20.3
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/7786>

3 years agoaco: use binding chasing helpers
Rhys Perry [Fri, 23 Oct 2020 10:54:08 +0000 (11:54 +0100)]
aco: use binding chasing helpers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7291>

3 years agoac/nir: use binding chasing helpers
Rhys Perry [Fri, 23 Oct 2020 10:46:25 +0000 (11:46 +0100)]
ac/nir: use binding chasing helpers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7291>

3 years agonir/opt_load_store_vectorize: use resource binding chasing helpers
Rhys Perry [Fri, 23 Oct 2020 10:37:42 +0000 (11:37 +0100)]
nir/opt_load_store_vectorize: use resource binding chasing helpers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7291>

3 years agonir: add helpers for chasing resource bindings
Rhys Perry [Fri, 23 Oct 2020 10:22:48 +0000 (11:22 +0100)]
nir: add helpers for chasing resource bindings

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7291>

3 years agoCI: Re-enable MSVC build
Daniel Stone [Thu, 26 Nov 2020 17:30:52 +0000 (17:30 +0000)]
CI: Re-enable MSVC build

Trying this again after reworking the virtualised network setup on the
Windows runner.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agoCI: Build d3d12 Gallium driver and CLC framework on MSVC
Daniel Stone [Thu, 26 Nov 2020 19:02:45 +0000 (19:02 +0000)]
CI: Build d3d12 Gallium driver and CLC framework on MSVC

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agoCI: Update Windows build for current Meson options
Daniel Stone [Thu, 26 Nov 2020 19:01:40 +0000 (19:01 +0000)]
CI: Update Windows build for current Meson options

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agoCI: Remove ludicrous Windows container build timeout
Daniel Stone [Thu, 26 Nov 2020 19:03:47 +0000 (19:03 +0000)]
CI: Remove ludicrous Windows container build timeout

The full end-to-end job now completes in around 45min, which is far more
reasonable than the previous 3.5h.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agoCI: Windows: Use 32 vCPUs for Mesa build
Daniel Stone [Thu, 26 Nov 2020 18:10:27 +0000 (18:10 +0000)]
CI: Windows: Use 32 vCPUs for Mesa build

The physical machine has 64, and the bottleneck is mostly I/O and
network, so let's just go ahead and smash the CPUs to bits.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agoCI: Add Windows libclc and SPIRV-LLVM-Translator builds
Daniel Stone [Thu, 26 Nov 2020 17:47:38 +0000 (17:47 +0000)]
CI: Add Windows libclc and SPIRV-LLVM-Translator builds

We need these builds in Windows in order to build the microsoft-clc
parts.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agomicrosoft/clc: Disable broken f32 -> i64/u64 test
Daniel Stone [Thu, 26 Nov 2020 23:42:13 +0000 (23:42 +0000)]
microsoft/clc: Disable broken f32 -> i64/u64 test

Saturated conversions from f32 -> i64/u64 need to be reworked in the
upstream tree. Disable this test until we've done so, since it doesn't
pass currently.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agomicrosoft/clc: Allow building with Clang git
Daniel Stone [Thu, 26 Nov 2020 19:25:32 +0000 (19:25 +0000)]
microsoft/clc: Allow building with Clang git

clang's version argument will return '1.2.3git' when built from a
non-release source tree, but the resource directory will be '1.2.3'.
Strip the 'git' suffix if it's there.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>

3 years agod3d12: remove hand-written intrinsic builders
Rhys Perry [Fri, 27 Nov 2020 10:13:49 +0000 (10:13 +0000)]
d3d12: remove hand-written intrinsic builders

These are no longer necessary and break the build.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: c9bcad25737 ("nir: add generated intrinsic builders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7808>

3 years agonir: fix nir_builder.h on MSVC C++ and GCC7.
Rhys Perry [Fri, 27 Nov 2020 09:56:50 +0000 (09:56 +0000)]
nir: fix nir_builder.h on MSVC C++ and GCC7.

MSVC C++ can't do designated initializers without /std:c++latest. These
helpers will likely be removed soon anyway, so just don't use the
intrinsic builders here.

This should also fix the GCC7 build, which doesn't implement non-trivial
designated initializers.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: c9bcad25737 ("nir: add generated intrinsic builders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7808>

3 years agonir: fix intrinsic builders on MSVC C++
Rhys Perry [Fri, 27 Nov 2020 09:55:11 +0000 (09:55 +0000)]
nir: fix intrinsic builders on MSVC C++

Fix this error:
error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: c9bcad25737 ("nir: add generated intrinsic builders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7808>

3 years agor600/sfn: lower all IO in one pass
Gert Wollny [Thu, 26 Nov 2020 16:30:34 +0000 (17:30 +0100)]
r600/sfn: lower all IO in one pass

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: simplify IO lowering and fix TESS IO lowering
Gert Wollny [Wed, 25 Nov 2020 19:44:13 +0000 (20:44 +0100)]
r600/sfn: simplify IO lowering and fix TESS IO lowering

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: lower GS IO
Gert Wollny [Tue, 24 Nov 2020 19:55:07 +0000 (20:55 +0100)]
r600/sfn: lower GS IO

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: drop store_deref handling for VS and TES
Gert Wollny [Tue, 24 Nov 2020 20:26:33 +0000 (21:26 +0100)]
r600/sfn: drop store_deref handling for VS and TES

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: Lower tess-eval IO
Gert Wollny [Mon, 23 Nov 2020 10:46:33 +0000 (11:46 +0100)]
r600/sfn: Lower tess-eval IO

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: lower VS output IO
Gert Wollny [Mon, 23 Nov 2020 10:45:59 +0000 (11:45 +0100)]
r600/sfn: lower VS output IO

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: Fix vertex stage export to accomodate IO lowering
Gert Wollny [Mon, 23 Nov 2020 10:44:04 +0000 (11:44 +0100)]
r600/sfn: Fix vertex stage export to accomodate IO lowering

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: remove unused FS input deref code
Gert Wollny [Sat, 21 Nov 2020 15:34:10 +0000 (16:34 +0100)]
r600/sfn: remove unused FS input deref code

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: lower IO for FS inputs and handle interpolation accordingly
Gert Wollny [Sat, 21 Nov 2020 15:22:11 +0000 (16:22 +0100)]
r600/sfn: lower IO for FS inputs and handle interpolation accordingly

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: Add simplified constructors for FS shader inputs.
Gert Wollny [Sat, 21 Nov 2020 15:20:50 +0000 (16:20 +0100)]
r600/sfn: Add simplified constructors for FS shader inputs.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: Add lowering pass to convert load_interpolated to load for POS
Gert Wollny [Sat, 21 Nov 2020 15:20:01 +0000 (16:20 +0100)]
r600/sfn: Add lowering pass to convert load_interpolated to load for POS

the values are loaded directly from a register and the specification of
parycentrics is only in the way.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agor600/sfn: fix component loading from fixed buffer ID
Gert Wollny [Mon, 23 Nov 2020 17:49:08 +0000 (18:49 +0100)]
r600/sfn: fix component loading from fixed buffer ID

Fixes: 18e97817148eb376274a8749c03b45c2f817c139
    r600/sfn: Use load_ubo_vec4 lowering pass

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7715>

3 years agopanfrost: Update the resource layout when doing a tile -> linear conversion
Boris Brezillon [Thu, 26 Nov 2020 14:35:20 +0000 (15:35 +0100)]
panfrost: Update the resource layout when doing a tile -> linear conversion

If we don't do that the stride in texture/framebuffer descriptors
is wrong, leading to page faults when those buffers are accessed.

Fixes: 00360cd5c85e ("panfrost: Calculate the row stride at resource creation time")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7797>

3 years agov3dv: extend the list of formats supported by the TFU unit
Iago Toral Quiroga [Thu, 26 Nov 2020 09:44:30 +0000 (10:44 +0100)]
v3dv: extend the list of formats supported by the TFU unit

Also, update the hardware version assert check to match what we are
really requiring for Vulkan.

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

3 years agov3dv: batch buffer to image copies with the texel buffer path if possible
Iago Toral Quiroga [Wed, 25 Nov 2020 13:16:19 +0000 (14:16 +0100)]
v3dv: batch buffer to image copies with the texel buffer path if possible

When copying multiple regions that have the same image subresource we are
effectively copying various rects across the same layer range, so we can
batch together all the rects to copy for each layer in a single job.

This allows us to significantly reduce CPU overhead when recording the
command, as we need to produce less jobs and allocate less descriptor
sets. It also offers smaller gains in execution time due to the reduced
job count.

A stress test where we copy 10 subrects of an image in a loop 100 time,
choosing regions that will involve the texel buffer path, we get these
results:

                  | Recording Time | Execution Time |
        ----------|----------------|----------------|
        master    |     3.021s     |    0.112s      |
        ----------|----------------|----------------|
        patch     |     0.163s     |    0.080s      |
        ----------|----------------|----------------|

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

3 years agov3dv: fix leak in the buffer to image copy via texel buffer
Iago Toral Quiroga [Thu, 26 Nov 2020 07:02:36 +0000 (08:02 +0100)]
v3dv: fix leak in the buffer to image copy via texel buffer

Fixes: ba69c36ada5 ("v3dv: add a buffer to image copy path using a texel buffer")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7782>

3 years agoradeonsi: implement GS fast launch for indexed triangle strips
Marek Olšák [Mon, 9 Nov 2020 22:52:45 +0000 (17:52 -0500)]
radeonsi: implement GS fast launch for indexed triangle strips

This increases performance for indexed triangle strips up to +100%.
In practice, it's limited by memory bandwidth and compute power,
so 256-bit memory bus and a lot of CUs are recommended.

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

3 years agoradv: Fix a hang on CB change by adding flushes.
Bas Nieuwenhuizen [Mon, 19 Oct 2020 00:53:39 +0000 (02:53 +0200)]
radv: Fix a hang on CB change by adding flushes.

This workaround fixes a hang while loading a renderdoc trace for me.

Since the workload does 1 mip per cmdbuffer it is quite hard to confirm
what exactly the conditions for the hang are but this is the most
restrictive set I found and it corresponds to a workaround in AMDVLK as
well.

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

3 years agodocs: document new zink-flag
Erik Faye-Lund [Thu, 26 Nov 2020 18:26:23 +0000 (19:26 +0100)]
docs: document new zink-flag

We forgot to document this previously, so let's add it now.

Fixes: feb9462bb19 ("zink: Added inbuilt debug logging from the VK_LAYER_LUNARG_standard_validation layer.")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7802>

3 years agonir: make intrinsic order in nir_print consistent
Rhys Perry [Mon, 14 Sep 2020 18:51:41 +0000 (19:51 +0100)]
nir: make intrinsic order in nir_print consistent

Make it consistent with nir_intrinsics.py, the unlabelled indices just
before it and the intrinsic builders.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agoradv: use intrinsic builders
Rhys Perry [Thu, 3 Sep 2020 18:44:00 +0000 (19:44 +0100)]
radv: use intrinsic builders

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

3 years agonir: use intrinsic builders
Rhys Perry [Thu, 3 Sep 2020 16:20:17 +0000 (17:20 +0100)]
nir: use intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agoglsl_to_nir: use intrinsic builders
Rhys Perry [Mon, 7 Sep 2020 13:17:14 +0000 (14:17 +0100)]
glsl_to_nir: use intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agospirv: use intrinsic builders
Rhys Perry [Mon, 7 Sep 2020 13:16:57 +0000 (14:16 +0100)]
spirv: use intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: add generated intrinsic builders
Rhys Perry [Mon, 7 Sep 2020 12:55:38 +0000 (13:55 +0100)]
nir: add generated intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: move nir_load_system_value() to nir_builder.h
Rhys Perry [Mon, 14 Sep 2020 18:56:48 +0000 (19:56 +0100)]
nir: move nir_load_system_value() to nir_builder.h

To make review easier.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: remove useless nir_builder_opcodes.h include
Rhys Perry [Mon, 14 Sep 2020 18:57:25 +0000 (19:57 +0100)]
nir: remove useless nir_builder_opcodes.h include

This is included earlier in the file.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: add destination bit-size information to more intrinsics
Rhys Perry [Mon, 7 Sep 2020 12:35:41 +0000 (13:35 +0100)]
nir: add destination bit-size information to more intrinsics

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: add bit_size_src for when the destination bit size matches a source
Rhys Perry [Mon, 7 Sep 2020 12:25:59 +0000 (13:25 +0100)]
nir: add bit_size_src for when the destination bit size matches a source

If bit_size_src is not -1, then it's the index of the source the
destination bit size can be expected to match. This will be useful for
generating intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: use a single canonical list of intrinsic indices
Rhys Perry [Tue, 24 Nov 2020 12:51:59 +0000 (12:51 +0000)]
nir: use a single canonical list of intrinsic indices

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agonir: fix sampler_lod_parameters_pan indices
Rhys Perry [Thu, 10 Sep 2020 10:58:04 +0000 (11:58 +0100)]
nir: fix sampler_lod_parameters_pan indices

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: deaebc82a73 "nir: Add load_sampler_lod_paramaters_pan intrinsic"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587>

3 years agofreedreno/a6xx: Fix typo in height alignment calculation in a6xx layout
Danylo Piliaiev [Thu, 26 Nov 2020 12:05:59 +0000 (14:05 +0200)]
freedreno/a6xx: Fix typo in height alignment calculation in a6xx layout

Fixes KHR-GL31.texture_size_promotion.functional

Fixes: e49748521ec9182e8d2eec823182cc463709123f
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7792>

3 years agofreedreno/a6xx: add support for dual-source blending
Danylo Piliaiev [Thu, 19 Nov 2020 09:27:33 +0000 (11:27 +0200)]
freedreno/a6xx: add support for dual-source blending

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7708>

3 years agonir/lower_non_uniform: improve code with the same texture, sampler indices
Rhys Perry [Thu, 13 Feb 2020 15:09:53 +0000 (15:09 +0000)]
nir/lower_non_uniform: improve code with the same texture, sampler indices

NIR can't CSE the read_first_invocation intrinsics, so we can end up
creating iand(read_first_invocation(a) == a, read_first_invocation(a) == a)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3813>

3 years agoanv: fix descriptor pool leak in VMA object
Lionel Landwerlin [Thu, 26 Nov 2020 14:37:01 +0000 (16:37 +0200)]
anv: fix descriptor pool leak in VMA object

Quoting the spec :

   "When a pool is destroyed, all descriptor sets allocated from the
    pool are implicitly freed and become invalid. Descriptor sets
    allocated from a given pool do not need to be freed before
    destroying that descriptor pool."

This implies we might leak nodes allocated in the vma object.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0a6d2593b8b63d ("anv: Allocate descriptor buffers from the BO cache")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7796>

3 years agoaco/optimizer: Propagate scc_needed label through p_wqm.
Timur Kristóf [Wed, 5 Feb 2020 11:14:00 +0000 (12:14 +0100)]
aco/optimizer: Propagate scc_needed label through p_wqm.

Without this, RA is confused and adds a bunch of unnecessary moves.

Fossil-db results (Navi 10):

Totals from 7658 (5.55% of 137887) affected shaders:
SGPRs: 752488 -> 752392 (-0.01%)
CodeSize: 74046720 -> 73924368 (-0.17%); split: -0.17%, +0.00%
Instrs: 14293916 -> 14263350 (-0.21%); split: -0.21%, +0.00%
Cycles: 1455556728 -> 1438466536 (-1.17%); split: -1.17%, +0.00%
VMEM: 1096736 -> 1094962 (-0.16%); split: +0.03%, -0.19%
SMEM: 448436 -> 448418 (-0.00%); split: +0.00%, -0.01%
SClause: 485501 -> 485495 (-0.00%); split: -0.00%, +0.00%
Copies: 1383769 -> 1353029 (-2.22%); split: -2.22%, +0.00%
Branches: 568247 -> 568451 (+0.04%); split: -0.01%, +0.05%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7677>

3 years agoaco/optimizer: Only set scc_needed when it is actually needed.
Timur Kristóf [Wed, 18 Nov 2020 20:28:09 +0000 (21:28 +0100)]
aco/optimizer: Only set scc_needed when it is actually needed.

Not every p_cbranch uses the SCC, but our optimizer thought so.

Fixes: 8a32f57fff56b3b94f1b5589feba38016f39427c
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7677>

3 years agoglsl: avoid an out-of-bound access while setting up a location for variable
Andrii Simiklit [Thu, 29 Oct 2020 15:05:19 +0000 (17:05 +0200)]
glsl: avoid an out-of-bound access while setting up a location for variable

It fixes the following valgrind issue:
==141996== Invalid read of size 4
==141996==    at 0x61F8806: gl_nir_link_uniforms (gl_nir_link_uniforms.c:1788)
==141996==    by 0x60F17AA: gl_nir_link_glsl (gl_nir_linker.c:672)
==141996==    by 0x5C1AEDF: st_link_nir (st_glsl_to_nir.cpp:739)
==141996==    by 0x5C15574: st_link_shader (st_glsl_to_ir.cpp:172)
==141996==    by 0x5C673B0: _mesa_glsl_link_shader (ir_to_mesa.cpp:3117)
==141996==    by 0x5E7B61C: link_program (shaderapi.c:1311)
==141996==    by 0x5E7B61C: link_program_error (shaderapi.c:1419)
==141996==    by 0x5E7CF8A: _mesa_LinkProgram (shaderapi.c:1911)
==141996==    by 0x4923D13: stub_glLinkProgram (piglit-dispatch-gen.c:33956)
==141996==    by 0x1142C0: link_and_use_shaders (shader_runner.c:1636)
==141996==    by 0x1205A6: init_test (shader_runner.c:5347)
==141996==    by 0x121555: piglit_init (shader_runner.c:5725)
==141996==    by 0x4991C84: run_test (piglit_fbo_framework.c:50)

It can be reproduced on `iris` using the following piglit test:
instance-matching-shader-storage-blocks-align-qualifier-mismatch.shader_test

Closes: #3818
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fixes: 47c35823 ("glsl: fix up location setting for variables pointing to a UBO's base")
Signed-off-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7376>

3 years agoglsl: Drop mingw -O1 workaround for GCC>=7.3
Michel Zou [Wed, 25 Nov 2020 14:46:36 +0000 (15:46 +0100)]
glsl: Drop mingw -O1 workaround for GCC>=7.3

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7770>

3 years agoscons: Fix build with llvm-12.
Vinson Lee [Sun, 22 Nov 2020 06:05:38 +0000 (22:05 -0800)]
scons: Fix build with llvm-12.

This patch fixes these SCons build errors.

/usr/bin/ld: build/linux-x86_64-debug/gallium/auxiliary/libgallium.a(lp_bld_misc.os): in function `llvm::InitializeNativeTarget()':
llvm/Support/TargetSelect.h:118: undefined reference to `LLVMInitializeX86TargetInfo'
/usr/bin/ld: llvm/Support/TargetSelect.h:119: undefined reference to `LLVMInitializeX86Target'
/usr/bin/ld: llvm/Support/TargetSelect.h:120: undefined reference to `LLVMInitializeX86TargetMC'
/usr/bin/ld: build/linux-x86_64-debug/gallium/auxiliary/libgallium.a(lp_bld_misc.os): in function `llvm::InitializeNativeTargetAsmPrinter()':
llvm/Support/TargetSelect.h:132: undefined reference to `LLVMInitializeX86AsmPrinter'
/usr/bin/ld: build/linux-x86_64-debug/gallium/auxiliary/libgallium.a(lp_bld_misc.os): in function `llvm::InitializeNativeTargetDisassembler()':
llvm/Support/TargetSelect.h:156: undefined reference to `LLVMInitializeX86Disassembler'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7722>

3 years agoradv/winsys: fix the sysmem submission path for GFX6
Samuel Pitoiset [Thu, 26 Nov 2020 11:03:55 +0000 (12:03 +0100)]
radv/winsys: fix the sysmem submission path for GFX6

Oops.

Fixes: cba6ec309ab ("radv: Fix -Wshadow warnings")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7790>

3 years agoradv: Const aco_compiler_statistic_info usage
James Park [Thu, 26 Nov 2020 10:05:22 +0000 (02:05 -0800)]
radv: Const aco_compiler_statistic_info usage

Necessary for upcoming const correctness change to aco struct.

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

3 years agoradv: fix missing initialization of the predication value
Samuel Pitoiset [Thu, 26 Nov 2020 11:27:10 +0000 (12:27 +0100)]
radv: fix missing initialization of the predication value

It's expected to be 0.

Fixes: 62d9ca696e0 ("radv: use 32-bit predication for conditional rendering on GFX10.3+")
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/7789>

3 years agov3dv: remove non-conformant warning
Alejandro Piñeiro [Tue, 24 Nov 2020 21:25:21 +0000 (22:25 +0100)]
v3dv: remove non-conformant warning

The driver is now Vulkan 1.0 conformant.

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

3 years agodocs/features: update list of v3dv supported features
Alejandro Piñeiro [Tue, 24 Nov 2020 21:24:21 +0000 (22:24 +0100)]
docs/features: update list of v3dv supported features

We have been implementing some features without updating the file, and
we even had some that were supported for a while.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
v2: include VK_KHR_wayland_surface as !7303 got merged

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

3 years agoac: use bigger storage for ac_arg::arg_index / ac_shader_args::arg_count
Pierre-Eric Pelloux-Prayer [Tue, 24 Nov 2020 10:13:48 +0000 (11:13 +0100)]
ac: use bigger storage for ac_arg::arg_index / ac_shader_args::arg_count

AC_MAX_ARGS is now 384 so uint8_t isn't enough.

Fixes: 6f130342658 ("ac/llvm: prepare for passing VS->TCS IO via VGPRs")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7750>

3 years agoradeonsi/gfx10: flush gfx cs on ngg -> legacy transition
Pierre-Eric Pelloux-Prayer [Mon, 23 Nov 2020 12:48:42 +0000 (13:48 +0100)]
radeonsi/gfx10: flush gfx cs on ngg -> legacy transition

with a sequence like this:

  glClear(STENCIL)
  glBeginTransformFeedback()
  ...
  glEndTransformFeedback()
  glClear(STENCIL)

The second clear sometimes may produce an unexpected result.

Calling si_flush_gfx_cs() when doing ngg -> legacy transition seems to be a
valid workaround (both for the synthetic reproducer and the real Blender bug).

Using flush flags or events (BOTTOM_OF_PIPE_TS, RESET_TO_LOWEST_VGT) didn't help.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2941
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7750>

3 years agoutil,radv: Cross-platform monotonic condition variable
James Park [Sat, 31 Oct 2020 23:18:34 +0000 (16:18 -0700)]
util,radv: Cross-platform monotonic condition variable

cnd_t operates on REALTIME clock, and isn't suitable for MONOTONIC use.

Clone the API, and implement using a monotonic clock.

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

3 years agoutil/os_time: Safe os_time_get_nano for Windows
James Park [Tue, 3 Nov 2020 18:03:13 +0000 (10:03 -0800)]
util/os_time: Safe os_time_get_nano for Windows

Avoid small possibility of reading torn write on 32-bit platforms.

If frequency caching is desired, it's probably better to initialize from
C++ and extern "C" instead. It's not a tremendous optimization though.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7138>

3 years agoc11/threads: Remove Windows XP support
James Park [Wed, 12 Aug 2020 02:28:09 +0000 (19:28 -0700)]
c11/threads: Remove Windows XP support

Enable and remove EMULATED_THREADS_USE_NATIVE_CV. Delete legacy code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7138>

3 years agoc11/threads: Remove Win32 null checks
James Park [Wed, 12 Aug 2020 02:26:39 +0000 (19:26 -0700)]
c11/threads: Remove Win32 null checks

Nonsensical to pass null. glibc doesn't check, and neither should we.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7138>

3 years agoc11/threads: Fix Win32 timed functions
James Park [Wed, 12 Aug 2020 02:24:12 +0000 (19:24 -0700)]
c11/threads: Fix Win32 timed functions

mtx_timedlock and cnd_timedwait now use relative milliseconds.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7138>

3 years agofrontends/va/postproc: Convert destination when deinterlacing
Thong Thai [Mon, 21 Sep 2020 17:56:05 +0000 (13:56 -0400)]
frontends/va/postproc: Convert destination when deinterlacing

When the VAAPI deinterlacing filter is chained with other VAAPI
post-processing filters, the image might get deinterlaced multiple
times, as the filters after the deinterlacing filter might still see an
interlaced buffer.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6803>

3 years agofrontends/va/postproc: Use the actual image height when blitting
Thong Thai [Mon, 21 Sep 2020 17:53:16 +0000 (13:53 -0400)]
frontends/va/postproc: Use the actual image height when blitting

Updates the height of the blitting parameter to use the actual image
height instead of the buffer height, otherwise when scaling, garbage
lines are shown in the output.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6803>

3 years agointel/disasm: Don't rely on FALLTHROUGHTs to print unsupported SFID
Caio Marcelo de Oliveira Filho [Tue, 24 Nov 2020 06:04:51 +0000 (21:04 -0900)]
intel/disasm: Don't rely on FALLTHROUGHTs to print unsupported SFID

The code works but is a bit fragile if we ever add a case that has a
less strict requirement (a smaller gen) than the case above.  To avoid
having to reason about this, refactor code to use a variable to
indicate whether the SFID is supported or not.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7742>

3 years agopanfrost: Fix stride calculation for Z32_S8X24/X32_S8X24 formats
Boris Brezillon [Sat, 21 Nov 2020 15:03:32 +0000 (16:03 +0100)]
panfrost: Fix stride calculation for Z32_S8X24/X32_S8X24 formats

Z32_S8X24 variants are actually stored in 2 planes (one per component),
we have to adjust the bytes_per_pixel value accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Calculate the row stride at resource creation time
Boris Brezillon [Sat, 21 Nov 2020 14:58:41 +0000 (15:58 +0100)]
panfrost: Calculate the row stride at resource creation time

So we don't have to calculate it again when we create a texture or
framebuffer descriptor.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Fix panfrost_needs_explicit_stride() for block-based formats
Boris Brezillon [Sat, 21 Nov 2020 14:52:28 +0000 (15:52 +0100)]
panfrost: Fix panfrost_needs_explicit_stride() for block-based formats

The expected stride calculation does not take the block width into
account, thus creating an expected line stride that's bigger than
required. Fix that by dividing the width by the block width.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Expose panfrost_block_dim()
Boris Brezillon [Sat, 21 Nov 2020 14:44:10 +0000 (15:44 +0100)]
panfrost: Expose panfrost_block_dim()

So we can use it from pan_resource.c to retrieve the tile size based on
a modifier.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Enable MSAA on bifrost when deqp debug option is set
Boris Brezillon [Tue, 17 Nov 2020 08:32:40 +0000 (09:32 +0100)]
panfrost: Enable MSAA on bifrost when deqp debug option is set

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Unconditionally align strides on 64 bytes for linear resources
Boris Brezillon [Thu, 19 Nov 2020 09:12:53 +0000 (10:12 +0100)]
panfrost: Unconditionally align strides on 64 bytes for linear resources

If we don't do that we end up with DATA_INVALID faults when accessing
3D textures on Bifrost.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Set the layer stride
Boris Brezillon [Thu, 19 Nov 2020 09:38:09 +0000 (10:38 +0100)]
panfrost: Set the layer stride

Needed for 3D textures.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Add two helpers to calculate the surface pointer and strides
Boris Brezillon [Thu, 19 Nov 2020 09:35:55 +0000 (10:35 +0100)]
panfrost: Add two helpers to calculate the surface pointer and strides

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Clarify bit 2:28 meaning in the Midgard texture descriptor
Boris Brezillon [Thu, 19 Nov 2020 09:14:42 +0000 (10:14 +0100)]
panfrost: Clarify bit 2:28 meaning in the Midgard texture descriptor

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Add a minus(1) modifier to the Levels field
Boris Brezillon [Wed, 18 Nov 2020 14:22:59 +0000 (15:22 +0100)]
panfrost: Add a minus(1) modifier to the Levels field

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Increase blit shader BO size on Bifrost
Boris Brezillon [Tue, 17 Nov 2020 11:14:02 +0000 (12:14 +0100)]
panfrost: Increase blit shader BO size on Bifrost

Otherwise we hit 'offset + program->compiled.size < total_size' assert.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopan/bi: LOD is a 8.8 fixed point
Boris Brezillon [Tue, 17 Nov 2020 16:27:40 +0000 (17:27 +0100)]
pan/bi: LOD is a 8.8 fixed point

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopan/bi: Always emit a LOD/CUBE word for FETCH instructions
Boris Brezillon [Tue, 17 Nov 2020 10:25:41 +0000 (11:25 +0100)]
pan/bi: Always emit a LOD/CUBE word for FETCH instructions

There's no flag/mode to reflect when a LOD is zero on FETCH instructions,
we have to emit the LOD/CUBE word unconditionally.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopan/bi: Only update LOD mode on TEX operations
Boris Brezillon [Tue, 17 Nov 2020 10:23:35 +0000 (11:23 +0100)]
pan/bi: Only update LOD mode on TEX operations

If we don't add this check we clobber fetch mode when a 0 LOD is
specified on a txf instruction.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Set sample_count when packing bifrost texture descriptors
Boris Brezillon [Tue, 17 Nov 2020 10:20:35 +0000 (11:20 +0100)]
panfrost: Set sample_count when packing bifrost texture descriptors

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Set depth for 3D textures on Bifrost
Boris Brezillon [Tue, 17 Nov 2020 18:09:26 +0000 (19:09 +0100)]
panfrost: Set depth for 3D textures on Bifrost

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Fix decoding of texture payloads
Boris Brezillon [Tue, 17 Nov 2020 18:18:42 +0000 (19:18 +0100)]
panfrost: Fix decoding of texture payloads

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Get rid of the Sample Count enum
Boris Brezillon [Tue, 17 Nov 2020 10:19:43 +0000 (11:19 +0100)]
panfrost: Get rid of the Sample Count enum

Sample count just needs a log2 modifier. While at it, rename the
"Multisample count" field "Sample count" to be consistent with
other descriptors.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Stop forcing depth to nr_samples
Boris Brezillon [Tue, 17 Nov 2020 19:44:52 +0000 (20:44 +0100)]
panfrost: Stop forcing depth to nr_samples

Those are two different things, and the fact that Midgard use the same
offset in the texture descriptor for both things is just an
implementation detail.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Fix RAW8/16/32 component replication
Alyssa Rosenzweig [Mon, 9 Nov 2020 19:31:01 +0000 (14:31 -0500)]
panfrost: Fix RAW8/16/32 component replication

Fixes dEQP-GLES3.functional.fbo.msaa.4_samples.r32f

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agopanfrost: Account for sample count in tib offsets
Alyssa Rosenzweig [Mon, 9 Nov 2020 19:43:36 +0000 (14:43 -0500)]
panfrost: Account for sample count in tib offsets

I don't know if we have tests for MRT + MSAA but that would hit this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agonir: Fix LOD source type for txf_ms instructions
Boris Brezillon [Tue, 17 Nov 2020 11:12:08 +0000 (12:12 +0100)]
nir: Fix LOD source type for txf_ms instructions

txf_ms takes an integer LOD, not a float.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

3 years agoaco/ngg: fix division-by-zero in assertion
Rhys Perry [Thu, 12 Nov 2020 14:32:57 +0000 (14:32 +0000)]
aco/ngg: fix division-by-zero in assertion

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7576>