platform/upstream/mesa.git
3 years agopanfrost: Fix the Maximum anisotropy field in the XML
Icecream95 [Wed, 16 Dec 2020 10:50:33 +0000 (23:50 +1300)]
panfrost: Fix the Maximum anisotropy field in the XML

It needs a a minus(1) modifier.

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

3 years agopanfrost: Fix LOD mode field on Bifrost
Alyssa Rosenzweig [Sat, 19 Dec 2020 14:37:37 +0000 (09:37 -0500)]
panfrost: Fix LOD mode field on Bifrost

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

3 years agopan/bi: Minor styling cleanup in disasm
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:15:17 +0000 (15:15 -0500)]
pan/bi: Minor styling cleanup in disasm

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

3 years agopan/bi: Remove all-0's termination condition
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:14:14 +0000 (15:14 -0500)]
pan/bi: Remove all-0's termination condition

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

3 years agopan/bi: Space out disassembly
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:06:56 +0000 (15:06 -0500)]
pan/bi: Space out disassembly

Makes things much more legible with some "room to breathe".

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

3 years agopan/bi: Allow toggling disassembly verbosity
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:02:26 +0000 (15:02 -0500)]
pan/bi: Allow toggling disassembly verbosity

Verbose mode is especially useful for debugging packing, but otherwise
just gets in the way I find.

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

3 years agointel/fs: don't spill a register, set by undef
Yevhenii Kolesnikov [Wed, 9 Dec 2020 19:16:37 +0000 (21:16 +0200)]
intel/fs: don't spill a register, set by undef

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3941
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8185>

3 years agolvp: Fix vtn warnings about unsupported image read/write without format.
Eric Anholt [Mon, 21 Dec 2020 19:08:11 +0000 (11:08 -0800)]
lvp: Fix vtn warnings about unsupported image read/write without format.

These are just warnings printed to the console and don't affect testcase
pass/fail, but clog up the deqp-runner job logs.

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

3 years agoci/deqp: Make sure that we pull in all board-specific xfail/skip/flake files.
Eric Anholt [Thu, 17 Dec 2020 19:08:42 +0000 (11:08 -0800)]
ci/deqp: Make sure that we pull in all board-specific xfail/skip/flake files.

When introducing/removing these files, it's easy to forget to update the
yml to point to them.  Instead of requiring the separate update, just have
the runner script pick the right one from a single per-gpu variable.

As a result, we now pick up the new deqp-lvp-skips.txt that was added but
not conected.  This also required moving some bypass flakes from the
shared a630 flakes list to a separate list, which is a feature because now
we'd notice the introduction of flakes to the gmem path.

Fixes: ab79e6b8e336 ("ci: skip failing test on lavapipe")
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8147>

3 years agoradv: Enable DCC in the GENERAL layout on GFX10+.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 18:18:42 +0000 (20:18 +0200)]
radv: Enable DCC in the GENERAL layout on GFX10+.

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

3 years agoradv: Disable DCC explicitly for incompatible copies.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 18:02:11 +0000 (20:02 +0200)]
radv: Disable DCC explicitly for incompatible copies.

If we enable DCC for GENERAL we cannot set the layout to GENERAL to
disable DCC, so do it explicitly.

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

3 years agoradv: Add option to disable DCC in renderpasses without layout.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 17:58:18 +0000 (19:58 +0200)]
radv: Add option to disable DCC in renderpasses without layout.

If DCC is enabled for GENERAL then we cannot disable DCC by going
to the GENERAL layout.

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

3 years agoradv: Never allow fast clears on DCC images that are not compressed.
Bas Nieuwenhuizen [Fri, 18 Sep 2020 23:52:32 +0000 (01:52 +0200)]
radv: Never allow fast clears on DCC images that are not compressed.

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

3 years agoradv: Don't skip layout transitions that only differ in render loop.
Bas Nieuwenhuizen [Sun, 20 Sep 2020 00:23:11 +0000 (02:23 +0200)]
radv: Don't skip layout transitions that only differ in render loop.

This can result in meaningful compression changes so we shouldn't skip.

Fixes: 66131ceb8bc "radv: Pass through render loop detection to internal layout decisions."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7004>

3 years agoradv: ignore the mutable bit for TC-compatible HTILE
Samuel Pitoiset [Mon, 21 Dec 2020 16:50:04 +0000 (17:50 +0100)]
radv: ignore the mutable bit for TC-compatible HTILE

All depth/stencil formats are incompatible each others, so the
mutable bit and the image format list can be ignored.

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

