platform/upstream/mesa.git
2 years agoaco: optimize load_local_invocation_index with single-wave workgroups
Rhys Perry [Thu, 11 Nov 2021 10:27:30 +0000 (10:27 +0000)]
aco: optimize load_local_invocation_index with single-wave workgroups

fossil-db (Sienna Cichlid):
Totals from 668 (0.52% of 128647) affected shaders:
CodeSize: 2201912 -> 2193336 (-0.39%)
Instrs: 403124 -> 402325 (-0.20%)
Latency: 4510940 -> 4510214 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 681057 -> 679453 (-0.24%); split: -0.24%, +0.00%
VClause: 6470 -> 6467 (-0.05%)
SClause: 12759 -> 12755 (-0.03%)
Copies: 26348 -> 26218 (-0.49%); split: -0.50%, +0.00%
PreSGPRs: 26140 -> 26101 (-0.15%)

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

2 years agoradv: lower load_local_invocation_index with 1D workgroups
Rhys Perry [Thu, 11 Nov 2021 14:26:22 +0000 (14:26 +0000)]
radv: lower load_local_invocation_index with 1D workgroups

For 1D workgroups, we can just load from an input VGPR.

fossil-db (Sienna Cichlid):
Totals from 226 (0.18% of 128647) affected shaders:
CodeSize: 1200476 -> 1195696 (-0.40%); split: -0.49%, +0.09%
Instrs: 223817 -> 223328 (-0.22%); split: -0.29%, +0.07%
Latency: 2552394 -> 2549606 (-0.11%); split: -0.15%, +0.04%
InvThroughput: 533989 -> 532670 (-0.25%); split: -0.27%, +0.02%
VClause: 5191 -> 5188 (-0.06%)
SClause: 7637 -> 7636 (-0.01%)
Copies: 18165 -> 18182 (+0.09%); split: -0.22%, +0.31%
Branches: 10446 -> 10442 (-0.04%)
PreSGPRs: 8049 -> 8041 (-0.10%); split: -0.17%, +0.07%
PreVGPRs: 7785 -> 7767 (-0.23%); split: -0.32%, +0.09%

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

2 years agonir/lower_system_values: replace local_invocation_id components with zero
Rhys Perry [Thu, 11 Nov 2021 14:26:00 +0000 (14:26 +0000)]
nir/lower_system_values: replace local_invocation_id components with zero

fossil-db (Sienna Cichlid):
Totals from 360 (0.28% of 128647) affected shaders:
VGPRs: 7912 -> 7272 (-8.09%); split: -8.59%, +0.51%
CodeSize: 542456 -> 544688 (+0.41%); split: -0.32%, +0.73%
MaxWaves: 10866 -> 10952 (+0.79%)
Instrs: 95973 -> 96010 (+0.04%); split: -0.34%, +0.38%
Latency: 4366023 -> 4344664 (-0.49%); split: -0.90%, +0.41%
InvThroughput: 19656659 -> 18297185 (-6.92%); split: -6.92%, +0.00%
VClause: 3242 -> 3116 (-3.89%); split: -4.04%, +0.15%
SClause: 3422 -> 3504 (+2.40%); split: -0.20%, +2.60%
Copies: 8854 -> 9376 (+5.90%); split: -0.89%, +6.79%
Branches: 2329 -> 2326 (-0.13%); split: -0.39%, +0.26%
PreSGPRs: 7620 -> 7841 (+2.90%); split: -0.43%, +3.33%
PreVGPRs: 5765 -> 5504 (-4.53%)

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

2 years agotu: Expose Vulkan 1.2
Connor Abbott [Thu, 11 Nov 2021 12:35:10 +0000 (13:35 +0100)]
tu: Expose Vulkan 1.2

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

2 years agotu: Add VK_KHR_buffer_device_address stubs
Connor Abbott [Thu, 11 Nov 2021 14:15:49 +0000 (15:15 +0100)]
tu: Add VK_KHR_buffer_device_address stubs

dEQP-VK.api.version_check.entry_points requires us to return a function
pointer, even though the feature is optional in Vulkan 1.2.

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

2 years agotu: Enable subgroupBroadcastDynamicId
Connor Abbott [Thu, 11 Nov 2021 12:31:55 +0000 (13:31 +0100)]
tu: Enable subgroupBroadcastDynamicId

It's a Vulkan 1.2 only feature, but it's trivially supported.

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

2 years agofreedreno/a[345]xx: add R8/RG8 SRGB formats
Ilia Mirkin [Fri, 12 Nov 2021 02:25:26 +0000 (21:25 -0500)]
freedreno/a[345]xx: add R8/RG8 SRGB formats

These enable the GL_EXT_texture_sRGB_R8 / GL_EXT_texture_sRGB_RG8
extensions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13765>

2 years agofreedreno: prefer float immediates when float values are involved
Ilia Mirkin [Fri, 12 Nov 2021 01:07:08 +0000 (20:07 -0500)]
freedreno: prefer float immediates when float values are involved

Using double immediates can cause a natively-float value to have to get
upgraded to a double unnecessarily. Use float immediates where possible.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13764>

2 years agopan/mdg: Remove duplicate compiler option
Alyssa Rosenzweig [Fri, 12 Nov 2021 16:11:16 +0000 (11:11 -0500)]
pan/mdg: Remove duplicate compiler option

Noted by clang.

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

2 years agopan/bi: Enable dual texture fusing pass
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:51:22 +0000 (14:51 -0500)]
pan/bi: Enable dual texture fusing pass

Everything is in place for it now -- ship it! Our Bifrost cycle model is
coarse, so take the shader-db results with a massive spoonful of salt:

