platform/upstream/mesa.git
3 years agoradv: check if HTILE is enabled per-level instead of the entire image
Samuel Pitoiset [Tue, 15 Dec 2020 17:37:48 +0000 (18:37 +0100)]
radv: check if HTILE is enabled per-level instead of the entire image

With HTILE mipmaps support, we should check if the base level
currently in use supports compression.

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

3 years agoradv: use the image view range when fast clearing depth
Samuel Pitoiset [Wed, 16 Dec 2020 07:36:24 +0000 (08:36 +0100)]
radv: use the image view range when fast clearing depth

This doesn't change behevior since the driver currently doesn't
support HTILE for mipmaps and also because we can only clear the
whole array layers at once. This improves consistency regarding
the fast clear color path.

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

3 years agoac/surface: store HTILE mip info into the surface
Samuel Pitoiset [Tue, 15 Dec 2020 17:59:18 +0000 (18:59 +0100)]
ac/surface: store HTILE mip info into the surface

GFX10 can only compress the first level in the mip tail.
GFX9+ is not yet supported because mips are interleaved.

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

3 years agoCI: add lavapipe to llvmpipe rules.
Dave Airlie [Wed, 27 Jan 2021 02:08:19 +0000 (12:08 +1000)]
CI: add lavapipe to llvmpipe rules.

I've noticed that that llvmpipe tests don't all get run,
it's probably good enough to just run them on lavapipe
changes as well

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

3 years agolavapipe: add VK_EXT_conditional_rendering support.
Dave Airlie [Fri, 4 Dec 2020 06:41:17 +0000 (16:41 +1000)]
lavapipe: add VK_EXT_conditional_rendering support.

This passes all the CTS tests.

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

3 years agollvmpipe: handle vulkan conditional rendering
Dave Airlie [Fri, 4 Dec 2020 07:03:11 +0000 (17:03 +1000)]
llvmpipe: handle vulkan conditional rendering

This implements the new hook to conditionialise rendering
on memory contents

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

3 years agogallium: add a cond rendering hook for vulkan.
Dave Airlie [Fri, 4 Dec 2020 07:27:16 +0000 (17:27 +1000)]
gallium: add a cond rendering hook for vulkan.

The vulkan cond rendering hook is quite different than the
traditional gallium one so add a new interface for it.

This just conditionalises rendering on the memory location.

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

3 years agolavapipe: rewrite attachment clearing for conditional rendering.
Dave Airlie [Mon, 21 Dec 2020 04:54:58 +0000 (14:54 +1000)]
lavapipe: rewrite attachment clearing for conditional rendering.

Attachment clears have to respect cond rendering, so they can't
call clear texture directly, they have to create temporary
surfaces and clear via those.

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

3 years agolavapipe: refactor image surface creation
Dave Airlie [Mon, 21 Dec 2020 04:49:50 +0000 (14:49 +1000)]
lavapipe: refactor image surface creation

There is a need to create arbitrary surfaces for clearing,
so split out the templating from the storing to img->vk_surface
so temporary surfaces can be created for clearing.

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

3 years agoaco: don't affect isPrecise() after applying output modifiers
Rhys Perry [Tue, 26 Jan 2021 14:24:48 +0000 (14:24 +0000)]
aco: don't affect isPrecise() after applying output modifiers

fossil-db (GFX10.3):
Totals from 26679 (19.14% of 139391) affected shaders:
SGPRs: 1757155 -> 1757059 (-0.01%); split: -0.05%, +0.04%
VGPRs: 1175932 -> 1173556 (-0.20%); split: -0.21%, +0.01%
CodeSize: 86203592 -> 85572480 (-0.73%); split: -0.73%, +0.00%
MaxWaves: 315513 -> 315805 (+0.09%); split: +0.10%, -0.00%
Instrs: 16297785 -> 16143745 (-0.95%); split: -0.95%, +0.00%

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

3 years agoiris: Disable aux as needed in iris_flush_resource
Nanley Chery [Wed, 13 Jan 2021 22:34:13 +0000 (14:34 -0800)]
iris: Disable aux as needed in iris_flush_resource

Disable compression in iris_flush_resource if the resource lacks a
modifier. When a caller wants to prepare such a resource for sharing
(via eglCreateImage for example), this change enables all reference
holders to access the resource in a common manner - without compression.

This fixes misrendering with 3D-accelerated qemu. A piglit test which
reproduces qemu's behavior, ext_image_dma_buf_import-export-tex, is also
enabled to pass.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2678
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8663>

3 years agogallium: Flush GL API resources in eglCreateImage
Nanley Chery [Wed, 13 Jan 2021 22:31:05 +0000 (14:31 -0800)]
gallium: Flush GL API resources in eglCreateImage

Some drivers need to be able to remove compression from resources before
they are handed to consumers that wouldn't understand or expect it.

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

3 years agogallium: Map _DRI_IMAGE_FORMAT_NONE to NULL
Nanley Chery [Thu, 21 Jan 2021 20:21:16 +0000 (12:21 -0800)]
gallium: Map _DRI_IMAGE_FORMAT_NONE to NULL

Many entries in the dri2_format_table have _DRI_IMAGE_FORMAT_NONE as the
dri_format. Make the result of dri2_get_mapping_by_format a tad more
well-defined by returning NULL when this format is passed into it.

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

3 years agost/drawpixels: use GL_CLAMP_TO_EDGE instead of GL_CLAMP for samplers
Mike Blumenkrantz [Tue, 26 Jan 2021 12:42:59 +0000 (07:42 -0500)]
st/drawpixels: use GL_CLAMP_TO_EDGE instead of GL_CLAMP for samplers

no border colors here either

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Drive-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8714>