3 years agoglsl: remove unused state variable
cheyang [Sun, 20 Dec 2020 13:00:46 +0000 (21:00 +0800)]
glsl: remove unused state variable

Because compile_shader function state variable
not determine whether the compilation is successful.

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

3 years agofreedreno/a6xx: bump varyings limit
Danylo Piliaiev [Wed, 2 Dec 2020 14:10:53 +0000 (16:10 +0200)]
freedreno/a6xx: bump varyings limit

GL_MAX_VARYING_COMPONENTS is bumped to 124 since it should
not include the components of gl_Position. (Same as in blob)

GL_MAX_*_OUTPUT_COMPONENTS is bumped to 128, only
GL_MAX_GEOMETRY_INPUT_COMPONENTS is 64. (Same as in blob)

Per GL 3.2 spec the minimum of:
 - GL_MAX_GEOMETRY_OUTPUT_COMPONENTS is 128
 - GL_MAX_FRAGMENT_INPUT_COMPONENTS is 128
 - others is 64

Per ARB_tessellation_shader the minimum of:
 - GL_MAX_TESS_CONTROL_*_COMPONENTS to be 128
 - GL_MAX_TESS_EVALUATION_*_COMPONENTS to be 128

Allows passing of:
 gl-3.2-minmax
 arb_tessellation_shader-minmax

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

3 years agofreedreno/a6xx: Fix SP_HS_UNKNOWN_A831 value and document it
Danylo Piliaiev [Mon, 14 Dec 2020 16:42:59 +0000 (18:42 +0200)]
freedreno/a6xx: Fix SP_HS_UNKNOWN_A831 value and document it

It appears that storage for varyings in a wave has an upper
limit of wavesize * max_a831 where max_a831 is 64.
Exceeding the limit seam to force gpu to reduce primitives
processed per wave, at least calculations make sense with
such interpretation.

With blob SP_HS_UNKNOWN_A831 never exceeds 64 and setting
it to 65 in freedreno leads to a hang.

On A630 tests (patch_size=3 + gl_Position + array of vec4)
have shown such relation:

| Num of vec4 | A831 | PC_HS_INPUT_SIZE |
|-------------|------|------------------|
| 1           | 0x10 | 0xc              |
| 2           | 0x14 | 0xf              |
| 3           | 0x18 | 0x12             |
| 4           | 0x1c | 0x15             |
| 5           | 0x20 | 0x18             |
| 6           | 0x24 | 0x1b             |
| 7           | 0x28 | 0x1e             |
| 8           | 0x2c | 0x21             |
| 9           | 0x30 | 0x24             |
| 10          | 0x34 | 0x27             |
| 11          | 0x38 | 0x2a             |
| 12          | 0x3c | 0x2d             |
| 13          | 0x3f | 0x30             |
| 14          | 0x40 | 0x33             |
| 15          | 0x3d | 0x36             |
| 16          | 0x3d | 0x39             |
| 17          | 0x40 | 0x3c             |
| 18          | 0x3f | 0x3f             |
| 19          | 0x3e | 0x42             |
| 20          | 0x3d | 0x45             |
| 21          | 0x3f | 0x48             |
| 22          | 0x3d | 0x4b             |
| 23          | 0x40 | 0x4e             |
| 24          | 0x3d | 0x51             |
| 25          | 0x3f | 0x54             |
| 26          | 0x3c | 0x57             |
| 27          | 0x3e | 0x5a             |
| 28          | 0x40 | 0x5d             |
| 29          | 0x3c | 0x60             |
| 30          | 0x3e | 0x63             |
| 31          | 0x40 | 0x66             |
|-------------|------|------------------|

Brief tests with high patch sizes also confirm that formula
matches blob behaviour.

A831 is not a limit for storage available for one thread, so
naming it as SP_HS_WAVE_INPUT_SIZE would make more sense.

Fixes: 47e2c195 "freedreno/a6xx: Program state for tessellation stages"

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

3 years agoir3: Allow tesselation to use all 32 varying slots
Danylo Piliaiev [Thu, 10 Dec 2020 17:18:18 +0000 (19:18 +0200)]
ir3: Allow tesselation to use all 32 varying slots

POS, PSIZE, CLIP_DIST0, and CLIP_DIST1 have their own predefined
indices, map's size should take this into account.

Fixes: 9e063b01 "ir3: Switch tess lowering to use location"

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

3 years agofreedreno/a6xx: Fix assert which checks the count of shader outputs
Danylo Piliaiev [Mon, 7 Dec 2020 13:56:03 +0000 (15:56 +0200)]
freedreno/a6xx: Fix assert which checks the count of shader outputs