total instructions in shared programs: 107504 -> 107252 (-0.23%)
instructions in affected programs: 39692 -> 39440 (-0.63%)
helped: 191
HURT: 1
helped stats (abs) min: 1.0 max: 20.0 x̄: 1.32 x̃: 1
helped stats (rel) min: 0.11% max: 9.52% x̄: 1.21% x̃: 0.98%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 2.04% max: 2.04% x̄: 2.04% x̃: 2.04%
95% mean confidence interval for instructions value: -1.60 -1.02
95% mean confidence interval for instructions %-change: -1.37% -1.01%
Instructions are helped.

total tuples in shared programs: 89864 -> 89664 (-0.22%)
tuples in affected programs: 27787 -> 27587 (-0.72%)
helped: 146
HURT: 6
helped stats (abs) min: 1.0 max: 17.0 x̄: 1.54 x̃: 1
helped stats (rel) min: 0.14% max: 15.38% x̄: 1.83% x̃: 1.25%
HURT stats (abs)   min: 1.0 max: 11.0 x̄: 4.17 x̃: 2
HURT stats (rel)   min: 0.54% max: 3.55% x̄: 1.29% x̃: 0.87%
95% mean confidence interval for tuples value: -1.64 -0.99
95% mean confidence interval for tuples %-change: -2.06% -1.36%
Tuples are helped.

total clauses in shared programs: 18253 -> 18044 (-1.15%)
clauses in affected programs: 5127 -> 4918 (-4.08%)
helped: 164
HURT: 1
helped stats (abs) min: 1.0 max: 19.0 x̄: 1.28 x̃: 1
helped stats (rel) min: 0.78% max: 28.57% x̄: 6.73% x̃: 5.88%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 2.94% max: 2.94% x̄: 2.94% x̃: 2.94%
95% mean confidence interval for clauses value: -1.50 -1.04
95% mean confidence interval for clauses %-change: -7.42% -5.91%
Clauses are helped.

total cycles in shared programs: 8118.54 -> 8103.88 (-0.18%)
cycles in affected programs: 414.96 -> 400.29 (-3.53%)
helped: 43
HURT: 27
helped stats (abs) min: 0.041665999999999315 max: 4.375 x̄: 0.41 x̃: 0
helped stats (rel) min: 0.24% max: 50.00% x̄: 11.49% x̃: 5.26%
HURT stats (abs)   min: 0.041665999999999315 max: 1.1666639999999973 x̄:
0.10 x̃: 0
HURT stats (rel)   min: 0.43% max: 4.71% x̄: 1.42% x̃: 1.28%
95% mean confidence interval for cycles value: -0.35 -0.07
95% mean confidence interval for cycles %-change: -9.50% -3.53%
Cycles are helped.

total arith in shared programs: 3375.67 -> 3376.42 (0.02%)
arith in affected programs: 345.29 -> 346.04 (0.22%)
helped: 24
HURT: 32
helped stats (abs) min: 0.041665999999999315 max: 0.5833329999999997 x̄:
0.09 x̃: 0
helped stats (rel) min: 0.24% max: 14.29% x̄: 2.82% x̃: 1.50%
HURT stats (abs)   min: 0.041665999999999315 max: 1.1666639999999973 x̄:
0.09 x̃: 0
HURT stats (rel)   min: 0.43% max: 4.71% x̄: 1.42% x̃: 1.28%
95% mean confidence interval for arith value: -0.04 0.07
95% mean confidence interval for arith %-change: -1.19% 0.39%
Inconclusive result (value mean confidence interval includes 0).

total texture in shared programs: 1275 -> 1157 (-9.25%)
texture in affected programs: 725.50 -> 607.50 (-16.26%)
helped: 192
HURT: 0
helped stats (abs) min: 0.5 max: 10.0 x̄: 0.61 x̃: 0
helped stats (rel) min: 2.86% max: 50.00% x̄: 25.20% x̃: 25.00%
95% mean confidence interval for texture value: -0.72 -0.51
95% mean confidence interval for texture %-change: -27.12% -23.27%
Texture are helped.

total vary in shared programs: 537.88 -> 536.12 (-0.33%)
vary in affected programs: 2.75 -> 1 (-63.64%)
helped: 1
HURT: 0

total quadwords in shared programs: 79762 -> 79681 (-0.10%)
quadwords in affected programs: 10261 -> 10180 (-0.79%)
helped: 59
HURT: 18
helped stats (abs) min: 1.0 max: 14.0 x̄: 1.88 x̃: 1
helped stats (rel) min: 0.38% max: 8.20% x̄: 1.95% x̃: 1.43%
HURT stats (abs)   min: 1.0 max: 4.0 x̄: 1.67 x̃: 1
HURT stats (rel)   min: 0.46% max: 8.89% x̄: 2.22% x̃: 1.21%
95% mean confidence interval for quadwords value: -1.57 -0.53
95% mean confidence interval for quadwords %-change: -1.59% -0.37%
Quadwords are helped.

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

2 years agopan/bi: Test dual texture fusing
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:52:03 +0000 (14:52 -0500)]
pan/bi: Test dual texture fusing

These patterns are quite tricky, so let's make sure we're testing
adequately.

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

2 years agopan/bi: Add dual texture fusing pass
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:49:53 +0000 (14:49 -0500)]
pan/bi: Add dual texture fusing pass

Bifrost supports a special "dual texture" instruction, sampling from two
textures at once at the same coordinate. Each subinstruction is highly
restricted (a subset of TEXS_2D); together, they are represented by TEXC
with a special dual texture operation descriptor. Add an optimization
pass to fuse these instructions.

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

2 years agopan/bi: Fix up dual texturing registers
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:43:08 +0000 (14:43 -0500)]
pan/bi: Fix up dual texturing registers

This must be done after RA. How delightful. Use the GenXML strategy to
just OR the birds.

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