3 years agost/bitmap: use GL_CLAMP_TO_EDGE for bitmap samplers
Mike Blumenkrantz [Tue, 26 Jan 2021 12:39:10 +0000 (07:39 -0500)]
st/bitmap: use GL_CLAMP_TO_EDGE for bitmap samplers

we aren't using border colors here, so this should be fine (and more compatible)

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Drive-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8714>

3 years agoaco: fix nir_intrinsic_ballot with wave32
Daniel Schürmann [Mon, 25 Jan 2021 17:37:29 +0000 (18:37 +0100)]
aco: fix nir_intrinsic_ballot with wave32

Found by inspection.

Fixes: 21db083504fde3100f0b528f683a087357f5aaff ('aco/wave32: Allow setting the subgroup ballot size to 64-bit.')

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8703>

3 years agoci: Add nouveau chipset 162 to shader-db runs
Caio Marcelo de Oliveira Filho [Wed, 20 Jan 2021 17:24:45 +0000 (09:24 -0800)]
ci: Add nouveau chipset 162 to shader-db runs

Suggested-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8585>

3 years agocompiler: Use util/bitset.h for system_values_read
Caio Marcelo de Oliveira Filho [Wed, 20 Jan 2021 01:14:28 +0000 (17:14 -0800)]
compiler: Use util/bitset.h for system_values_read

It is currently a bitset on top of a uint64_t but there are already
more than 64 values.  Change to use BITSET to cover all the
SYSTEM_VALUE_MAX bits.

Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8585>

3 years agonir/linking: Remove system_value handling from helper
Caio Marcelo de Oliveira Filho [Wed, 20 Jan 2021 01:10:11 +0000 (17:10 -0800)]
nir/linking: Remove system_value handling from helper

All uses are passing variables of either nir_var_shader_in or
nir_var_shader_out modes.  Note that currently there are more than 64
system values, so the uint64_t wouldn't be enough anyway.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8585>

3 years agoci/freedreno: Ban vs-clip-vertex-enables which flakes in CI.
Eric Anholt [Tue, 26 Jan 2021 17:10:32 +0000 (09:10 -0800)]
ci/freedreno: Ban vs-clip-vertex-enables which flakes in CI.

It's reliably failing on its own, but has shown up as the top flake in CI.

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

3 years agoci/freedreno: Detect cheza HFI errors and restart the run.
Eric Anholt [Tue, 26 Jan 2021 16:47:50 +0000 (08:47 -0800)]
ci/freedreno: Detect cheza HFI errors and restart the run.