The actual max count is 32 which corresponds to 128 output components.

Fixes: 2251a434 "freedreno/a6xx: Write multiple regs for SP_VS_OUT_REG and SP_VS_VPC_DST_REG"

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

3 years agomesa: fix layered framebuffer attachment target check
Tapani Pälli [Tue, 15 Dec 2020 11:15:29 +0000 (13:15 +0200)]
mesa: fix layered framebuffer attachment target check

Current code was making the layer target checking for depth and stencil
attachments as well while the check in spec is specified only for color.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3980
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/8102>

3 years agolavapipe: add transform feedback support
Dave Airlie [Tue, 8 Dec 2020 04:48:44 +0000 (14:48 +1000)]
lavapipe: add transform feedback support

This adds support for EXT_transform_feedback which can be used by
zink to enable more CI

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

3 years agollvmpipe: handle SO statistics multi value query copy. (v2)
Dave Airlie [Thu, 17 Dec 2020 22:29:12 +0000 (08:29 +1000)]
llvmpipe: handle SO statistics multi value query copy. (v2)

This is hard to abstract using the vulkan interface, so just
add support for copying both values in the llvmpipe backend
for the lavapipe frontend.

v2: use a loop

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

3 years agollvmpipe: add support for vulkan streamout offset hook
Dave Airlie [Tue, 8 Dec 2020 05:06:48 +0000 (15:06 +1000)]
llvmpipe: add support for vulkan streamout offset hook

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

3 years agogallium: add an api to retrieve pipe offsets
Dave Airlie [Tue, 8 Dec 2020 05:06:17 +0000 (15:06 +1000)]
gallium: add an api to retrieve pipe offsets

This is needed to implement the vulkan transform feedback pause
resume functionality

Acked-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/7981>

3 years agod3d12: Fix memory leak if create_root_signature failed.
Vinson Lee [Fri, 18 Dec 2020 22:36:54 +0000 (14:36 -0800)]
d3d12: Fix memory leak if create_root_signature failed.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable data going out of scope leaks the storage it points to.

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8170>

3 years agod3d12: Fix memory leak if create_gfx_pipeline_state failed.
Vinson Lee [Fri, 18 Dec 2020 01:29:13 +0000 (17:29 -0800)]
d3d12: Fix memory leak if create_gfx_pipeline_state failed.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable data going out of scope leaks the storage it points to.

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8150>

3 years agopanfrost: Fix CLAMP wrap mode
Icecream95 [Sat, 19 Dec 2020 11:21:58 +0000 (00:21 +1300)]
panfrost: Fix CLAMP wrap mode

MALI_WRAP_MODE_CLAMP doesn't work fully on either GPU generation, so
use other wrap modes instead in some cases.

With nearest filtering, Midgard only clamps to the edge for two of the
edges, and uses the border colour for the other two. Using the clamp
mode on Bifrost causes broken rendering and/or GPU faults.

Fixes piglit test "texwrap" on both Midgard and Bifrost, and fixes
Chromium B.S.U. rendering on Bifrost.

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

3 years agopanfrost: Fix precise occlusion queries on Bifrost
Icecream95 [Sat, 19 Dec 2020 03:23:16 +0000 (16:23 +1300)]
panfrost: Fix precise occlusion queries on Bifrost

Bifrost doesn't need the sample count to be divided by four for
non-MSAA framebuffers.

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

3 years agodocs/panfrost: Mention the IRC channel
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:36:20 +0000 (19:36 -0500)]
docs/panfrost: Mention the IRC channel

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Icecream95 <ixn@disroot.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/panfrost: Document building Panfrost
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:14:24 +0000 (19:14 -0500)]
docs/panfrost: Document building Panfrost

Pretty similar to anything else in Mesa, although kmsro is required and
LLVM is not.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/systems: Update Panfrost link
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:05:24 +0000 (19:05 -0500)]
docs/systems: Update Panfrost link

There's not much on the standalone site anymore (it dates back from
before Panfrost was upstreamed), let's just keep everything in Mesa.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs: Update Panfrost in the source tree
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:04:05 +0000 (19:04 -0500)]
docs: Update Panfrost in the source tree

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/panfrost: Fix comment about Lima
Alyssa Rosenzweig [Thu, 17 Dec 2020 23:58:56 +0000 (18:58 -0500)]
docs/panfrost: Fix comment about Lima

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agovc4: Fix typos.
Vinson Lee [Wed, 16 Dec 2020 04:03:09 +0000 (20:03 -0800)]
vc4: Fix typos.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8120>