2 years agopan/bi: Add bi_dual_tex_as_u32 helper
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:43:41 +0000 (14:43 -0500)]
pan/bi: Add bi_dual_tex_as_u32 helper

Type safe cast, making dual texture descriptors easier to manipulate.

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

2 years agopan/bi: Support dual texture scheduling
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:10:48 +0000 (14:10 -0500)]
pan/bi: Support dual texture scheduling

Teach the scheduler about dual texturing to avoid an artifical "must not
last" constraint causing suboptimal scheduling like

clause_1:
ds(0) nbb tex ncph dwb(0)
{
    *NOP t0
    +TEXC.skip t1, r0, r1, 0xf1e00144, @r4
    *NOP t0
    +NOP t1
}

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

2 years agopan/bi: Use BIFROST_TEXTURE_OPERATION_SINGLE enum
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:00:24 +0000 (14:00 -0500)]
pan/bi: Use BIFROST_TEXTURE_OPERATION_SINGLE enum

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

2 years agopan/bi: Add bifrost_dual_texture_operation struct
Alyssa Rosenzweig [Mon, 8 Nov 2021 18:59:55 +0000 (13:59 -0500)]
pan/bi: Add bifrost_dual_texture_operation struct

This is the other state of the texture operation descriptor. We must
pack it in the compiler when fusing dual texturing.

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

2 years agopan/bi: Add bifrost_texture_operation_mode enum
Alyssa Rosenzweig [Mon, 8 Nov 2021 18:59:39 +0000 (13:59 -0500)]
pan/bi: Add bifrost_texture_operation_mode enum

Differentiates single/dual texturing.

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

2 years agopan/bi: Add second destination to TEXC
Alyssa Rosenzweig [Mon, 8 Nov 2021 15:36:54 +0000 (10:36 -0500)]
pan/bi: Add second destination to TEXC

Used to model dual texturing, which writes to separate sets of staging
registers.

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

2 years agopan/bi: Add secondary staging count
Alyssa Rosenzweig [Mon, 8 Nov 2021 15:36:30 +0000 (10:36 -0500)]
pan/bi: Add secondary staging count

Useful for instructions with two independent sets of staging registers
(like dual source blending or dual texturing).

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

2 years agopan/bi: Make bi_index padding explicit
Alyssa Rosenzweig [Fri, 12 Nov 2021 16:11:25 +0000 (11:11 -0500)]
pan/bi: Make bi_index padding explicit

Avoids reliance on UB.

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

2 years agopan/bi: Fix typo in helper invocation analysis
Alyssa Rosenzweig [Mon, 8 Nov 2021 19:32:11 +0000 (14:32 -0500)]
pan/bi: Fix typo in helper invocation analysis

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

2 years agomesa: add just a tiny bit of debug info to some _mesa_problem calls
Ilia Mirkin [Fri, 12 Nov 2021 02:04:16 +0000 (21:04 -0500)]
mesa: add just a tiny bit of debug info to some _mesa_problem calls

I hit these on a4xx with dEQP-GLES2/3 runs. Having more info on them
would make everyone's life easier.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13766>

2 years agonv50,nvc0: expose R8/RG8_SRGB formats for texturing
Ilia Mirkin [Fri, 12 Nov 2021 06:51:43 +0000 (01:51 -0500)]
nv50,nvc0: expose R8/RG8_SRGB formats for texturing

This enables the GL_EXT_texture_sRGB_R8/RG8 extensions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13769>

2 years agoturnip: Enable VK_KHR_separate_depth_stencil_layouts
Hyunjun Ko [Mon, 27 Sep 2021 07:02:02 +0000 (07:02 +0000)]
turnip: Enable VK_KHR_separate_depth_stencil_layouts

We now start handling depth/stencil layouts separately when
adding implicit subpass dependancies.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13057>

2 years agonir/lower_pntc_ytransform: Support PointCoordIsSysval
Alyssa Rosenzweig [Mon, 27 Sep 2021 21:15:38 +0000 (17:15 -0400)]
nir/lower_pntc_ytransform: Support PointCoordIsSysval

Pattern match the point coord sysval and support lowering it as well.
This is required to handle flipped framebuffers on Bifrost. However,
what this pass normalizes to is the opposite of the hardware mode we
used on Bifrost before, so we need to swap modes at the same time to
prevent regressions.

Fixes Piglit glsl-fs-pointcoord and glsl-fs-pointcoord_gles2

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13073>

2 years agomesa: add missing state to state string computation
Ilia Mirkin [Fri, 12 Nov 2021 02:10:20 +0000 (21:10 -0500)]
mesa: add missing state to state string computation

This is an internal state, so does not need to be made available in the
string itself (same as the wpos_y_transform). But it needs to be listed
to avoid the mesa_problem.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13073>

2 years agov3dv: don't use a global constant for default pipeline dynamic state
Iago Toral Quiroga [Fri, 12 Nov 2021 07:28:18 +0000 (08:28 +0100)]
v3dv: don't use a global constant for default pipeline dynamic state

Some of these may change across V3D versions, so it is not practical.

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

2 years agov3dv: account for multisampling when computing subpass granularity
Iago Toral Quiroga [Fri, 12 Nov 2021 07:09:26 +0000 (08:09 +0100)]
v3dv: account for multisampling when computing subpass granularity

The granularity is defined by the tile size, which is also determined
by multisampling.

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

2 years agov3d: use V3D_MAX_DRAW_BUFFERS instead of hardcoded constant
Iago Toral Quiroga [Fri, 12 Nov 2021 09:35:04 +0000 (10:35 +0100)]
v3d: use V3D_MAX_DRAW_BUFFERS instead of hardcoded constant

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

2 years agomeson: Update libelf wrap for Windows
James Park [Thu, 11 Nov 2021 07:27:49 +0000 (23:27 -0800)]
meson: Update libelf wrap for Windows