These are intermittent (~1/day), seem to be around GPU faults (so
hopefully will go away once we clean up piglit's fault errors), and are
probably also related to our vintage firmware.  Until we can get new
hardware in the farm, just restart the flaked job.

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

3 years agonir/algebraic: mark more optimization with fsat(NaN) as inexact
Samuel Pitoiset [Tue, 26 Jan 2021 13:25:32 +0000 (14:25 +0100)]
nir/algebraic: mark more optimization with fsat(NaN) as inexact

These optimizations are duplicated from the main optimization table
to the late one... And I missed some in the original fix.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3368
Fixes: bc123c396a9 ("nir/algebraic: mark some optimizations with fsat(NaN) as inexact")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8716>

3 years agoradv: Only enable sparse features on Polaris and newer.
Timur Kristóf [Thu, 21 Jan 2021 07:46:17 +0000 (08:46 +0100)]
radv: Only enable sparse features on Polaris and newer.

On Fiji, the CTS image can cause a hang when these are enabled.
Let's enable them for Polaris and newer only, for now.

Gitlab: #4136
Fixes: 9f43b44bf06c61735dbab7e8e508642315bd93d1
Signed-off-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/8646>

3 years agoradv: remove unused EMPTY constant in radv_descript_set.c
Samuel Pitoiset [Tue, 19 Jan 2021 17:34:12 +0000 (18:34 +0100)]
radv: remove unused EMPTY constant in radv_descript_set.c

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

3 years agoradv: remove stub() macros
Samuel Pitoiset [Tue, 19 Jan 2021 17:32:47 +0000 (18:32 +0100)]
radv: remove stub() macros

They are unused since sparse texture is implemented.

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

3 years agoradv: remove radv_util.h
Samuel Pitoiset [Tue, 19 Jan 2021 17:32:00 +0000 (18:32 +0100)]
radv: remove radv_util.h

util_bitcount() is already defined in src/util/bitscan.h.

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

3 years agocompiler/nir: Add support for lowering stores with nir_lower_instruction
Gert Wollny [Wed, 9 Dec 2020 08:50:11 +0000 (09:50 +0100)]
compiler/nir: Add support for lowering stores with nir_lower_instruction

The function is very convenient for lowering any type of instruction
that can be easily filtered, but so far instructions that didn't return
a value were siletly ignored.

Fix this by
  - not requiring a return value in the instruction
  - add a new special return value from the lowering implementation
    function to indicated that an instruction that doesn't have a
    return value must be removed, and
  - don't try to collect and replace uses in this case.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8177>

3 years agoradv: fix divide by zero with no tesselation params
David McFarland [Tue, 1 Dec 2020 00:48:50 +0000 (20:48 -0400)]
radv: fix divide by zero with no tesselation params

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

3 years agoaco: fix VCC hint on boolean subgroup operations
Daniel Schürmann [Tue, 26 Jan 2021 10:39:21 +0000 (11:39 +0100)]
aco: fix VCC hint on boolean subgroup operations

Found by inspection.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8712>

3 years agonir/algebraic: eliminate exact a*0.0 if float execution mode allow it
Rhys Perry [Wed, 15 Jul 2020 10:19:56 +0000 (11:19 +0100)]
nir/algebraic: eliminate exact a*0.0 if float execution mode allow it

fossil-db (GFX10):
Totals from 611 (0.44% of 139391) affected shaders:
SGPRs: 40528 -> 40288 (-0.59%)
VGPRs: 16136 -> 16152 (+0.10%); split: -0.15%, +0.25%
CodeSize: 970192 -> 951036 (-1.97%)
MaxWaves: 10561 -> 10557 (-0.04%); split: +0.08%, -0.11%
Instrs: 174874 -> 172879 (-1.14%); split: -1.18%, +0.04%

fossil-db (GFX10.3):
Totals from 611 (0.44% of 139391) affected shaders:
SGPRs: 40680 -> 40488 (-0.47%)
VGPRs: 18368 -> 18276 (-0.50%); split: -0.57%, +0.07%
CodeSize: 1050712 -> 1033624 (-1.63%); split: -1.64%, +0.02%
MaxWaves: 8658 -> 8674 (+0.18%)
Instrs: 205364 -> 201220 (-2.02%)

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

3 years agonir/algebraic: optimize out exact a+0.0 if it's used only as a float
Rhys Perry [Wed, 15 Jul 2020 10:16:33 +0000 (11:16 +0100)]
nir/algebraic: optimize out exact a+0.0 if it's used only as a float

fossil-db (GFX10):
Totals from 133 (0.10% of 139391) affected shaders:
SGPRs: 7864 -> 7856 (-0.10%); split: -0.20%, +0.10%
VGPRs: 4884 -> 4836 (-0.98%)
CodeSize: 288932 -> 287084 (-0.64%)
MaxWaves: 1973 -> 1979 (+0.30%)
Instrs: 53899 -> 53550 (-0.65%)

fossil-db (GFX10.3):
Totals from 133 (0.10% of 139391) affected shaders:
SGPRs: 7832 -> 7835 (+0.04%); split: -0.06%, +0.10%
VGPRs: 5144 -> 5088 (-1.09%)
CodeSize: 318912 -> 316696 (-0.69%)
MaxWaves: 1735 -> 1746 (+0.63%)
Instrs: 65367 -> 64853 (-0.79%)

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

3 years agoaco: optimize out a*1.0 if it's used as a float
Rhys Perry [Wed, 17 Jun 2020 14:02:30 +0000 (15:02 +0100)]
aco: optimize out a*1.0 if it's used as a float

fossil-db (GFX10):
Totals from 370 (0.27% of 139391) affected shaders:
CodeSize: 641436 -> 634156 (-1.13%); split: -1.14%, +0.00%
Instrs: 117668 -> 115739 (-1.64%); split: -1.64%, +0.00%

fossil-db (GFX10.3):
Totals from 370 (0.27% of 139391) affected shaders:
SGPRs: 26888 -> 26912 (+0.09%)
VGPRs: 13964 -> 13916 (-0.34%)
CodeSize: 692008 -> 679008 (-1.88%)
MaxWaves: 4779 -> 4783 (+0.08%)
Instrs: 134265 -> 132026 (-1.67%); split: -1.67%, +0.00%

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

3 years agoaco: optimize a*0.0
Rhys Perry [Wed, 17 Jun 2020 13:57:57 +0000 (14:57 +0100)]
aco: optimize a*0.0

fossil-db (GFX10):
Totals from 1943 (1.39% of 139391) affected shaders:
SGPRs: 99952 -> 99544 (-0.41%); split: -0.44%, +0.03%
VGPRs: 60880 -> 60272 (-1.00%); split: -1.02%, +0.02%
CodeSize: 5138488 -> 5107500 (-0.60%); split: -0.61%, +0.01%
MaxWaves: 32193 -> 32380 (+0.58%)
Instrs: 983178 -> 975684 (-0.76%); split: -0.77%, +0.01%

fossil-db (GFX10.3):
Totals from 1943 (1.39% of 139391) affected shaders:
SGPRs: 99832 -> 99648 (-0.18%); split: -0.25%, +0.06%
VGPRs: 64708 -> 63944 (-1.18%); split: -1.27%, +0.09%
CodeSize: 5196732 -> 5157632 (-0.75%); split: -0.76%, +0.00%
MaxWaves: 27478 -> 27486 (+0.03%); split: +0.06%, -0.03%
Instrs: 1007222 -> 998737 (-0.84%); split: -0.84%, +0.00%

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

3 years agonir/algebraic: optimize out exact a*1.0 if it's used only as a float
Rhys Perry [Wed, 17 Jun 2020 13:46:55 +0000 (14:46 +0100)]
nir/algebraic: optimize out exact a*1.0 if it's used only as a float

fossil-db (GFX10):
Totals from 10180 (7.30% of 139391) affected shaders:
SGPRs: 549392 -> 549448 (+0.01%); split: -0.00%, +0.01%
VGPRs: 243228 -> 243008 (-0.09%); split: -0.11%, +0.02%
CodeSize: 12939080 -> 12603996 (-2.59%); split: -2.59%, +0.00%
MaxWaves: 186948 -> 186976 (+0.01%)
Instrs: 2497266 -> 2414648 (-3.31%)

fossil-db (GFX10.3):
Totals from 10180 (7.30% of 139391) affected shaders:
SGPRs: 549672 -> 549280 (-0.07%); split: -0.23%, +0.16%
VGPRs: 289296 -> 283672 (-1.94%); split: -2.83%, +0.88%
CodeSize: 13920180 -> 13255560 (-4.77%); split: -4.77%, +0.00%
MaxWaves: 151789 -> 153165 (+0.91%)
Instrs: 2756978 -> 2671517 (-3.10%); split: -3.10%, +0.00%

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

3 years agoaco: disable a*1.0 optimization if the instruction is precise
Rhys Perry [Wed, 17 Jun 2020 13:56:55 +0000 (14:56 +0100)]
aco: disable a*1.0 optimization if the instruction is precise

fossil-db (GFX10):
Totals from 10370 (7.44% of 139391) affected shaders:
SGPRs: 564072 -> 564016 (-0.01%); split: -0.01%, +0.00%
VGPRs: 248312 -> 248532 (+0.09%); split: -0.02%, +0.11%
CodeSize: 12866732 -> 13208904 (+2.66%); split: -0.00%, +2.66%
MaxWaves: 190198 -> 190170 (-0.01%)
Instrs: 2460818 -> 2545351 (+3.44%)

fossil-db (GFX10.3):
Totals from 10370 (7.44% of 139391) affected shaders:
SGPRs: 563904 -> 564272 (+0.07%); split: -0.16%, +0.22%
VGPRs: 289344 -> 295016 (+1.96%); split: -0.88%, +2.84%
CodeSize: 13519204 -> 14197020 (+5.01%); split: -0.00%, +5.01%
MaxWaves: 155946 -> 154566 (-0.88%)
Instrs: 2719177 -> 2806919 (+3.23%); split: -0.00%, +3.23%

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

3 years agoci: make piglit runner less noisy and show a better failure message
Andres Gomez [Thu, 21 Jan 2021 20:24:51 +0000 (22:24 +0200)]
ci: make piglit runner less noisy and show a better failure message

v2:
  - Do not silence piglit run (Michel).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8632>

3 years agoci/vc4: Add piglit job
Juan A. Suarez Romero [Mon, 25 Jan 2021 11:34:35 +0000 (12:34 +0100)]
ci/vc4: Add piglit job

This adds a couple of jobs to execute piglit testsuite in VC4
(quick_shader and quick_gl profiles).

It is defined as a manual test as it takes time to execute them.

v2:
 - Add more excluded tests (Eric)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8702>

3 years agoci/vc4: rename stage to Broadcom
Juan A. Suarez Romero [Mon, 25 Jan 2021 11:33:52 +0000 (12:33 +0100)]
ci/vc4: rename stage to Broadcom

It fits better with what other drivers has done.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8702>

3 years agoci/vc4: allow custom timeout values for activity
Juan A. Suarez Romero [Mon, 25 Jan 2021 11:28:05 +0000 (12:28 +0100)]
ci/vc4: allow custom timeout values for activity

The script that monitors activity in the serial assumes that something
was wrong if it does not detect activity in 60 seconds, rebooting the
device and re-trying the test again.

While this timeout is enough for most cases, in some cases it is not
enough. For instance, when executing piglit testsuite it takes quite a
few time to generate the results after the test is done.

This allow to setup a custom timeout (`BM_POE_TIMEOUT`) in the proper
jobs.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8702>

3 years agoradv: add support for emitting PS_DONE/CS_DONE on GFX6-8
Samuel Pitoiset [Fri, 22 Jan 2021 15:41:39 +0000 (16:41 +0100)]
radv: add support for emitting PS_DONE/CS_DONE on GFX6-8

On GFX6, EOS events are always emitted with EVENT_WRITE_EOS.
On GFX7+, EOS events are emitted with EVENT_WRITE_EOS on the
graphics queue, and with RELEASE_MEM on the compute queue.

Fixes: 9c65f1f1111 ("radv: synchronize Cmd{Set,Write}Event() using PS_DONE/CS_DONE events")
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/8710>

3 years agoradv: Fix struct initialization for MSVC
James Park [Mon, 14 Dec 2020 18:33:22 +0000 (10:33 -0800)]
radv: Fix struct initialization for MSVC

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

3 years agoradv: Use typed outarray API
James Park [Mon, 14 Dec 2020 18:33:03 +0000 (10:33 -0800)]
radv: Use typed outarray API

MSVC cannot perform GCC __typeof__ for C code. (C++ has decltype.)

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

3 years agoradv: Disable calibrated timestamps on Windows
James Park [Fri, 4 Dec 2020 05:27:42 +0000 (21:27 -0800)]
radv: Disable calibrated timestamps on Windows

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

3 years agoradv: Pointer arithmetic on char/uint8_t, not void
James Park [Fri, 27 Nov 2020 03:32:48 +0000 (19:32 -0800)]
radv: Pointer arithmetic on char/uint8_t, not void

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

3 years agoradv: Modify radv_descriptor_set for MSVC legality
James Park [Fri, 27 Nov 2020 03:26:56 +0000 (19:26 -0800)]
radv: Modify radv_descriptor_set for MSVC legality

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

3 years agoradv: Stub sections that don't have _WIN32 support
James Park [Thu, 3 Dec 2020 10:15:50 +0000 (02:15 -0800)]
radv: Stub sections that don't have _WIN32 support

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

3 years agoradv: Remove unnecessary headers
James Park [Thu, 3 Dec 2020 10:15:25 +0000 (02:15 -0800)]
radv: Remove unnecessary headers

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

3 years agoradv: Use linker pragma to simulate weak functions
James Park [Fri, 27 Nov 2020 03:18:35 +0000 (19:18 -0800)]
radv: Use linker pragma to simulate weak functions

MSVC has an undocumented feature that can act as GCC weak functions.

Also fix warnings about returning a value from void functions.

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

3 years agospirv: Don't remove variables used by resource indexing intrinsics
Caio Marcelo de Oliveira Filho [Thu, 21 Jan 2021 18:14:36 +0000 (10:14 -0800)]
spirv: Don't remove variables used by resource indexing intrinsics

In Vulkan, for some variable modes, the generated NIR will have derefs
pointing to resource index intrinsics instead of the variable.  This
was letting nir_remove_dead_variables pass remove those variables,
which would lose information relevant for later passes after
spirv2nir.

Add a set to keep track of such variables and prevent them to be
removed when producing the NIR output.

Issue reported by Rhys.

Fixes: c4c9c780b13 ("spirv: Remove more dead variables")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8706>

3 years agonir: Add a data pointer to the callback in nir_remove_dead_variables
Caio Marcelo de Oliveira Filho [Thu, 21 Jan 2021 16:41:15 +0000 (08:41 -0800)]
nir: Add a data pointer to the callback in nir_remove_dead_variables

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

3 years agoclover: Add constructor for global_argument.
Vinson Lee [Thu, 21 Jan 2021 22:00:50 +0000 (14:00 -0800)]
clover: Add constructor for global_argument.

Fix defects reported by Coverity Scan.

member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize buf.
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize svm.

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

3 years agoanv: Skip CCS ambiguate which preceed fast-clears
Sagar Ghuge [Mon, 25 Jan 2021 21:23:32 +0000 (13:23 -0800)]
anv: Skip CCS ambiguate which preceed fast-clears

We can skip CCS ambiguate if followed by a fast clear within render
pass.

v2: (Jason)
- Check array layer as well since we only fast clear first layer and
  first LOD.
- Don't drop fast clear check while doing resolve operation.

Fixes: d5849bc840e "anv: Skip HiZ and CCS ambiguates which preceed fast-clears"
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6988>

3 years agointel/gen12: Fix memory corruption issues in fused Gen12 parts.
Francisco Jerez [Thu, 21 Jan 2021 22:21:50 +0000 (14:21 -0800)]
intel/gen12: Fix memory corruption issues in fused Gen12 parts.

According to the BSpec page for MEDIA_VFE_STATE, on Gen12 platforms
"if a fused configuration has fewer threads than the native POR
configuration, the scratch space allocation is based on the number of
threads in the base native POR configuration".  However we currently
use the subslice count from devinfo->num_subslices[0], which only
includes the subslices currently enabled by the platform fusing.  This
leads to scratch space underallocation and occasional hangs.

The problem is likely to affect most Gen12 GPUs with less than 96 EUs.
GFXBench5 Aztec Ruins is able to reproduce the issue fairly reliably.

Fixes: 9e5ce30da7fa3f1cc3badf "intel: fix the gen 12 compute shader scratch IDs"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8636>

3 years agopanfrost: Use normal malloc/free instead of ralloc for surfaces
Icecream95 [Sun, 24 Jan 2021 07:53:36 +0000 (20:53 +1300)]
panfrost: Use normal malloc/free instead of ralloc for surfaces

Fixes a double-free in some Qt5 WebEngine apps (e.g. ghostwriter).

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

3 years agofreedreno/a6xx: Fix 3dmark misrendering with unwritten MRTs
Rob Clark [Sun, 24 Jan 2021 20:35:18 +0000 (12:35 -0800)]
freedreno/a6xx: Fix 3dmark misrendering with unwritten MRTs

Fixes an issue with 3dmark caused by a shader that only writes mrt0 in a
renderpass that has two color buffers bound, resulting in mrt1 getting
random/undefined values.

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

3 years agofreedreno: Skip some batch dependency tracking if !ctx->dirty.
Eric Anholt [Wed, 20 Jan 2021 22:20:46 +0000 (14:20 -0800)]
freedreno: Skip some batch dependency tracking if !ctx->dirty.

drawoverhead test 1 perf 4.37618% +/- 0.933261% (n=57)

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

3 years agofreedreno: Move framebuffer state checks under a ctx->dirty flag.
Eric Anholt [Fri, 22 Jan 2021 18:38:09 +0000 (10:38 -0800)]
freedreno: Move framebuffer state checks under a ctx->dirty flag.

Anything changing this should have flagged FD_DIRTY_FRAMEBUFFER.

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

3 years agofreedreno: Move blend gmem checks to a blend dirty state check.
Eric Anholt [Fri, 22 Jan 2021 18:24:40 +0000 (10:24 -0800)]
freedreno: Move blend gmem checks to a blend dirty state check.

We don't need to do this every draw call.  We do now consider the blend
enable field of a non-present color buffer, because it's not worth
filtering that case out.

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

3 years agofreedreno/a6xx: Skip the body of emit_state if we're clean.
Eric Anholt [Wed, 20 Jan 2021 22:08:32 +0000 (14:08 -0800)]
freedreno/a6xx: Skip the body of emit_state if we're clean.

drawoverhead test 1 (no state change) perf +5.43864% +/- 1.28466% (n=10).

Part of #4106.

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

3 years agozink: guarantee surface lifetimes for shader images
Mike Blumenkrantz [Fri, 7 Aug 2020 14:00:13 +0000 (10:00 -0400)]
zink: guarantee surface lifetimes for shader images

these may be unset from the ctx before the draw command has completed,
so we need (more) references to prevent that

Fixes: 3f9a6d333b3 ("zink: export shader image caps using features")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8627>

3 years agoanv: Invalidate the correct AUX-TT entry
Sagar Ghuge [Sun, 24 Jan 2021 01:21:17 +0000 (17:21 -0800)]
anv: Invalidate the correct AUX-TT entry

While invalidating the AUX-TT entries, we have to consider the surface
offset as well otherwise, we will end up invalidating another surface's
CCS portion.

For eg. when we have HiZ+CCS and STC_CCS enabled, both will use the CCS
portion allocated at the end of BO. While invalidating the CCS portion
of stencil buffer, we will end up invalidating the CCS portion that
belongs to the depth main surface and vice-versa, if the surface offset
is not considered.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4123
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8677>

3 years agoanv: fix invalid programming of BLEND_STATE
Lionel Landwerlin [Mon, 25 Jan 2021 11:23:08 +0000 (13:23 +0200)]
anv: fix invalid programming of BLEND_STATE

We can't enable Logic Op & Color Buffer Blend. The Vulkan spec seems
to say Logic Op discards blending.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3767
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8691>

3 years agonir/opt_uniform_atomics: fix elect detection
Rhys Perry [Thu, 21 Jan 2021 17:27:31 +0000 (17:27 +0000)]
nir/opt_uniform_atomics: fix elect detection

fossil-db (GFX10.3):
Totals from 30 (0.02% of 139391) affected shaders:
SGPRs: 1736 -> 1712 (-1.38%)
CodeSize: 262116 -> 254728 (-2.82%)
Instrs: 50341 -> 48857 (-2.95%)
Cycles: 486384 -> 477556 (-1.82%)
VMEM: 4821 -> 4589 (-4.81%)
Copies: 5013 -> 4890 (-2.45%)
Branches: 2108 -> 1983 (-5.93%)
PreSGPRs: 1444 -> 1418 (-1.80%)

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

3 years agonir/opt_uniform_atomics: recognize more complicated invocation comparisons
Rhys Perry [Thu, 21 Jan 2021 17:27:13 +0000 (17:27 +0000)]
nir/opt_uniform_atomics: recognize more complicated invocation comparisons

For example, gl_LocalInvocationID.x + gl_LocalInvocationID.y * 8.

fossil-db (GFX10.3):
Totals from 8 (0.01% of 139391) affected shaders:
CodeSize: 15224 -> 14800 (-2.79%)
Instrs: 2880 -> 2798 (-2.85%)
Cycles: 44556 -> 44204 (-0.79%)
VMEM: 407 -> 473 (+16.22%); split: +17.69%, -1.47%
Copies: 491 -> 483 (-1.63%)
Branches: 200 -> 192 (-4.00%)

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

3 years agoradv: Use stricter HW resolve swizzle compat check.
Bas Nieuwenhuizen [Sat, 23 Jan 2021 01:36:29 +0000 (02:36 +0100)]
radv: Use stricter HW resolve swizzle compat check.

D and linear are both DISPLAY micro tiling according to ac_surface
but don't work together. This fixes an issue with GFX9+.

This fixes the SkQP WritePixelsNonTexture_Gpu test.

Fixes: 69ea473eeb9 ("amd/addrlib: update to the latest version")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8665>

3 years agodocs: Mark some ES3 zink features complete
Adam Jackson [Mon, 25 Jan 2021 17:35:12 +0000 (12:35 -0500)]
docs: Mark some ES3 zink features complete

These are already enabled:

-  GL_ARB_draw_indirect
-  GL_ARB_framebuffer_no_attachments
-  GL_ARB_shader_atomic_counters
-  GL_ARB_shader_image_load_store
-  GL_ARB_shader_image_size
-  GL_ARB_stencil_texturing
-  GL_ARB_texture_multisample
-  GS5 Enhanced textureGather
-  GS5 Packing/bitfield/conversion functions
-  GL_KHR_robustness
-  GL_KHR_texture_compression_astc_ldr
-  GL_OES_sample_variables
-  GL_OES_shader_multisample_interpolation

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8701>

3 years agodocs: Mark some non-core zink extensions complete
Adam Jackson [Mon, 25 Jan 2021 17:00:42 +0000 (12:00 -0500)]
docs: Mark some non-core zink extensions complete

These are already exposed:

-  GL_ARB_gpu_shader_int64
-  GL_KHR_texture_compression_astc_sliced_3d
-  GL_OES_texture_float
-  GL_OES_texture_float_linear
-  GL_OES_texture_half_float
-  GL_OES_texture_half_float_linear

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8701>

3 years agoetnaviv: handle NULL views in set_sampler_views
Christian Gmeiner [Sat, 23 Jan 2021 15:15:38 +0000 (16:15 +0100)]
etnaviv: handle NULL views in set_sampler_views

Passing NULL for the views parameter should be the same as passing an
array of NULL, according to the documentation. So let's respect that
detail.

This fixes a crash when using GALLIUM_HUD. The wrong handling of views
parameter was causing problems starting with
2813688f8db ("gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views").

Cc: <mesa-stable@lists.freedesktop.org>
Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8670>

3 years agoci: Add a fractional deqp run of softpipe with asan enabled.
Eric Anholt [Thu, 14 Jan 2021 17:56:52 +0000 (09:56 -0800)]
ci: Add a fractional deqp run of softpipe with asan enabled.

This should help us avoid landing memory leaks (and some buffer overflows)
throughout the GL stack.  I put the asan lib in x86_test-base because
we'll want asan for lavapipe, too.

This requires keeping debug symbols for the asan drivers in the artifacts,
as otherwise you can't do much with the backtraces it produces.

Closes: #3726
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>

3 years agoutil/bitset: Avoid dereferencing the bitset for size == 0.
Eric Anholt [Thu, 14 Jan 2021 22:46:17 +0000 (14:46 -0800)]
util/bitset: Avoid dereferencing the bitset for size == 0.

If we don't have any bits in our set, don't go reading the pointer.  Fixes
invalid accesses caught by ASan in liveness and nir_to_tgsi when
impl->ssa_alloc == 0.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>

3 years agogallium: Fix leak of shader images on context destruction.
Eric Anholt [Tue, 1 Dec 2020 22:05:30 +0000 (14:05 -0800)]
gallium: Fix leak of shader images on context destruction.

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

3 years agopanfrost: Stub out set_shader_images().
Eric Anholt [Wed, 20 Jan 2021 18:29:38 +0000 (10:29 -0800)]
panfrost: Stub out set_shader_images().

If PAN_MESA_DEBUG=deqp is set to enable testing, then we advertise shader
images to get GLES3.1, even though we don't have any of the shader image
funcs hooked up.  This caused breakage when cso started unbinding shader
images at context destruction.

Just stub out the function for now, you'll still segfault when creating an
image.

Cc: mesa-stable (for the next commit)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>

3 years agoswr: Don't report support for shader images.
Eric Anholt [Fri, 22 Jan 2021 19:23:35 +0000 (11:23 -0800)]
swr: Don't report support for shader images.

gallivm has images support, but this driver doesn't.

Cc: mesa-stable (for the upcoming shader image leak fix)
Acked-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>

3 years agonir_to_tgsi: Fix buffer overflow in atomic image compswap.
Eric Anholt [Thu, 14 Jan 2021 20:53:57 +0000 (12:53 -0800)]
nir_to_tgsi: Fix buffer overflow in atomic image compswap.

Caught by the new asan CI job.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8530>

3 years agor300,i915g: Report no shader buffers or images on non-TCL HW.
Eric Anholt [Fri, 22 Jan 2021 19:27:28 +0000 (11:27 -0800)]
r300,i915g: Report no shader buffers or images on non-TCL HW.

We don't have the driver hooks to set the state, or to update draw's copy
of the state at draw time.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Fixes: d6fd7acf9b79 ("gallium: Fix leak of bound SSBOs at CSO context
destruction.")

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

3 years agozink: flag gfx pipeline dirty using newer mechanism
Mike Blumenkrantz [Mon, 25 Jan 2021 14:40:50 +0000 (09:40 -0500)]
zink: flag gfx pipeline dirty using newer mechanism

this wasn't updated during rebases

Fixes: 334759d8509 ("zink: implement passthrough tcs shader injection")

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

3 years agoRevert "virgl: fix BGRA emulation artifacts during window resize"
Ryan Neph [Sat, 23 Jan 2021 01:02:06 +0000 (01:02 +0000)]
Revert "virgl: fix BGRA emulation artifacts during window resize"

This reverts commit accc2222174a90fd24ee56ce751feb6022ecc0c7.

The change in accc2222 caused a regression in gameplay for a few valve
games such as Portal 2 where textures were rendered darker than
expected.

Reverting to restore normal gameplay at the smaller cost of
re-introducing the issue described in !8119.

Fixes: accc2222 ("virgl: fix BGRA emulation artifacts during window resize")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8664>

3 years agozink: request texcoord replace lowering
Erik Faye-Lund [Wed, 26 Aug 2020 16:56:47 +0000 (18:56 +0200)]
zink: request texcoord replace lowering

We don't actually support point-sprites by texcoord replacement, so let's
remove that cap. This allows gallium to automatically lower this to the
PNTC varying instead, which we do support.

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

3 years agogallium/st: lower point-sprites if not supported
Erik Faye-Lund [Wed, 26 Aug 2020 16:48:52 +0000 (18:48 +0200)]
gallium/st: lower point-sprites if not supported

Not all drivers supports the texcoord replacement needed for
point-sprites, but all drivers support gl_PointCoord. So let's lower
this so we can support point-sprites for all drivers.

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

3 years agocompiler/nir: add texcoord replace lowering pass
Erik Faye-Lund [Thu, 27 Aug 2020 11:25:15 +0000 (13:25 +0200)]
compiler/nir: add texcoord replace lowering pass

This lowering pass allows us to replace point-sprites to gl_PointCoord,
which better match what modern hardware does.

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

3 years agomesa/main: remove leftover bumpmap code
Erik Faye-Lund [Wed, 26 Aug 2020 16:40:02 +0000 (18:40 +0200)]
mesa/main: remove leftover bumpmap code

This variable is only ever written as NULL, so we can omit it entirely.

Fixes: 4000c0112a4 ("Remove the ATI_envmap_bumpmap extension")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6473>

3 years agoradv: synchronize Cmd{Set,Write}Event() using PS_DONE/CS_DONE events
Samuel Pitoiset [Fri, 22 Jan 2021 13:46:30 +0000 (14:46 +0100)]
radv: synchronize Cmd{Set,Write}Event() using PS_DONE/CS_DONE events

This is probably rarely used but it can be easily implemented now.

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

3 years agoradv,aco: fix shifting input VGPRs for the LS VGPR init bug on GFX9
Samuel Pitoiset [Mon, 25 Jan 2021 12:42:35 +0000 (13:42 +0100)]
radv,aco: fix shifting input VGPRs for the LS VGPR init bug on GFX9

We were incorrectly shifting the input VGPRs for the instance ID
for chips affected by the LS VGPR init bug (ie. Vega10 and Raven).

When there is no HS threads, the hardware loads the LS VGPR
starting from VGPR 0, so they should be shifted by two.

This fixes some sort of vertex explosion with Squad, Visage, Barn
Finders and probably more titles that use tessellation. Note that
only Vega10 and Raven were affected by this bug.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4129
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3311
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Diego Viola <diego.viola@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8694>

3 years agodocs/zink: correct vk version for GL 4.2
Erik Faye-Lund [Mon, 25 Jan 2021 11:52:21 +0000 (12:52 +0100)]
docs/zink: correct vk version for GL 4.2

I've gotten clarification from Khronos about this here:

https://github.com/KhronosGroup/Vulkan-Docs/issues/1437

So as it stands, we currently require Vulkan 1.2 for GL 4.2, not Vulkan
1.1. Let's update the docs to reflect this.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Fixes: fb65285629c ("docs/zink: add GL 4.2 requirements")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8692>

3 years agodocs/features: mark off two more extensions for zink
Erik Faye-Lund [Mon, 25 Jan 2021 10:19:02 +0000 (11:19 +0100)]
docs/features: mark off two more extensions for zink

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8688>

3 years agozink: enable PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE
Mike Blumenkrantz [Tue, 18 Aug 2020 15:35:45 +0000 (11:35 -0400)]
zink: enable PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE

this was already handled internally

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8688>

3 years agozink: set lower_mul_2x32_64 when 64bit int support is available
Mike Blumenkrantz [Sat, 23 Jan 2021 21:28:01 +0000 (16:28 -0500)]
zink: set lower_mul_2x32_64 when 64bit int support is available

started hitting umul_2x32_64 recently on ANV

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8674>

3 years agoaco: fix WQM for texture instructions with args before the coordinates
Rhys Perry [Mon, 25 Jan 2021 12:51:54 +0000 (12:51 +0000)]
aco: fix WQM for texture instructions with args before the coordinates

Previously, we might not have required all coordinates to be in WQM if
there were other args before them. We should probably also require that
the offset is in WQM.

fossil-db (GFX10.3):
Totals from 10053 (7.21% of 139391) affected shaders:
SGPRs: 911032 -> 911048 (+0.00%); split: -0.00%, +0.00%
VGPRs: 689856 -> 688412 (-0.21%); split: -0.26%, +0.05%
CodeSize: 84151460 -> 84140396 (-0.01%); split: -0.02%, +0.01%
MaxWaves: 77526 -> 77527 (+0.00%)
Instrs: 15972106 -> 15971521 (-0.00%); split: -0.01%, +0.01%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4153
Fixes: 4015b3651ac ("aco: only require texture coordinates to be in WQM if NSA is used")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8693>

3 years agozink: add a VkExternalMemoryImageCreateInfo for PIPE_BIND_SHARED images
Mike Blumenkrantz [Wed, 9 Sep 2020 19:16:42 +0000 (15:16 -0400)]
zink: add a VkExternalMemoryImageCreateInfo for PIPE_BIND_SHARED images

required by spec

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8273>

3 years agoradv: enable sparseImageInt64Atomics/sparseImageFloat32Atomics
Samuel Pitoiset [Fri, 22 Jan 2021 10:26:16 +0000 (11:26 +0100)]
radv: enable sparseImageInt64Atomics/sparseImageFloat32Atomics

This should be supported. Note that CTS doesn't have tests for
sparseImageFloat32Atomics.

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

3 years agontt: Assume that nir_tex_instr::dest_type is sized
Connor Abbott [Tue, 8 Dec 2020 16:11:24 +0000 (17:11 +0100)]
ntt: Assume that nir_tex_instr::dest_type is sized

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

3 years agoir3: Assume that nir_tex_instr::dest_type is sized
Connor Abbott [Tue, 8 Dec 2020 14:21:48 +0000 (15:21 +0100)]
ir3: Assume that nir_tex_instr::dest_type is sized

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

3 years agopanfrost: Assume that nir_tex_instr::dest_type is sized
Connor Abbott [Tue, 8 Dec 2020 14:15:35 +0000 (15:15 +0100)]
panfrost: Assume that nir_tex_instr::dest_type is sized

Get rid of some now-redundant code, and cleanup the is-float check in
the bifrost compiler.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>

3 years agonir/lower_tex: Assume that nir_tex_instr::dest_type is sized
Connor Abbott [Tue, 8 Dec 2020 12:50:14 +0000 (13:50 +0100)]
nir/lower_tex: Assume that nir_tex_instr::dest_type is sized

This reverts the code back to the form it was before, but with an
explicitly sized float32 instead of float, now that all producers are
switched over.

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

3 years agonir: Validate nir_tex_instr::dest_type bitsize
Connor Abbott [Tue, 8 Dec 2020 14:44:07 +0000 (15:44 +0100)]
nir: Validate nir_tex_instr::dest_type bitsize

In theory, we could also verify this against the sampler type for
sampler derefs, but there are a number of complications there:

- SPIR-V 1.4 lets you override the signedness of integer samplers
per-instruction. So the base type may not match.
- mediump/RelaxedPrecision samplers may get lowered to f16 in the
instruction or may not. So the bitsize may not match.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>

3 years agoptn: Use sized types for nir_tex_instr::dest_type
Connor Abbott [Tue, 8 Dec 2020 12:47:08 +0000 (13:47 +0100)]
ptn: Use sized types for nir_tex_instr::dest_type

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

3 years agovtn: Use sized types for nir_tex_instr::dest_type
Connor Abbott [Tue, 8 Dec 2020 12:46:35 +0000 (13:46 +0100)]
vtn: Use sized types for nir_tex_instr::dest_type

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

3 years agoglsl/nir: Use sized types for nir_tex_instr::dest_type
Connor Abbott [Tue, 8 Dec 2020 12:46:17 +0000 (13:46 +0100)]
glsl/nir: Use sized types for nir_tex_instr::dest_type

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

3 years agost/atifs: Use sized types for nir_tex_instr::dest_type
Connor Abbott [Mon, 11 Jan 2021 14:31:17 +0000 (15:31 +0100)]
st/atifs: Use sized types for nir_tex_instr::dest_type

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

3 years agottn: Use sized types for nir_tex_instr::dest_type
Connor Abbott [Tue, 8 Dec 2020 12:46:54 +0000 (13:46 +0100)]
ttn: Use sized types for nir_tex_instr::dest_type

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