3 years agoradv: remove useless push constants data when resolving ds attachments
Samuel Pitoiset [Wed, 16 Dec 2020 14:02:18 +0000 (15:02 +0100)]
radv: remove useless push constants data when resolving ds attachments

Depth/stencil resolves are only allowed inside a subpass, which means
the offset is always 0 and the draw/dispatch covers the whole image.

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

3 years agospirv: Remove more dead variables
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 22:31:32 +0000 (14:31 -0800)]
spirv: Remove more dead variables

SPIR-V modules can have multiple shaders (including of the same
stage), but the global variables are all declared for the whole
module.  This can result in variables with same Binding but
incompatible types, so those need to be removed before we use.

Previously, a similar issue but with a narrower scope was fixed by
6775665e5ee ("spirv: Eliminate dead input/output variables after
translation.").

This patch depends on the previous patch that prevents variables used
only in pointer initializers to be considered dead.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3686
Fixes: 3a266a18 ("nir/spirv: Add support for declaring variables")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Consider pointer initializers in nir_remove_dead_variables
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 07:25:51 +0000 (23:25 -0800)]
nir: Consider pointer initializers in nir_remove_dead_variables

Between the creation of a shader (from GLSL or SPIRV frontends) and
nir_lower_variable_initializers is called, variables may refer to
other variables for initialization.  Those referred variables need to
be kept alive, so consider that in the pass.

Fixes: 7acc81056f7 ("compiler/nir: Add support for variable initialization from a pointer")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Remove unused parameter in remove_dead_var_writes
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 06:58:58 +0000 (22:58 -0800)]
nir: Remove unused parameter in remove_dead_var_writes

And destroy the live set earlier in nir_remove_dead_variables.

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

3 years agonir: Fix outdated name in comment
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 22:07:57 +0000 (14:07 -0800)]
nir: Fix outdated name in comment

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

3 years agospirv: Implement OpArrayLength for OpenGL
Caio Marcelo de Oliveira Filho [Thu, 17 Dec 2020 04:51:30 +0000 (20:51 -0800)]
spirv: Implement OpArrayLength for OpenGL

Uses same NIR intrinsic as glsl_to_nir.  Make it an option so it is
easy later to move Vulkan drivers incrementally to use it.

Fixes piglit test spec/arb_gl_spirv/execution/ssbo/unsized-array-length.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3691
Fixes: 15e43907 ("iris: Enable ARB_gl_spirv and ARB_spirv_extensions")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8136>

3 years agozink: fix gl_SampleMaskIn handling
Mike Blumenkrantz [Fri, 7 Aug 2020 20:19:58 +0000 (16:19 -0400)]
zink: fix gl_SampleMaskIn handling

this is an array[1], so we need to do some extra legwork here even though
probably it'd work fine even without it

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

3 years agozink: fix rp hash table
Mike Blumenkrantz [Wed, 9 Dec 2020 20:26:30 +0000 (15:26 -0500)]
zink: fix rp hash table

hash table keys for inserted items have to be valid memory ranges for the
lifetime of the corresponding entry, so using a stack-allocated key like this
is broken and doesn't accurately return the correct renderpass

Fixes a872f4636924: ("zink: cache render-passes")

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

3 years agozink: move rp hash functions further up in file
Mike Blumenkrantz [Wed, 9 Dec 2020 20:26:06 +0000 (15:26 -0500)]
zink: move rp hash functions further up in file

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

3 years agozink: handle nir_op_find_lsb and nir_op_ifind_msb in ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:09:10 +0000 (09:09 -0400)]
zink: handle nir_op_find_lsb and nir_op_ifind_msb in ntv

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

3 years agozink: handle nir_op_ibitfield_extract: in ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:06:54 +0000 (09:06 -0400)]
zink: handle nir_op_ibitfield_extract: in ntv

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

3 years agozink: add nir_op_bit_count to ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:05:02 +0000 (09:05 -0400)]
zink: add nir_op_bit_count to ntv

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

3 years agozink: force stencil format for stencil-only samplers and swizzle the right component
Mike Blumenkrantz [Mon, 10 Aug 2020 18:42:19 +0000 (14:42 -0400)]
zink: force stencil format for stencil-only samplers and swizzle the right component

packed buffers will still return the full format when we're using only the
stencil aspect, so we need to explicitly set the format here

also due to 7ca72f172678116d29d254b786a9422b864aef3d we can't use the provided
swizzle for this case and have to force y -> x component swizzle

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