Newer libelf update supports 32-bit Windows.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13749>

2 years agoradv: Match function definitions to declarations
James Park [Thu, 11 Nov 2021 07:25:47 +0000 (23:25 -0800)]
radv: Match function definitions to declarations

Fixes compiler errors for 32-bit Windows.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13749>

2 years agoac: Align ADDR_FASTCALL with addrlib
James Park [Thu, 11 Nov 2021 07:24:38 +0000 (23:24 -0800)]
ac: Align ADDR_FASTCALL with addrlib

Fixes linker errors for 32-bit Windows.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13749>

2 years agodriconf: support META application
Qiang Yu [Fri, 5 Nov 2021 02:22:06 +0000 (10:22 +0800)]
driconf: support META application

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13686>

2 years agoradeonsi: add radeonsi_force_use_fma32 driconf option
Qiang Yu [Fri, 5 Nov 2021 02:05:09 +0000 (10:05 +0800)]
radeonsi: add radeonsi_force_use_fma32 driconf option

fma32 only round once so has 0.5UP accuracy. mad32 round twice so
has 1UP accuracy. This accuracy difference sometimes make the result
different at the last bit.

Applications like META need more accuracy for display right result.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13686>

2 years agoci/bare-metal: switch to common .baremetal-test-arm64
Christian Gmeiner [Wed, 10 Nov 2021 14:55:53 +0000 (15:55 +0100)]
ci/bare-metal: switch to common .baremetal-test-arm64

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13751>

2 years agoci/bare-metal: add .baremetal-test-arm64
Christian Gmeiner [Wed, 10 Nov 2021 14:54:57 +0000 (15:54 +0100)]
ci/bare-metal: add .baremetal-test-arm64

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13751>

2 years agoci/etnaviv: no need to force nir anymore
Christian Gmeiner [Wed, 10 Nov 2021 14:43:06 +0000 (15:43 +0100)]
ci/etnaviv: no need to force nir anymore

It is the new default.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13751>

2 years agoci/etnaviv: armhf: switch to .baremetal-test-armhf
Christian Gmeiner [Wed, 10 Nov 2021 14:50:20 +0000 (15:50 +0100)]
ci/etnaviv: armhf: switch to .baremetal-test-armhf

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13751>

2 years agoci/bare-metal: armhf: move BM_ROOTFS to generic place
Christian Gmeiner [Wed, 10 Nov 2021 14:48:50 +0000 (15:48 +0100)]
ci/bare-metal: armhf: move BM_ROOTFS to generic place

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13751>

2 years agoaux/primconvert: support pipe_context::draw_vertex_state
Mike Blumenkrantz [Fri, 5 Nov 2021 15:56:56 +0000 (11:56 -0400)]
aux/primconvert: support pipe_context::draw_vertex_state

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

2 years agoaux/primconvert: break out primconvert internals into util function
Mike Blumenkrantz [Fri, 5 Nov 2021 15:56:22 +0000 (11:56 -0400)]
aux/primconvert: break out primconvert internals into util function

this should (ideally) be no functional changes

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

2 years agofreedreno/a4xx: fix min/max/bias lod sampler settings
Ilia Mirkin [Fri, 12 Nov 2021 00:16:15 +0000 (19:16 -0500)]
freedreno/a4xx: fix min/max/bias lod sampler settings

This makes a4xx look more like a3xx for these settings. Most importantly
it adds the workaround for allowing the hw to decide between min and mag
filtering. This fixes a number of dEQP texture filtering tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13763>

2 years agofreedreno/ir3: fix setting the max tf vertex when there are no outputs
Ilia Mirkin [Thu, 11 Nov 2021 22:01:11 +0000 (17:01 -0500)]
freedreno/ir3: fix setting the max tf vertex when there are no outputs

Fixes dEQP-GLES3.functional.transform_feedback.* on a4xx.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13760>

2 years agofreedreno: check batch size after the fallback blitter clear
Ilia Mirkin [Thu, 11 Nov 2021 22:29:43 +0000 (17:29 -0500)]
freedreno: check batch size after the fallback blitter clear

When force-flushing after every draw, this would otherwise hit a NULL
batch in fd_blitter_clear.

Tested on a4xx.

Suggested-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13761>

2 years agoanv: fix multiple wait/signal on same binary semaphore
Lionel Landwerlin [Tue, 9 Nov 2021 08:24:32 +0000 (10:24 +0200)]
anv: fix multiple wait/signal on same binary semaphore

We need to guarantee that when vkQueueSubmit() returns the application
can actually wait on a signaled semaphore/syncobj.

When using a thread to do the submission to i915, this gets a bit
tricky in the following case :

   A syncobj is used both as a wait & signal semaphore and has been
   signaled once already. It contains a fence before entering
   vkQueueSubmit().

   This means we need to reset the syncobj to ensure when we return
   from vkQueueSubmit(), the syncobj contains no stale fence.

   Currently in the Anv, the submission thread is in charge of putting
   the new fence in the syncobj and also picks up the wait fence
   directly from the syncobj. This means we can't reset the syncobj
   from vkQueueSubmit().

The solution to this has been pointed by Bas & Jason :

   In vkQueueSubmit(), clone the wait syncobj fence into a new
   temporary syncobj that will be destroy after submission and use
   this temporary syncobj as a wait fence for i915. This allows us to
   reset the original syncobj in vkQueueSubmit().

   For this to work with wait_before_signal behavior, we also need to
   do a wait-on-materialize on binary semaphores from vkQueueSubmit().
   Otherwise the application thread calling vkQueueSubmit() could race
   the submission thread and pick up the wrong fence when cloing.