3 years agomesa/st: set lower_point_size for tes/gs during program update
Mike Blumenkrantz [Fri, 27 Nov 2020 19:01:03 +0000 (14:01 -0500)]
mesa/st: set lower_point_size for tes/gs during program update

these may not reach the other callsite in st_precompile_shader_variant(),
so we need to ensure that we get psiz if we need it

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

3 years agomesa/st: flag ST_NEW_CONSTANTS upon running nir_lower_point_size_mov
Mike Blumenkrantz [Thu, 30 Jul 2020 15:05:06 +0000 (11:05 -0400)]
mesa/st: flag ST_NEW_CONSTANTS upon running nir_lower_point_size_mov

this reduces to a load_ubo after optimization, so we need to ensure that
the constant data is put in a buffer instead of relying on it happening
coincidentally

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

3 years agomesa/st: handle running nir lower passes for ucp and psiz in tess stage
Mike Blumenkrantz [Thu, 16 Jul 2020 13:39:16 +0000 (09:39 -0400)]
mesa/st: handle running nir lower passes for ucp and psiz in tess stage

if tess is the last shader program to run then we need to perform these
lowering passes at that time rather than during the vs

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

3 years agomesa/st: tabs -> spaces in st_program
Mike Blumenkrantz [Thu, 16 Jul 2020 13:20:53 +0000 (09:20 -0400)]
mesa/st: tabs -> spaces in st_program

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

3 years agomesa/st: do not run lower_psiz_mov on vertex shader if geometry shader is present
Mike Blumenkrantz [Wed, 15 Jul 2020 12:33:28 +0000 (08:33 -0400)]
mesa/st: do not run lower_psiz_mov on vertex shader if geometry shader is present

this only needs to be changed on the last stage between the two

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

3 years agomesa/st: run nir_lower_point_size_mov on geometry shaders based on cap
Mike Blumenkrantz [Wed, 8 Jul 2020 15:59:57 +0000 (11:59 -0400)]
mesa/st: run nir_lower_point_size_mov on geometry shaders based on cap

geometry shaders need to output this variable as well, and the variable
added using the pass on the vertex shader won't be passed through here

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

3 years agoradv: fix maxFragmentShadingRateRasterizationSamples
Samuel Pitoiset [Tue, 15 Dec 2020 09:34:59 +0000 (10:34 +0100)]
radv: fix maxFragmentShadingRateRasterizationSamples

It's not a bitfield. This limit is purely informational.

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

3 years agoradv: adjust the maximum number of coverage samples for VRS
Samuel Pitoiset [Mon, 14 Dec 2020 16:30:11 +0000 (17:30 +0100)]
radv: adjust the maximum number of coverage samples for VRS

It should actually be 4 because the maximum fragment size supported
by the hardware is 2x2.

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

3 years agoswr: Fix crashes on Windows
jzielins [Thu, 17 Dec 2020 13:46:18 +0000 (14:46 +0100)]
swr: Fix crashes on Windows

SWR is missing implementation of pipe_context::flush_resource
function, which is now in the execution path on Windows.
This change adds an empty implementation (flush_resource
is NOOP in SWR) to prevent crashes

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8159>

3 years agodocs/features: update list of zink features
Erik Faye-Lund [Fri, 18 Dec 2020 09:26:57 +0000 (10:26 +0100)]
docs/features: update list of zink features

There's a few GL4 features that zink already supports.

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

3 years agoac/llvm: insert phis before demote kill
Rhys Perry [Fri, 11 Dec 2020 12:01:59 +0000 (12:01 +0000)]
ac/llvm: insert phis before demote kill

LLVM (like NIR) requires phi instructions to be before any other
instructions in the block. ac_branch_exited() can insert non-phi
instructions before visit_block() adds phis, so visit_block() should add
phi instructions before the non-phi instructions ac_branch_exited()
inserts.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: aa757f4f8c3 ("ac/llvm: fix demote inside conditional branches")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8054>

3 years agodoc/features: add VC4 driver
Juan A. Suarez Romero [Thu, 17 Dec 2020 10:22:30 +0000 (11:22 +0100)]
doc/features: add VC4 driver

Include this Broadcom driver in the feature matrix, together with the
implemented extensions.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8137>

3 years agogitlab: add RADV bug report template
Tony Wasserka [Wed, 11 Nov 2020 16:02:49 +0000 (17:02 +0100)]
gitlab: add RADV bug report template

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

3 years agoradv: enable TC-compat HTILE for D32_SFLOAT+MSAA on GFX10+
Samuel Pitoiset [Thu, 17 Dec 2020 10:06:10 +0000 (11:06 +0100)]
radv: enable TC-compat HTILE for D32_SFLOAT+MSAA on GFX10+

This was disabled due to some depth/stencil resolve CTS failures
which are now fixed.

I figured that disabling TC-compat HTILE for D32_SFLOAT+MSAA reduced
performance in Control by -11% on Vega10. In fact, the game only uses
D32_SFLOAT for depth rendering.

This gives a huge boost in Control on Navi10 (eg. +17% in MSAA4x).
Note that the game is still slower than PRO without MSAA on Navi10,
but as fast (or even a bit faster) on Vega10.

I think TC-compat HILE could also be enabled for D32_SFLOAT_S8_UINT
but it needs more testing first.

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

3 years agoturnip: fix cube map array image size calculation
Samuel Iglesias Gonsálvez [Mon, 14 Dec 2020 13:05:57 +0000 (14:05 +0100)]
turnip: fix cube map array image size calculation

imageSize() expects the last component of the return value to be the
number of layers in the texture array. In the case of cube map array,
it will return a ivec3, with the third component being the number of
layer-faces.

Fixes: dEQP-VK.image.image_size.cube_array.*

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8087>

3 years agomesa: call Driver.TexParameter in glPopAttrib to fix r100, r200, old nouveau
Marek Olšák [Sat, 12 Dec 2020 05:47:10 +0000 (00:47 -0500)]
mesa: call Driver.TexParameter in glPopAttrib to fix r100, r200, old nouveau

The glPopAttrib optimizations incorrectly removed it.

Use GL_ALL_ATTRIB_BITS to mean "all texture parameters have changed" to
make it more efficient.

Fixes: d0e18550e26 - mesa: optimize saving/restoring bound textures for glPush/PopAttrib

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

3 years agomesa: don't restore texture state into unbound textures in glPopAttrib
Marek Olšák [Sat, 12 Dec 2020 04:46:42 +0000 (23:46 -0500)]
mesa: don't restore texture state into unbound textures in glPopAttrib

It was a typo, or thinko, sort of.

Fixes: d0e18550e26 - mesa: optimize saving/restoring bound textures for glPush/PopAttrib

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: overallocate program parameter values
Marek Olšák [Sun, 22 Nov 2020 22:12:58 +0000 (17:12 -0500)]
mesa: overallocate program parameter values

See the comment. This is something I spotted in the code. There is
no known bug caused by this.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: remove unused LastUniformIndex
Marek Olšák [Fri, 11 Dec 2020 21:13:26 +0000 (16:13 -0500)]
mesa: remove unused LastUniformIndex

This is now dead code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agomesa: fix assertion paramList->LastUniformIndex < paramList->FirstStateVarIndex
Marek Olšák [Fri, 11 Dec 2020 21:04:58 +0000 (16:04 -0500)]
mesa: fix assertion paramList->LastUniformIndex < paramList->FirstStateVarIndex

This changes the code so that program parameters no longer have to be
sorted (meaning uniforms and constants are before state variables).

Instead of checking if the parameter is a state variable for every element,
teach all functions to handle non-state parameters safely. This is better
for the most common case where parameters are sorted or semi-sorted.

The new enum STATE_NOT_STATE_VAR identifes that a parameter is not
a state variable.

Fixes: 63f7d7dd - mesa: take advantage of sorted parameters in _mesa_load_state_parameters
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3914

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agodraw: fix incorrect NIR support code
Marek Olšák [Fri, 11 Dec 2020 01:03:50 +0000 (20:03 -0500)]
draw: fix incorrect NIR support code

"state" contains NIR, while "vs->base.state" contains TGSI generated
from NIR. It was a typo.

This fixes the arb_vp subtest of: DRAW_USE_LLVM=1 piglit/bin/rasterpos

Fixes: df11ceaaaf7 - draw: add NIR support to draw_create_vertex_shader

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agonir_to_tgsi: fix NIR options instead of asserting
Marek Olšák [Fri, 11 Dec 2020 00:23:57 +0000 (19:23 -0500)]
nir_to_tgsi: fix NIR options instead of asserting

Drivers can return any NIR options, but nir_to_tgsi doesn't support
any options because it was written to assume certain options are set.

This fixes a regression caused when st/mesa switched to NIR for passing
shaders to the draw module.

Fixes: 44b7e1497f9 - st/mesa: don't generate TGSI for the draw VS because it now supports NIR too
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3965

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