v2: Use copy semantic for clone_syncobj_dma_fence() (Jason)
    Do the cloning prior to adding the syncobj to anv_queue_submit so
    that if the cloning fails don't have an invalid syncobj in
    anv_queue_submit (Jason)

v3: Fix another syncobj leak (Jason)

v4: Fix invalid argument order (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4945
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11474>

2 years agogtest: Fix output of array ASSERT/EXPECT macros
Caio Oliveira [Thu, 11 Nov 2021 04:31:36 +0000 (20:31 -0800)]
gtest: Fix output of array ASSERT/EXPECT macros

Fixes: 015383d1d78 ("gtest: Add mesa-gtest-extras.h with array ASSERT/EXPECT macros")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13748>

2 years agovulkan/util: Handle depth-only formats in vk_att_ref_stencil_layout
Danylo Piliaiev [Wed, 10 Nov 2021 16:32:45 +0000 (18:32 +0200)]
vulkan/util: Handle depth-only formats in vk_att_ref_stencil_layout

From VUID-VkAttachmentReference2-attachment-04755:
 "If attachment is not VK_ATTACHMENT_UNUSED, and the format of the
  referenced attachment is a depth/stencil format which includes both
  depth and stencil aspects, and layout is
  VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or
  VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, the pNext chain must include
  a VkAttachmentReferenceStencilLayout structure."

We did not check that there even could be a stencil layout
before fetching it.

Fixes a few tests from:
 dEQP-VK.image.depth_stencil_descriptor.depth_read_only_optimal.*

Fixes: 979ea394e56a418f4138b5f440ec0b641cc5fa0e "vulkan/util: Move
helper functions for depth/stencil images to vk_iamge"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13740>

2 years agomesa/st: Disable NV_copy_depth_to_color on non-doubles-capable HW.
Emma Anholt [Wed, 10 Nov 2021 20:10:43 +0000 (12:10 -0800)]
mesa/st: Disable NV_copy_depth_to_color on non-doubles-capable HW.

The previous doubles check
(https://gitlab.freedesktop.org/mesa/mesa/-/issues/3459) checked that you
didn't have full doubles emulation turned on, but we also need to check
that you have doubles at all (emulated or not) or non-GL4 drivers will
fail.

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

2 years agov3d: remove static v3d_start_binning
Alejandro Piñeiro [Thu, 4 Nov 2021 23:41:50 +0000 (00:41 +0100)]
v3d: remove static v3d_start_binning

v3dx(start_binning) is just a call to that method, so let's just use
it directly.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13754>

2 years agov3d: remove unused include
Alejandro Piñeiro [Tue, 26 Oct 2021 23:30:01 +0000 (01:30 +0200)]
v3d: remove unused include

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13754>

2 years agolima: Fix drawing wide lines
Andreas Baierl [Tue, 21 Sep 2021 16:21:06 +0000 (18:21 +0200)]
lima: Fix drawing wide lines

GLES2.0 spec allows parts of wide lines and points to be drawn even if
their center is outside the viewport.
Therefore 0x2000 in PLBU_CMD_PRIMITIVE_SETUP has to be set for points.
This is already our default setting as it seems to have no negative
effect when this bit is always set. Points work as expected but lines
don't. It's hard to RE it, because the affected deqp tests also fail
with the blob.

To respect this behaviour for lines and solve another 2 tests, we need
to do a workaround and temporarily extend the viewport by half of the
line width. The scissor rectangle is still equal with the initial
viewport.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12971>

2 years agoac/rgp: add support for dumping SPM data
Samuel Pitoiset [Mon, 31 May 2021 14:42:36 +0000 (16:42 +0200)]
ac/rgp: add support for dumping SPM data

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13704>

2 years agoac: add initial SPM support
Samuel Pitoiset [Mon, 31 May 2021 14:38:34 +0000 (16:38 +0200)]
ac: add initial SPM support

SPM is hardware feature that allows us to dump performance counters
at a sampling interval to a buffer. It is used by RGP to report cache
counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13704>

2 years agov3d: Update prim_counts when prims generated query in flight without TF
Neil Roberts [Fri, 29 Oct 2021 15:56:39 +0000 (17:56 +0200)]
v3d: Update prim_counts when prims generated query in flight without TF

In order to implement GL_PRIMITIVES_GENERATED, v3d allocates a small
resource and adds a command to the job to store the prim counts to it.
However it was only doing this when TF was enabled which meant that if
the query was used with a geometry shader but no TF then the query would
always be zero. This patch makes the driver keep track of how many
PRIMITIVES_GENERATED queries are in flight and then enable writing the
prim count if its more than zero.

Fix dEQP-GLES31.functional.geometry_shading.query.primitives_generated_*

v2: Update CI expectations and references to fixed tests in commit log.
v3: - Add comment that GL_PRIMITIVES_GENERATED query is included because
      OES_geometry_shader, but it is not part of OpenGL ES 3.1. (Iago)
    - Update Fixes to commit introducing geometry shaders. (Iago)

Fixes: a1b7c084 ("v3d: fix primitive queries for geometry shaders")
Signed-off-by: Neil Roberts <nroberts@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13712>

2 years agovirgl: Allocate qdws after virgl_init_context to avoid leak.
Vinson Lee [Sat, 30 Oct 2021 22:12:00 +0000 (15:12 -0700)]
virgl: Allocate qdws after virgl_init_context to avoid leak.

Fix defect reported by Coverity Scan.

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

Fixes: 9a7d6a110e2 ("virgl/drm: explicit context initialization")
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13609>

2 years agomicrosoft/spirv_to_dxil: Fix non-Windows build.
Vinson Lee [Wed, 10 Nov 2021 05:25:52 +0000 (21:25 -0800)]
microsoft/spirv_to_dxil: Fix non-Windows build.

../src/microsoft/spirv_to_dxil/dxil_validation.cpp: In function ‘bool validate_dxil(dxil_spirv_object*)’:
../src/microsoft/spirv_to_dxil/dxil_validation.cpp:129:12: error: ‘stderr’ was not declared in this scope
  129 |    fprintf(stderr, "DXIL validation only available in Windows.\n");
      |            ^~~~~~

Fixes: 37c366e2830 ("microsoft/spirv_to_dxil: Add DXIL validation to spirv2dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13736>

2 years agofreedreno/a6xx: Inline remaining fd6_tex_const_0() call.
Emma Anholt [Tue, 9 Nov 2021 22:32:49 +0000 (14:32 -0800)]
freedreno/a6xx: Inline remaining fd6_tex_const_0() call.

Less indirection and fixups for figuring out what's going on.

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

2 years agofreedreno/a6xx: Drop an unused tile_mode arg.
Emma Anholt [Tue, 9 Nov 2021 22:36:51 +0000 (14:36 -0800)]
freedreno/a6xx: Drop an unused tile_mode arg.

I added this in ebaeddcbb3e9 ("freedreno/a6xx: Rewrite the format table
format/swap helpers.")  but it had already become unused through some
bugfixing.

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

2 years agofreedreno/a6xx: Clean up sysmem fb read patching using fd6_view.
Emma Anholt [Tue, 9 Nov 2021 22:10:36 +0000 (14:10 -0800)]
freedreno/a6xx: Clean up sysmem fb read patching using fd6_view.

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

2 years agofreedreno/a6xx: Use fd6_view for non-buffer image descriptors, too.
Emma Anholt [Mon, 18 Oct 2021 22:18:14 +0000 (15:18 -0700)]
freedreno/a6xx: Use fd6_view for non-buffer image descriptors, too.

This deletes a whole lot of code, but there's a modest drawoverhead perf
loss:

drawoverhead 1-image change -6.48856% +/- 4.28269% (n=50)
drawoverhead 8-image change -5.29195% +/- 2.62549% (n=90)

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

2 years agofreedreno/a6xx: Switch to relying on fd6_view for our texture descriptors.
Emma Anholt [Mon, 18 Oct 2021 21:24:40 +0000 (14:24 -0700)]
freedreno/a6xx: Switch to relying on fd6_view for our texture descriptors.

Having checked the deltas between fdl6_view and what we did before, switch
over to fdl6_view now.

No statistically significant difference on no-hw drawoverhead 8-texture
change (n=50) with the texture cache disabled from this and the previous
commit.

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

2 years agofreedreno/a6xx: Create a fd6_view at sampler view update time.
Emma Anholt [Mon, 18 Oct 2021 17:15:04 +0000 (10:15 -0700)]
freedreno/a6xx: Create a fd6_view at sampler view update time.

The goal is to share the same code as turnip for descriptor setup. This
just calls it and cross-checks.

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

2 years agofreedreno: Set layer_first on (2D) resource imports.
Emma Anholt [Mon, 18 Oct 2021 19:47:59 +0000 (12:47 -0700)]
freedreno: Set layer_first on (2D) resource imports.

Prevents getting a weird layer stride if you ask for it.

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

2 years agofreedreno/fdl6: Skip redundant setting of TILE_ALL for NV12.
Emma Anholt [Mon, 18 Oct 2021 19:58:56 +0000 (12:58 -0700)]
freedreno/fdl6: Skip redundant setting of TILE_ALL for NV12.

We already respect the tile_all flag above, and it should be set in tu.
Fixes a mismatch between fdl6_view_init() and gallium.

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

2 years agoutil/format: Add G8_B8R8_420_UNORM to match Vulkan.
Emma Anholt [Wed, 20 Oct 2021 22:52:23 +0000 (15:52 -0700)]
util/format: Add G8_B8R8_420_UNORM to match Vulkan.

turnip was playing fast and loose with the name, using the R8_G8B8 format
name but actually setting the descriptors up to read G8_B8R8 like Vulkan
(sensibly) wants.  This caused trouble when trying to make freedreno and
turnip share code.  By having both orderings as format names, we can share
the descriptor code and also confuse readers less.

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

2 years agoutil: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.
Emma Anholt [Wed, 20 Oct 2021 22:34:03 +0000 (15:34 -0700)]
util: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.

The only user, turnip, was actually treating it as this layout, matching
vulkan's specification of how the planes map to RGB values.  (Y=G means
that Cb=B and Cr=R).

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

2 years agoutil/ra: Fix deserialization of register sets
Caio Oliveira [Tue, 9 Nov 2021 23:15:15 +0000 (15:15 -0800)]
util/ra: Fix deserialization of register sets

Set ra_class::regset and ra_class::index  when deserializing.

Fixes: 95d41a3525d ("ra: Use struct ra_class in the public API.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>

2 years agoutil/ra: Add simple test for register set serialization
Caio Oliveira [Tue, 9 Nov 2021 23:13:39 +0000 (15:13 -0800)]
util/ra: Add simple test for register set serialization

Marked as DISABLED since it currently fails.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>

2 years agodocs: update calendar for 21.3.0-rc5
Eric Engestrom [Wed, 10 Nov 2021 22:10:41 +0000 (22:10 +0000)]
docs: update calendar for 21.3.0-rc5

Add another release candidate as we're not ready for 21.3.0 final just yet.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13744>

2 years agoci/bare-metal: Close serial and join serial threads before exit.
Emma Anholt [Thu, 21 Oct 2021 00:16:54 +0000 (17:16 -0700)]
ci/bare-metal: Close serial and join serial threads before exit.

This should fix the intermittent (~1/week) cheza failure where python
complains that a thread tried to do stdio while the main thread has
exited.

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

2 years agoci/etnaviv: Add more texturing flakes.
Emma Anholt [Tue, 9 Nov 2021 21:28:30 +0000 (13:28 -0800)]
ci/etnaviv: Add more texturing flakes.

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

2 years agoci/etnaviv: Mark the rest of uniform_api.random as flaky.
Emma Anholt [Tue, 9 Nov 2021 01:04:32 +0000 (17:04 -0800)]
ci/etnaviv: Mark the rest of uniform_api.random as flaky.

Another 3 new flakes happened on my last run.

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

2 years agomesa/main: Fix use of alloca() without #include "c99_alloca.h"
Jesse Natalie [Wed, 10 Nov 2021 01:36:50 +0000 (17:36 -0800)]
mesa/main: Fix use of alloca() without #include "c99_alloca.h"

Fixes: c216f193 ("mesa: use alloca in search_resource_hash")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13735>

2 years agofreedreno: Fix constant-index assumptions in IBO loads.
Emma Anholt [Fri, 29 Oct 2021 20:41:16 +0000 (13:41 -0700)]
freedreno: Fix constant-index assumptions in IBO loads.

The encoder already sets up our IBO accesses as potentially nonuniform, so
we just need to be careful to not try to force the IBO index into an
immediate.

Fixes assertion failures in piglit arb_shader_image_load_store-invalid
(intermittent due to
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/597), which
had some interesting actual failures hidden behind it.

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

2 years agofreedreno: Fix the uniform/nonuniform handling for cat5 bindful modes.
Emma Anholt [Fri, 29 Oct 2021 22:00:10 +0000 (15:00 -0700)]
freedreno: Fix the uniform/nonuniform handling for cat5 bindful modes.

We can see from the dynamically_uniform (compiler doesn't know if you're
uniform or not) vs uniform (compiler can see it's uniform) case in the
blob which is which.  Now that we have the right names, also use the
nonunif flag for encoding the actual non-uniform mode (previously, we were
always setting it always in a way that meant uniform).

I verified this behavior back to a418 with samplers.  The a3xx blob I have
only does GLES3, so we don't have the opaque_type_indexing tests to see.

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

2 years agoanv: don't forget to add scratch buffer to BO list
Lionel Landwerlin [Wed, 27 Oct 2021 10:06:07 +0000 (13:06 +0300)]
anv: don't forget to add scratch buffer to BO list

We reference the scratch BO using a bindless index in the command
streamer instructions, but we forgot to add them to the BO list.

v2: Make use of pipeline reloc list (Jason)

v3: Don't add NULL BOs to the reloc list (Lionel)

v4: Don't add BOs twice to reloc list when dealing with addresses
    (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: eeeea5cb873b40 ("anv: Add support for scratch on XeHP")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13544>

2 years agoaco: Work around MSVC restrict in c99_compat.h
James Park [Sun, 24 Oct 2021 01:02:48 +0000 (18:02 -0700)]
aco: Work around MSVC restrict in c99_compat.h

Future LLVM header leads to __declspec(__restrict), which is invalid.
Just undefine the restrict macro to keep __declspec(restrict).

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13505>

2 years agowsi/x11: support depth 30 visuals
Niklas Haas [Sun, 7 Mar 2021 12:38:01 +0000 (13:38 +0100)]
wsi/x11: support depth 30 visuals

There's only really one format that makes sense here, since there's no
sRGB equivalent for 10-bit packed formats.

It's possible that this results in flipped colors, if 10-bit visuals
exist that have the channels in the opposite order. (They don't seem to,
on my end)

Perhaps a more principled solution would also compare the exact r/g/b
bitmasks. But for now, this works.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3537
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9450>

2 years agovulkan/wsi: Unlock before return on error path.
Vinson Lee [Sat, 6 Nov 2021 22:56:21 +0000 (15:56 -0700)]
vulkan/wsi: Unlock before return on error path.

Fix defect reported by Coverity Scan.

Missing unlock (LOCK)
missing_unlock: Returning without unlocking wsi->wait_mutex.

Fixes: 4885e63a6d2 ("vulkan/wsi: implement missing wsi_register_device_event")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13698>

2 years agov3dv,v3d: don't store swizzle pointer in shader/pipeline keys
Iago Toral Quiroga [Wed, 10 Nov 2021 10:26:06 +0000 (11:26 +0100)]
v3dv,v3d: don't store swizzle pointer in shader/pipeline keys

We had been storing pointers to a driver owned swizzle table
rather than storing the actual swizzle value in various shader
and pipeline keys on both GL and Vulkan drivers.

This doesn't look very robust, particularly since we also
compute sha1 hashes from these values and we may store these
hashes to disk (for the disk cache).

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

2 years agovulkan, radv: Support backslash in ICD paths
James Park [Wed, 20 Oct 2021 21:42:32 +0000 (14:42 -0700)]
vulkan, radv: Support backslash in ICD paths

Vulkan loader wants backslash for paths on Windows. Need to jump through
hoops because Meson does not support backslashes in commands.

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

2 years agoradv/sqtt: fix GPU hangs when capturing from the compute queue
Samuel Pitoiset [Fri, 5 Nov 2021 19:18:42 +0000 (20:18 +0100)]
radv/sqtt: fix GPU hangs when capturing from the compute queue

S_008D20_FINISH_DONE is a mask of queues and 1 means "wait on the gfx
queue until the value is not 0" which can never happen when the driver
captures from compute. Instead, use the full mask of possible queues.

Cc: 21.3 mesa-stable
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/13694>

2 years agozink: update gfx pipeline shader module pointer even if the program is unchanged
Mike Blumenkrantz [Wed, 10 Nov 2021 00:44:48 +0000 (19:44 -0500)]
zink: update gfx pipeline shader module pointer even if the program is unchanged

this is used for pipeline comparisons, so it has to always be accurate

cc: mesa-stable

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

2 years agozink: be more consistent about applying module hash for gfx pipeline
Mike Blumenkrantz [Wed, 10 Nov 2021 00:42:16 +0000 (19:42 -0500)]
zink: be more consistent about applying module hash for gfx pipeline

this was a little spaghetti-ish: the module hash was sometimes being applied
during module update, sometimes in draw during program create, and then also
it was removed when a shader unbind would cause the program to no longer be reachable

now things are more consistent:
* keep removing module hash when program becomes unreachable
* only apply module hash in draw during updates there

cc: mesa-stable

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

2 years agozink: ci updates
Mike Blumenkrantz [Tue, 9 Nov 2021 21:35:28 +0000 (16:35 -0500)]
zink: ci updates

these don't spend forever in llvmpipe optimization passes anymore

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

2 years agozink: always inline uniforms when running on a cpu driver
Mike Blumenkrantz [Tue, 9 Nov 2021 15:44:45 +0000 (10:44 -0500)]
zink: always inline uniforms when running on a cpu driver

the overhead from creating new inlined shader variants is likely to be less than
the time required to fully optimize and run those variants, so just
inline 100% of the time to cut down shader runs

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

2 years agozink: implement cs uniform inlining
Mike Blumenkrantz [Tue, 9 Nov 2021 15:07:49 +0000 (10:07 -0500)]
zink: implement cs uniform inlining

this implements shader variants for compute

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

2 years agozink: radv ci updates for 1dshadow stuff
Mike Blumenkrantz [Tue, 9 Nov 2021 18:44:22 +0000 (13:44 -0500)]
zink: radv ci updates for 1dshadow stuff

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

2 years agozink: add 1DShadow sampler handling for drivers (radv) that don't support it
Mike Blumenkrantz [Thu, 28 Oct 2021 19:17:11 +0000 (15:17 -0400)]
zink: add 1DShadow sampler handling for drivers (radv) that don't support it

some drivers won't create zs textures in any shape but 2D. this can be
handled instead by using 2D textures and then performing shader rewrites to
convert shadow samplers for 1D and 1DArray types to 2D/array

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

2 years agoutil/xmlconfig: Allow DT_UNKNOWN files
Ryan Houdek [Sat, 6 Nov 2021 06:41:39 +0000 (23:41 -0700)]
util/xmlconfig: Allow DT_UNKNOWN files

Some filesystems don't fill in d_type in dirent. Resulting in
DT_UNKNOWN. Pass this entry through to the next step and use stat on the
full filepath to determine if it is a file.

sshfs is known to not fill d_type.
This resolves an issue where driconf living on an sshfs path wasn't
working.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13697>

2 years agoanv: Also disallow CCS_E for multi-LOD images
Jason Ekstrand [Tue, 26 Oct 2021 18:17:16 +0000 (13:17 -0500)]
anv: Also disallow CCS_E for multi-LOD images

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4616
Fixes: e3101c96bb64 ("anv/image: Disable multi-layer CCS_E on TGL+")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13680>

2 years agozink: add another compiler pass to convert 64bit vertex attribs
Mike Blumenkrantz [Mon, 25 Oct 2021 16:22:11 +0000 (12:22 -0400)]
zink: add another compiler pass to convert 64bit vertex attribs

gallium always provides uint types, so rewrite the shader to load a 64bit
attrib and then cast back to whatever it was before

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

2 years agozink: simplify 64bit vertex attrib lowering
Mike Blumenkrantz [Mon, 25 Oct 2021 15:29:06 +0000 (11:29 -0400)]
zink: simplify 64bit vertex attrib lowering

this was a cool myfirstcompilerpass.exe but there's easier ways to do
things like this

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

2 years agozink: declare int/float size caps inline with type usage
Mike Blumenkrantz [Mon, 25 Oct 2021 15:06:19 +0000 (11:06 -0400)]
zink: declare int/float size caps inline with type usage

this is much more accurate than trying to use shader info

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

2 years agoci: Add RADV to Android CI.
Bas Nieuwenhuizen [Wed, 15 Sep 2021 19:20:47 +0000 (21:20 +0200)]
ci: Add RADV to Android CI.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoutil: Add support for clang::fallthrough.
Bas Nieuwenhuizen [Tue, 9 Nov 2021 10:57:28 +0000 (11:57 +0100)]
util: Add support for clang::fallthrough.

Looks like the __attribute__ version doesn't work for C++ in the
Android build. Only found now because we don't enable
-Wimplicit-fallthrough by default project wide for C++. Only
ACO enables it.

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

2 years agoamd/addrlib: Ignore self-assign warnings.
Bas Nieuwenhuizen [Tue, 9 Nov 2021 10:35:39 +0000 (11:35 +0100)]
amd/addrlib: Ignore self-assign warnings.

There was a preference to not fix addrlib to make syncing with
upstream easier.

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

2 years agomeson: Check arguments before adding.
Bas Nieuwenhuizen [Mon, 25 Oct 2021 22:27:53 +0000 (00:27 +0200)]
meson: Check arguments before adding.

-static-libstdc++ doesn't exist on the Android NDK, casuing all
later has_argument calls to return false even though the compiler
supports that argument.

Fixes: 3aee462781a "meson: add windows compiler checks and libraries"
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoaco: Remove useless sub-expr.
Bas Nieuwenhuizen [Mon, 25 Oct 2021 21:46:12 +0000 (23:46 +0200)]
aco: Remove useless sub-expr.

../src/amd/compiler/aco_instruction_selection.cpp:11915:83: error: expression result unused [-Werror,-Wunused-value]
      bld.vop2(aco_opcode::v_lshrrev_b32, fetch_index_def, div_info, instance_id).instr;

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