3 years agofreedreno/a6xx: Flush depth at the end of bypass rendering, too.
Eric Anholt [Thu, 17 Dec 2020 20:30:16 +0000 (12:30 -0800)]
freedreno/a6xx: Flush depth at the end of bypass rendering, too.

We apparently don't have anything else making sure that it's flushed in
between use as a render target and use as a texture source, so bypass-mode
depth texture sampling could get stale data.

Fixes consistent (as far as I could see) failures in FD_MESA_DEBUG=nogmem
on:

dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_depth_2d
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_draw

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8146>

3 years agomesa/st: Finalize the texture before BlitFramebuffer from it.
Eric Anholt [Mon, 14 Dec 2020 17:24:58 +0000 (09:24 -0800)]
mesa/st: Finalize the texture before BlitFramebuffer from it.

If the texture hasn't yet been validated, the current tex image contents
may have been ignored in favor of the texture's main miptree.  Fixes test
failure on softpipe and intermittent failures on radeonsi in:

https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/428

Cc: mesa-stable
Tested-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8091>

3 years agoutil/list: use helper function in list_is_singular
Marcin Ślusarz [Tue, 15 Dec 2020 15:06:57 +0000 (16:06 +0100)]
util/list: use helper function in list_is_singular

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoomx: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 15:00:16 +0000 (16:00 +0100)]
omx: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agor600: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:59:47 +0000 (15:59 +0100)]
r600: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoiris: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:59:34 +0000 (15:59 +0100)]
iris: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agogallium: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:59:16 +0000 (15:59 +0100)]
gallium: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agonine: use list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:58:24 +0000 (15:58 +0100)]
nine: use list_is_linked

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoutil/list: add list_is_linked
Marcin Ślusarz [Tue, 15 Dec 2020 14:56:02 +0000 (15:56 +0100)]
util/list: add list_is_linked

v2: verify node is valid in list_is_linked (Timothy)

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agoiris: remove redundant check
Marcin Ślusarz [Tue, 15 Dec 2020 14:43:21 +0000 (15:43 +0100)]
iris: remove redundant check

list_del dereferences both next and prev, so if only one of them could
be NULL we would get crashes already.

Should fix "Dereference after null check" reported by Coverity.

Code was added in: 64b73b770b7 ("iris: Fix bad external BO hash table and zombie list interactions")

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agosvga: remove duplicated code
Marcin Ślusarz [Tue, 15 Dec 2020 14:40:50 +0000 (15:40 +0100)]
svga: remove duplicated code

list_del unconditionally sets "next" and "prev" to NULL.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

3 years agonir/opt_if: split ALU from Phi more aggressively
Daniel Schürmann [Wed, 16 Dec 2020 09:33:59 +0000 (10:33 +0100)]
nir/opt_if: split ALU from Phi more aggressively

If the only user is a trivial bcsel which in a second step
can be turned into a phi, this conversion is also worth it
even if the previous result is not undefined or constant.
Allows for some more loop unrolling or saves a few instructions.

Totals from 62 (0.04% of 139391) affected shaders (NAVI10):
SGPRs: 4976 -> 4992 (+0.32%)
VGPRs: 4408 -> 4472 (+1.45%); split: -0.45%, +1.91%
CodeSize: 453632 -> 464000 (+2.29%); split: -0.32%, +2.60%
MaxWaves: 527 -> 511 (-3.04%); split: +0.38%, -3.42%
Instrs: 84940 -> 86681 (+2.05%); split: -0.36%, +2.41%
Cycles: 11946844 -> 11783708 (-1.37%); split: -1.40%, +0.04%
VMEM: 9403 -> 10357 (+10.15%); split: +11.59%, -1.45%
SMEM: 3003 -> 3025 (+0.73%); split: +1.07%, -0.33%
VClause: 1756 -> 1997 (+13.72%); split: -0.11%, +13.84%
SClause: 2914 -> 2915 (+0.03%); split: -0.10%, +0.14%
Copies: 6426 -> 6768 (+5.32%); split: -4.14%, +9.46%
Branches: 2105 -> 2102 (-0.14%); split: -1.66%, +1.52%
PreSGPRs: 2921 -> 2909 (-0.41%); split: -0.55%, +0.14%
PreVGPRs: 4151 -> 4179 (+0.67%); split: -0.24%, +0.92%

cc: mesa-stable

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

3 years agoclover/api: Add extended versioning query for OpenCL C
Pierre Moreau [Thu, 12 Nov 2020 20:37:21 +0000 (21:37 +0100)]
clover/api: Add extended versioning query for OpenCL C

The cl_khr_extended_versioning extension differs from the OpenCL 3.0
version on this specific as it only reports a single supported OpenCL C
version, whereas the OpenCL 3.0 equivalent will report all of them.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7590>

3 years agoclover/api: Add extended versioning query for built-in kernels
Pierre Moreau [Thu, 12 Nov 2020 20:31:24 +0000 (21:31 +0100)]
clover/api: Add extended versioning query for built-in kernels

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7590>

3 years agozink: enable 64bit pipe caps
Mike Blumenkrantz [Thu, 5 Nov 2020 18:01:24 +0000 (13:01 -0500)]
zink: enable 64bit pipe caps

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: set nir options for 64bit handling based on feature presence
Mike Blumenkrantz [Thu, 5 Nov 2020 18:01:02 +0000 (13:01 -0500)]
zink: set nir options for 64bit handling based on feature presence

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: split ubo loading for 64bit types into 2x32bit loads
Mike Blumenkrantz [Thu, 5 Nov 2020 17:58:47 +0000 (12:58 -0500)]
zink: split ubo loading for 64bit types into 2x32bit loads

this loads 2x32 for each 64bit value and then zips it back into 64bit
for storage

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: more conversion ALUs
Erik Faye-Lund [Thu, 17 Dec 2020 14:02:07 +0000 (15:02 +0100)]
zink: more conversion ALUs

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

3 years agozink: handle 64bit constant loading in ntv
Mike Blumenkrantz [Thu, 5 Nov 2020 17:58:21 +0000 (12:58 -0500)]
zink: handle 64bit constant loading in ntv

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: add 64bit glsl basetype handling in ntv
Mike Blumenkrantz [Thu, 5 Nov 2020 17:57:55 +0000 (12:57 -0500)]
zink: add 64bit glsl basetype handling in ntv

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: change function params and asserts to permit 64bit types in ntv
Mike Blumenkrantz [Thu, 5 Nov 2020 17:57:37 +0000 (12:57 -0500)]
zink: change function params and asserts to permit 64bit types in ntv

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: set 64bit shader caps in ntv
Mike Blumenkrantz [Thu, 5 Nov 2020 17:56:33 +0000 (12:56 -0500)]
zink: set 64bit shader caps in ntv

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: add handlers for some bitfield ops in ntv
Mike Blumenkrantz [Tue, 15 Dec 2020 16:33:10 +0000 (11:33 -0500)]
zink: add handlers for some bitfield ops in ntv

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: nir_op_b2f64 implementation
Erik Faye-Lund [Thu, 17 Dec 2020 14:02:33 +0000 (15:02 +0100)]
zink: nir_op_b2f64 implementation

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

3 years agozink: add some 64-bit conversion ALUs
Dave Airlie [Wed, 22 Jul 2020 00:28:42 +0000 (10:28 +1000)]
zink: add some 64-bit conversion ALUs

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: support nir_op_f2f32
Mike Blumenkrantz [Tue, 15 Dec 2020 16:37:24 +0000 (11:37 -0500)]
zink: support nir_op_f2f32

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agozink: add handling for 64bit values in spirv_builder
Mike Blumenkrantz [Thu, 5 Nov 2020 18:00:23 +0000 (13:00 -0500)]
zink: add handling for 64bit values in spirv_builder

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

3 years agodrisw: Prefer hardware-layered sw-winsys drivers over pure sw
Jesse Natalie [Wed, 9 Dec 2020 01:15:19 +0000 (17:15 -0800)]
drisw: Prefer hardware-layered sw-winsys drivers over pure sw

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8128>

3 years agodrisw: Add fallback logic for choosing a driver to use
Jesse Natalie [Wed, 9 Dec 2020 00:32:03 +0000 (16:32 -0800)]
drisw: Add fallback logic for choosing a driver to use

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8128>

3 years agoaco: add block to worklist in mark_block_wqm()
Rhys Perry [Thu, 17 Dec 2020 16:52:24 +0000 (16:52 +0000)]
aco: add block to worklist in mark_block_wqm()

Since we're requiring the branch condition to be in WQM, we have to ensure
that the block is in the worklist.

Fixes Trials Fusion hang at 4K and High settings.

fossil-db (Sienna):
Totals from 216 (0.15% of 139391) affected shaders:
SGPRs: 13392 -> 13360 (-0.24%)
CodeSize: 1321184 -> 1318592 (-0.20%)
Instrs: 255310 -> 254662 (-0.25%)
Cycles: 2178360 -> 2174652 (-0.17%)

Affected fossils in fossil-db are dirt4, nier and youngblood.

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