platform/upstream/mesa.git
17 months agodzn: When changing root signature, dirty descriptors too
Jesse Natalie [Thu, 5 Jan 2023 17:22:21 +0000 (09:22 -0800)]
dzn: When changing root signature, dirty descriptors too

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

17 months agodzn: Support alpha blend factor
Jesse Natalie [Wed, 4 Jan 2023 21:22:18 +0000 (13:22 -0800)]
dzn: Support alpha blend factor

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

17 months agodzn: Get options13
Jesse Natalie [Wed, 4 Jan 2023 21:22:10 +0000 (13:22 -0800)]
dzn: Get options13

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

17 months agospirv2dxil: Replace not-provided inputs with zero instead of undef
Jesse Natalie [Thu, 5 Jan 2023 19:30:33 +0000 (11:30 -0800)]
spirv2dxil: Replace not-provided inputs with zero instead of undef

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

17 months agospirv2dxil: Allow killing position as an undef varying
Jesse Natalie [Thu, 5 Jan 2023 19:30:29 +0000 (11:30 -0800)]
spirv2dxil: Allow killing position as an undef varying

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

17 months agospirv2dxil: When removing unused inputs, make sure they're actually inputs
Jesse Natalie [Thu, 5 Jan 2023 17:38:17 +0000 (09:38 -0800)]
spirv2dxil: When removing unused inputs, make sure they're actually inputs

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

17 months agospirv2dxil: For removing unused vars, consider the whole I/O var size
Jesse Natalie [Thu, 5 Jan 2023 00:01:49 +0000 (16:01 -0800)]
spirv2dxil: For removing unused vars, consider the whole I/O var size

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

17 months agomicrosoft/compiler: Set num_components to 4 when updating pos write instructions
Jesse Natalie [Thu, 5 Jan 2023 19:02:57 +0000 (11:02 -0800)]
microsoft/compiler: Set num_components to 4 when updating pos write instructions

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

17 months agomicrosoft/compiler: Use nir info.fs.uses_sample_shading to force sample-rate
Jesse Natalie [Thu, 5 Jan 2023 18:36:27 +0000 (10:36 -0800)]
microsoft/compiler: Use nir info.fs.uses_sample_shading to force sample-rate

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

17 months agomicrosoft/compiler: Re-work the logic for adding SV_SampleIndex to force sample-rate
Jesse Natalie [Thu, 5 Jan 2023 18:19:29 +0000 (10:19 -0800)]
microsoft/compiler: Re-work the logic for adding SV_SampleIndex to force sample-rate

Only add SV_SampleIndex if there exists a sample-rate var that has either flat
interpolation or centroid (and therefore can't force sample rate implicitly),
unless there is also a sample-rate var that doesn't have those properties.

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

17 months agomicrosoft/compiler: Always emit float types in the I/O signature for structs
Jesse Natalie [Thu, 5 Jan 2023 00:01:12 +0000 (16:01 -0800)]
microsoft/compiler: Always emit float types in the I/O signature for structs

There's VK tests that have mismatching interpolation specifiers between FS
and the previous stage. For structs, that resulted in different types, which
breaks DXIL validation.

We could link the shaders and have that overwrite the interpolation field from
the previous shader, but we could also just not care and always use float.
I don't see any regressions from that.

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

17 months agomicrosoft/compiler: Remove arrays when testing for structs in I/O
Jesse Natalie [Thu, 5 Jan 2023 00:00:44 +0000 (16:00 -0800)]
microsoft/compiler: Remove arrays when testing for structs in I/O

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

17 months agomicrosoft/compiler: Implement texture sample count query
Jesse Natalie [Wed, 4 Jan 2023 23:06:54 +0000 (15:06 -0800)]
microsoft/compiler: Implement texture sample count query

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

17 months agomicrosoft/compiler: Lower pack_[u/s]norm_2x16
Jesse Natalie [Wed, 4 Jan 2023 22:52:35 +0000 (14:52 -0800)]
microsoft/compiler: Lower pack_[u/s]norm_2x16

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

17 months agovirgl/vtest: allow socket being specified by env variable
Simon Fels [Thu, 29 Sep 2022 09:32:44 +0000 (11:32 +0200)]
virgl/vtest: allow socket being specified by env variable

Signed-off-by: Simon Fels <simon.fels@canonical.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20736>

17 months agovenus: allow vtest socket being specified by env variable
Simon Fels [Thu, 29 Sep 2022 09:33:37 +0000 (11:33 +0200)]
venus: allow vtest socket being specified by env variable

Signed-off-by: Simon Fels <simon.fels@canonical.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20736>

17 months agohasvk: Add extra memory types for hasvk driver instead of a single one
Illia Polishchuk [Mon, 16 Jan 2023 07:36:36 +0000 (09:36 +0200)]
hasvk: Add extra memory types for hasvk driver instead of a single one

Replicates a fix from Anv.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7360
Tested-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20720>

17 months agoANV: Add extra memory types for ANV driver instead of a single one
Illia Polishchuk [Fri, 13 Jan 2023 18:54:44 +0000 (20:54 +0200)]
ANV: Add extra memory types for ANV driver instead of a single one

Some game engines can't handle single type well
And Intel on Windows uses 3 types so it's better to add extra one here

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7360
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20693>

17 months agoci: bump vk cts to 1.3.3.1 + and a crash fix.
Dave Airlie [Wed, 11 Jan 2023 01:02:26 +0000 (11:02 +1000)]
ci: bump vk cts to 1.3.3.1 + and a crash fix.

With the video changes some crashes were introduced in CTS,
apply the fix.

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

17 months agogallium/auxiliary/vl: clean-up progressive shader
Thong Thai [Mon, 16 Jan 2023 16:05:14 +0000 (11:05 -0500)]
gallium/auxiliary/vl: clean-up progressive shader

Add the progressive shader to the vl_compositor_cs_cleanup_shaders
function.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8086
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8088
Tested-by: Mark Herbert <mark.herbert42@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20730>

17 months agopan/mdg: Remove MSGS debug
Alyssa Rosenzweig [Thu, 27 Oct 2022 02:51:06 +0000 (22:51 -0400)]
pan/mdg: Remove MSGS debug

These should all be unreachable and what's left is dead-code.

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

17 months agopan/mdg: Scalarize LUT instructions in NIR
Alyssa Rosenzweig [Thu, 27 Oct 2022 02:43:32 +0000 (22:43 -0400)]
pan/mdg: Scalarize LUT instructions in NIR

Simpler. Small shaderdb regressions from using IR registers instead of
SSA, but that's probably what we needed for correctness (given that SSA
is violated otherwise) hence the Cc.

total instructions in shared programs: 1520220 -> 1518127 (-0.14%)
instructions in affected programs: 167437 -> 165344 (-1.25%)
helped: 662
HURT: 206
helped stats (abs) min: 1.0 max: 46.0 x̄: 3.65 x̃: 2
helped stats (rel) min: 0.18% max: 22.22% x̄: 2.43% x̃: 1.71%
HURT stats (abs)   min: 1.0 max: 7.0 x̄: 1.56 x̃: 1
HURT stats (rel)   min: 0.17% max: 8.33% x̄: 2.66% x̃: 2.33%
95% mean confidence interval for instructions value: -2.65 -2.18
95% mean confidence interval for instructions %-change: -1.45% -0.99%
Instructions are helped.

total bundles in shared programs: 649844 -> 649345 (-0.08%)
bundles in affected programs: 59278 -> 58779 (-0.84%)
helped: 577
HURT: 249
helped stats (abs) min: 1.0 max: 39.0 x̄: 1.56 x̃: 1
helped stats (rel) min: 0.26% max: 30.00% x̄: 3.13% x̃: 2.19%
HURT stats (abs)   min: 1.0 max: 12.0 x̄: 1.61 x̃: 1
HURT stats (rel)   min: 0.58% max: 25.00% x̄: 5.25% x̃: 4.00%
95% mean confidence interval for bundles value: -0.78 -0.43
95% mean confidence interval for bundles %-change: -0.98% -0.23%
Bundles are helped.

total quadwords in shared programs: 1136767 -> 1134956 (-0.16%)
quadwords in affected programs: 141780 -> 139969 (-1.28%)
helped: 744
HURT: 311
helped stats (abs) min: 1.0 max: 9.0 x̄: 3.13 x̃: 2
helped stats (rel) min: 0.14% max: 26.67% x̄: 2.77% x̃: 2.13%
HURT stats (abs)   min: 1.0 max: 8.0 x̄: 1.68 x̃: 1
HURT stats (rel)   min: 0.35% max: 10.00% x̄: 3.17% x̃: 1.69%
95% mean confidence interval for quadwords value: -1.89 -1.54
95% mean confidence interval for quadwords %-change: -1.27% -0.77%
Quadwords are helped.

total registers in shared programs: 90461 -> 90273 (-0.21%)
registers in affected programs: 2833 -> 2645 (-6.64%)
helped: 250
HURT: 82
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.08 x̃: 1
helped stats (rel) min: 6.67% max: 33.33% x̄: 14.06% x̃: 12.50%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 6.67% max: 50.00% x̄: 13.90% x̃: 12.50%
95% mean confidence interval for registers value: -0.67 -0.47
95% mean confidence interval for registers %-change: -8.62% -5.69%
Registers are helped.

total threads in shared programs: 55685 -> 55686 (<.01%)
threads in affected programs: 76 -> 77 (1.32%)
helped: 20
HURT: 17
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.30 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.47 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -0.47 0.52
95% mean confidence interval for threads %-change: 5.81% 56.35%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 1387 -> 1379 (-0.58%)
spills in affected programs: 283 -> 275 (-2.83%)
helped: 5
HURT: 1

total fills in shared programs: 5256 -> 5176 (-1.52%)
fills in affected programs: 557 -> 477 (-14.36%)
helped: 5
HURT: 1

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

17 months agopan/mdg: Use special NIR ops for trig scaling
Alyssa Rosenzweig [Fri, 13 Jan 2023 17:30:00 +0000 (12:30 -0500)]
pan/mdg: Use special NIR ops for trig scaling

Otherwise the lowering is fundamentally unsound due to incorrect constant
folding, even though it worked by chance with the old pass ordering. We're about
to change slightly the way we handle fsin/fcos, which was enough to trigger this
unsoundness.

shader-db results are mostly a toss-up.

total instructions in shared programs: 1520675 -> 1520220 (-0.03%)
instructions in affected programs: 96841 -> 96386 (-0.47%)
helped: 397
HURT: 3
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.15 x̃: 1
helped stats (rel) min: 0.22% max: 6.25% x̄: 1.15% x̃: 0.40%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.58% max: 2.08% x̄: 1.08% x̃: 0.58%
95% mean confidence interval for instructions value: -1.19 -1.08
95% mean confidence interval for instructions %-change: -1.26% -1.01%
Instructions are helped.

total bundles in shared programs: 650088 -> 649844 (-0.04%)
bundles in affected programs: 31132 -> 30888 (-0.78%)
helped: 229
HURT: 23
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.21 x̃: 1
helped stats (rel) min: 0.49% max: 7.14% x̄: 1.28% x̃: 0.71%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.48 x̃: 1
HURT stats (rel)   min: 0.83% max: 8.33% x̄: 2.38% x̃: 1.85%
95% mean confidence interval for bundles value: -1.08 -0.86
95% mean confidence interval for bundles %-change: -1.15% -0.74%
Bundles are helped.

total quadwords in shared programs: 1137388 -> 1136767 (-0.05%)
quadwords in affected programs: 71826 -> 71205 (-0.86%)
helped: 367
HURT: 17
helped stats (abs) min: 1.0 max: 8.0 x̄: 1.80 x̃: 1
helped stats (rel) min: 0.31% max: 17.24% x̄: 2.27% x̃: 0.96%
HURT stats (abs)   min: 1.0 max: 6.0 x̄: 2.29 x̃: 2
HURT stats (rel)   min: 0.44% max: 11.11% x̄: 2.18% x̃: 1.47%
95% mean confidence interval for quadwords value: -1.76 -1.47
95% mean confidence interval for quadwords %-change: -2.36% -1.78%
Quadwords are helped.

total registers in shared programs: 90483 -> 90461 (-0.02%)
registers in affected programs: 890 -> 868 (-2.47%)
helped: 67
HURT: 44
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 8.33% max: 25.00% x̄: 10.52% x̃: 9.09%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.02 x̃: 1
HURT stats (rel)   min: 9.09% max: 50.00% x̄: 31.15% x̃: 33.33%
95% mean confidence interval for registers value: -0.39 -0.01
95% mean confidence interval for registers %-change: 1.75% 10.25%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total threads in shared programs: 55694 -> 55685 (-0.02%)
threads in affected programs: 21 -> 12 (-42.86%)
helped: 1
HURT: 5
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -2.79 -0.21
95% mean confidence interval for threads %-change: -89.26% 39.26%
Inconclusive result (%-change mean confidence interval includes 0).

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

17 months agonir: Optimize vendored sin/cos the same way
Alyssa Rosenzweig [Fri, 13 Jan 2023 17:33:24 +0000 (12:33 -0500)]
nir: Optimize vendored sin/cos the same way

As we've done for the AMD one, to prevent any codegen regression from switching
the Midgard lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>

17 months agonir: Add Midgard-specific fsin/fcos ops
Alyssa Rosenzweig [Fri, 13 Jan 2023 17:29:14 +0000 (12:29 -0500)]
nir: Add Midgard-specific fsin/fcos ops

NIR has a fsin instruction that takes an argument in radians. Midgard instead
has an fsinpi argument that takes an argument in multiples of pi. So, we had a
NIR pass that would change fsin(x) to fsin(x / pi) and then map fsin to fsinpi
in the backend.

But that's invalid! In NIR, the opcode fsin is well-defined. fsin(x) means
something very different than fsin(x / pi). They won't usually be equal. The
transform fsin(x) -> fsin(x / pi) is fundamentally unsound.

It did work before, by accident. Most NIR passes don't care about the semantics
of ALU instructions.  fsin(x) and fsin(x / pi) are both well-defined but
fundamentally different NIR shaders. So while rewriting is wrong -- the NIR we
get out is not equivalent to the NIR we put in, and the Midgard ops we generate
are not equivalent to the NIR -- but if we don't run any passes that care about
the definition of fsin the two wrongs will cancel out to make a right.

However, some NIR passes do care about the definitions of ALU instructions,
instead of treating them as named black boxes. In particular, constant folding
(nir_opt_constant_fold) evaluates ALU instructions when their inputs are
constants, according to the definition in nir_opcodes.py. So our little charade
will only work if we don't call nir_opt_constant_fold, or if all the fsin
instructions have non-constant inputs. At the beginning of this series, that is
the case. With the later scalarization change, that's no longer the case, and
the unsoundness translates to real failing tests rather than a quibble of NIR's
semantics.

To mitigate, we define a new NIR opcode with the semantics we want and translate
fsin(x) = fsin_mdg(x / pi), where that equivalence does hold mathematically. So
the new translation is sound and doesn't rely on lucky pass ordering.

This matches the approach already used for AMD and AGX, which have fsin_amd and
fsin_agx opcodes respectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>

17 months agor300: remove backend input range transformation for sin and cos
Pavel Ondračka [Wed, 5 Oct 2022 19:22:05 +0000 (21:22 +0200)]
r300: remove backend input range transformation for sin and cos

We already do this in NIR since a04aa4bc08df2c3772fc7dda6766f76ef3a5dfb4
and 3f97306b956f707d637da6b76dd9465fcabfc451 so there is no effect
for the mesa state tracker now that it can not emit TGSI any more.
This leaves only nine when RADEON_DEBUG=use_tgsi is set. D3D9 however
requires that sin and cos inputs already have the proper range.

This is super important when the nine shader uses relative adressing
and therefore needs all 256 constants we have. If we add our extra
constants for the fixup, we get over the limit and fail compilation.

v2: vertex shaders only

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18933>

17 months agor300: skip sin/cos input range transformation for nine and ntt
Pavel Ondračka [Mon, 16 Jan 2023 09:48:42 +0000 (10:48 +0100)]
r300: skip sin/cos input range transformation for nine and ntt

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18933>

17 months agor300: update rv515 ci failures list
Pavel Ondračka [Thu, 12 Jan 2023 10:21:11 +0000 (11:21 +0100)]
r300: update rv515 ci failures list

This fix missed in 421bf657bf33200b1aa97d7ae887971e561ef556 where it was
updated only for R480.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20666>

17 months agoaco/optimizer: Optimize p_extract + v_mul_u32_u24 to v_mad_u32_u16.
Timur Kristóf [Sat, 6 Aug 2022 07:40:44 +0000 (09:40 +0200)]
aco/optimizer: Optimize p_extract + v_mul_u32_u24 to v_mad_u32_u16.

This should perform the same but removes SDWA from the address
calculations in NGG culling shaders for example.

This is done because SDWA is no longer available on GFX11.

Fossil DB stats on GFX1100:
Totals from 36 (0.03% of 134913) affected shaders:
CodeSize: 300968 -> 300884 (-0.03%); split: -0.04%, +0.01%
Instrs: 60955 -> 60863 (-0.15%); split: -0.15%, +0.00%
Latency: 426809 -> 426819 (+0.00%); split: -0.06%, +0.06%
InvThroughput: 39076 -> 39025 (-0.13%); split: -0.14%, +0.01%
VClause: 1440 -> 1443 (+0.21%)
Copies: 5714 -> 5725 (+0.19%)

Fossil DB stats on GFX1100 with NGG culling enabled:
Totals from 60953 (45.18% of 134913) affected shaders:
VGPRs: 2273172 -> 2273160 (-0.00%)
CodeSize: 186401864 -> 186403036 (+0.00%); split: -0.00%, +0.00%
Instrs: 37038048 -> 36977353 (-0.16%); split: -0.16%, +0.00%
Latency: 146466770 -> 146350172 (-0.08%); split: -0.08%, +0.00%
InvThroughput: 15342790 -> 15228585 (-0.74%); split: -0.74%, +0.00%
VClause: 669662 -> 669665 (+0.00%)
Copies: 2972380 -> 2972482 (+0.00%); split: -0.01%, +0.01%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17924>

17 months agoaco/optimizer: Add missing v_lshlrev condition to can_apply_extract.
Timur Kristóf [Mon, 9 Jan 2023 19:57:05 +0000 (20:57 +0100)]
aco/optimizer: Add missing v_lshlrev condition to can_apply_extract.

This was already handled by apply_extract but missing from
can_apply_extract, therefore may not be properly applied everywhere.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17924>

17 months agowsi/x11: Support depth 16 visuals
Adam Jackson [Wed, 11 Jan 2023 18:40:34 +0000 (13:40 -0500)]
wsi/x11: Support depth 16 visuals

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

17 months agowsi/x11: Infer the default surface format from the root window's visual
Adam Jackson [Fri, 13 Jan 2023 19:24:50 +0000 (14:24 -0500)]
wsi/x11: Infer the default surface format from the root window's visual

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

17 months agowsi/x11: Make get_sorted_vk_formats handle varying channel widths
Adam Jackson [Wed, 11 Jan 2023 18:37:11 +0000 (13:37 -0500)]
wsi/x11: Make get_sorted_vk_formats handle varying channel widths

Depths 24 and 30 happen to have uniform bpc but 16 does not. Pull the
real channel width out of the format description instead. This is still
a bit ignorant of channel order though.

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

17 months agoac/nir: use store_buffer_amd's base index
Rhys Perry [Tue, 13 Dec 2022 15:08:58 +0000 (15:08 +0000)]
ac/nir: use store_buffer_amd's base index

This allows ACO to combine the addition into the store without checking
for wraparound.

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

17 months agoaco: restore semantic_can_reorder for GS output stores
Rhys Perry [Mon, 5 Dec 2022 19:11:42 +0000 (19:11 +0000)]
aco: restore semantic_can_reorder for GS output stores

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

17 months agoradv,aco: use ac_nir_lower_legacy_gs
Rhys Perry [Mon, 5 Dec 2022 17:32:15 +0000 (17:32 +0000)]
radv,aco: use ac_nir_lower_legacy_gs

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

17 months agoradv: implement GS load_ring_gsvs_amd/load_ring_gs2vs_offset_amd
Rhys Perry [Mon, 5 Dec 2022 17:28:51 +0000 (17:28 +0000)]
radv: implement GS load_ring_gsvs_amd/load_ring_gs2vs_offset_amd

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

17 months agopanfrost: Document render_condition_check contract
Alyssa Rosenzweig [Fri, 13 Jan 2023 01:57:38 +0000 (20:57 -0500)]
panfrost: Document render_condition_check contract

This was implicit before, leading to the bug fixed in the previous commit.

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

17 months agopanfrost: Fix clears with conditional rendering
Alyssa Rosenzweig [Fri, 13 Jan 2023 01:56:23 +0000 (20:56 -0500)]
panfrost: Fix clears with conditional rendering

batch can be invalidated by the render condition check.

Fixes nv_conditional_render-clear.

Fixes: 638b22354e7 ("panfrost: Clear with a quad to avoid flushing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20689>

17 months agopanfrost: Remove unused debug parameter
Alyssa Rosenzweig [Sat, 14 Jan 2023 02:05:43 +0000 (21:05 -0500)]
panfrost: Remove unused debug parameter

We removed this path.

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

17 months agopanfrost: Remove PAN_MESA_DEBUG=deqp
Alyssa Rosenzweig [Sat, 14 Jan 2023 01:57:50 +0000 (20:57 -0500)]
panfrost: Remove PAN_MESA_DEBUG=deqp

Now unused.

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

17 months agopanfrost: Stop testing CAP_INT16
Alyssa Rosenzweig [Sat, 14 Jan 2023 01:56:57 +0000 (20:56 -0500)]
panfrost: Stop testing CAP_INT16

This doesn't look like it'll be fixed any time soon. No point running dEQP with
different flags than production, IMO.

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

17 months agoetnaviv: don't drop TS capability on GPUs with MMUv2
Lucas Stach [Fri, 6 Jan 2023 18:14:18 +0000 (19:14 +0100)]
etnaviv: don't drop TS capability on GPUs with MMUv2

Currently etnaviv disables TS on all MC1.0 GPUs, since the TS unit
doesn't properly take into account the linear window offset with
MC1.0, creating address aliases on MMUv1 that aren't properly dealt
with.

MMUv2 however doesn't have a linear window, so we can safely enable
TS on those GPUs.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20552>

17 months agoutil/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST
Juston Li [Mon, 24 Oct 2022 20:03:56 +0000 (20:03 +0000)]
util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST

Add a new environment varible
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMICE_LIST that specifies a text
file containing a list of RO fossilize caches to load. The list file
is modifiable at runtime to allow for loading RO caches after
initialization unlike MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The implementation spawns an updater thread that uses inotify to monitor
the list file for modifications, attempting to load new foz dbs added to
the list. Removing files from the list will not evict a loaded cache.

MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST takes an absolute path.
The file must exist at initialization for updating to occur.

File names of foz dbs in the list file are new-line separated and take
relative paths to the default cache directory like
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The maximum number of RO foz dbs is kept to 8 and is shared between
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST and
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The intended use case for this feature is to allow prebuilt caches
to be downloaded and loaded asynchronously during app runtime.
Prebuilt caches be large (several GB) and depending on network
conditions would otherwise present extended wait time for caches
to be availible before app launch.
This will be used in Chrome OS.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>

17 months agoutils/fossilize_db: refactor out loading RO foz dbs
Juston Li [Mon, 31 Oct 2022 18:55:22 +0000 (18:55 +0000)]
utils/fossilize_db: refactor out loading RO foz dbs

Move loading of RO foz dbs into its own load_ro_foz_dbs() function

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>

17 months agoutil/fossilize_db: don't destroy foz on RO load fail
Juston Li [Fri, 21 Oct 2022 20:01:31 +0000 (20:01 +0000)]
util/fossilize_db: don't destroy foz on RO load fail

When loading multiple RO foz dbs, if a db fails to load, continue trying
to load other RO foz dbs instead of destroying the foz cache.

Preserve destroying the foz cache and not preceding to load RO caches
if the RW cache fails to load.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>

17 months agodocs/envvars: add missing mesa disk cache envvars
Juston Li [Thu, 3 Nov 2022 18:12:23 +0000 (18:12 +0000)]
docs/envvars: add missing mesa disk cache envvars

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>

17 months agopanfrost: Fix logic ops on Bifrost
Alyssa Rosenzweig [Thu, 12 Jan 2023 22:34:44 +0000 (17:34 -0500)]
panfrost: Fix logic ops on Bifrost

opaque should not be set when logicops are enabled, that needs blending
even on Bifrost. Fixes is for when I believe the bug became possible to hit.
The logical error is older.

Fixes Piglit logicop tests again.

Fixes: d849d9779a7 ("panfrost: Avoid blend shader when not blending")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20685>

17 months agopanfrost: Enable NV_primitive_restart on Valhall
Alyssa Rosenzweig [Fri, 13 Jan 2023 21:35:48 +0000 (16:35 -0500)]
panfrost: Enable NV_primitive_restart on Valhall

Unlike literally every other mesa/st emulation, for some inexplicable reason we
need to pretend to support the CAP and then set a different EMULATE cap instead
of the emulation keying off the lack of support for the CAP. Set the CAPs
accordingly so we get NV_primitive_restart (with emulation of non-fixed
indices).

This gets Mesa to advertise GL 3.1 on Mali-G57 as intended.

Fixes: 30c14f54cf2 ("panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20702>

17 months agopan/bi: Add a unit test for fsat(reg.yx)
Alyssa Rosenzweig [Thu, 12 Jan 2023 21:55:28 +0000 (16:55 -0500)]
pan/bi: Add a unit test for fsat(reg.yx)

This would have caught the issue from the previous commit. Split out to make
backporting the previous change less onerous.

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

17 months agopan/bi: Fix incorrect compilation of fsat(reg.yx)
Alyssa Rosenzweig [Thu, 12 Jan 2023 21:50:31 +0000 (16:50 -0500)]
pan/bi: Fix incorrect compilation of fsat(reg.yx)

Future changes to nir_lower_blend cause fsat(reg.yx) instructions to be
generated, which correspond to "FCLAMP.v2f16 x.h10" pseudoinstructions. These
get their swizzles lowered, but we forgot to clear the swizzle out, so we end up
with extra swap (cancelling out the intended swizzle).

Fix the lowering logic.

Fixes: ac636f5adb5 ("pan/bi: Use FCLAMP pseudo op for clamp prop")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683>

17 months agobin/ci: add gitlab_gql.py.cache to the .gitignore
Eric Engestrom [Mon, 16 Jan 2023 10:00:09 +0000 (10:00 +0000)]
bin/ci: add gitlab_gql.py.cache to the .gitignore

On my machine, the filecache doesn't have the extra `.db` suffix, just `.cache`.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20722>

17 months agoradv/bvh: Prevent NANs when computing node cost
Friedrich Vock [Mon, 16 Jan 2023 10:14:44 +0000 (11:14 +0100)]
radv/bvh: Prevent NANs when computing node cost

Otherwise the degenerate geometry workaround never triggers, leading to bad performance.

Fixes: 6f45c98b ("radv/bvh: Adjust sah cost based on depth")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20723>

17 months agov3dv: skip two ycbcr tests
Alejandro Piñeiro [Thu, 12 Jan 2023 13:02:23 +0000 (14:02 +0100)]
v3dv: skip two ycbcr tests

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

17 months agov3dv: add support for multi-planar formats, enable YCbCr
Ella Stanforth [Thu, 28 Jul 2022 08:15:43 +0000 (08:15 +0000)]
v3dv: add support for multi-planar formats, enable YCbCr

Original patches wrote by Ella Stanforth.

Alejandro Piñeiro main changes (skipping the small fixes/typos):
  * Reduced the list of supported formats to
    VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
    VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, that are the two only
    mandatory by the spec.
  * Fix format features exposed with YCbCr:
    * Disallow some features not supported with YCbCr (like blitting)
    * Disallow storage image support. Not clear if really useful. Even
      if there are CTS tests, there is an ongoing discussion about the
      possibility to remove them.
    * Expose VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, that is
      mandatory for the formats supported.
    * Not expose VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT. Some
      CTS tests are failing right now, and it is not mandatory. Likely
      to be revisit later.
    * We are keeping VK_FORMAT_FEATURE_2_DISJOINT_BIT and
      VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT. Even if they
      are optional, it is working with the two formats that we are
      exposing. Likely that will need to be refined if we start to
      expose more formats.
  * create_image_view: don't use hardcoded 0x70, but instead doing an
    explicit bit or of VK_IMAGE_ASPECT_PLANE_0/1/2_BIT
  * image_format_plane_features: keep how supported aspects and
    separate stencil check is done. Even if the change introduced was
    correct (not sure about that though), that change is unrelated to
    this work
  * write_image_descriptor: add additional checks for descriptor type,
    to compute properly the offset.
  * Cosmetic changes (don't use // for comments, capital letters, etc)
  * Main changes coming from the review:
     * Not use image aliases. All the info is already on the image
       planes, and some points of the code were confusing as it was
       using always a hardcoded plane 0.
     * Squashed the two original main patches. YCbCr conversion was
       leaking on the multi-planar support, as some support needed
       info coming from the ycbcr structs.
     * Not expose the extension on Android, and explicitly assert that
       we expect plane_count to be 1 always.
  * For a full list of review changes  see MR#19950

Signed-off-by: Ella Stanforth <estanforth@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>

17 months agov3dv/image: use 64-byte alingment for linear images if needed
Alejandro Piñeiro [Thu, 12 Jan 2023 10:14:46 +0000 (11:14 +0100)]
v3dv/image: use 64-byte alingment for linear images if needed

When used for transfer, the image could be used eventually as a
Texture Base Address, that needs to be 64-byte aligned.

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

17 months agov3dv: pass alignment to v3dv_buffer_init
Alejandro Piñeiro [Wed, 11 Jan 2023 13:04:26 +0000 (14:04 +0100)]
v3dv: pass alignment to v3dv_buffer_init

Although for any buffer created by the user, or any API that can be
called by the user (like GetDeviceBufferMemoryRequirements) the
alignment is V3D_NON_COHERENT_ATOM_SIZE, there are internal uses of a
buffer that could require a fine-grained alignment (like when used as
a alias for a image, that has different alignment requirements).

Note that an alternative would have created a
v3dv_buffer_init_with_alignment (or similar name), but this option
seemed easier.

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

17 months agov3dv/pipeline: rename lower_tex_src_to_offset to lower_tex_src
Alejandro Piñeiro [Tue, 29 Nov 2022 22:51:04 +0000 (23:51 +0100)]
v3dv/pipeline: rename lower_tex_src_to_offset to lower_tex_src

Less confusing this way.

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

17 months agov3dv/format: remove unused v3dv_get_tex_return_size
Alejandro Piñeiro [Fri, 25 Nov 2022 10:58:15 +0000 (11:58 +0100)]
v3dv/format: remove unused v3dv_get_tex_return_size

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

17 months agov3dv: add paths to handle partial copies of linear images
Iago Toral Quiroga [Tue, 6 Sep 2022 07:34:46 +0000 (09:34 +0200)]
v3dv: add paths to handle partial copies of linear images

v2:
   * Removed unneeded copy_image_linear_buffer
   * Add tiling/image-type check on copy_image_blit

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

17 months agoanv,nir: Move the ANV YCbCr lowering pass to common code
Jason Ekstrand [Wed, 31 Mar 2021 02:32:46 +0000 (21:32 -0500)]
anv,nir: Move the ANV YCbCr lowering pass to common code

Nir changes:
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Anv changes:

Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>

17 months agonir: Add copyright and include guards to nir_vulkan.h
Jason Ekstrand [Wed, 31 Mar 2021 02:32:21 +0000 (21:32 -0500)]
nir: Add copyright and include guards to nir_vulkan.h

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

17 months agoanv: Use the YCbCr format info from common code
Jason Ekstrand [Wed, 31 Mar 2021 04:44:25 +0000 (23:44 -0500)]
anv: Use the YCbCr format info from common code

We still maintain our own table of formats but all of the conversion and
sampling info we pull from common code.

Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>

17 months agoanv: Use the common vk_ycbcr_conversion object
Jason Ekstrand [Wed, 31 Mar 2021 04:18:41 +0000 (23:18 -0500)]
anv: Use the common vk_ycbcr_conversion object

Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>

17 months agovulkan: Add a common vk_ycbcr_conversion struct
Jason Ekstrand [Wed, 31 Mar 2021 02:28:31 +0000 (21:28 -0500)]
vulkan: Add a common vk_ycbcr_conversion struct

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

17 months agovulkan/formats: Add YCbCr format information
Jason Ekstrand [Wed, 31 Mar 2021 03:20:53 +0000 (22:20 -0500)]
vulkan/formats: Add YCbCr format information

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

17 months agoutil/format: YUYV and UYVY have 4 8-bit channels
Jason Ekstrand [Wed, 31 Mar 2021 14:43:00 +0000 (09:43 -0500)]
util/format: YUYV and UYVY have 4 8-bit channels

They're all packed and weird but this is more accurate than saying they
have a single x32 blob of data.

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

17 months agoanv/android: Use VkFormat for externalFormat
Jason Ekstrand [Wed, 31 Mar 2021 03:52:43 +0000 (22:52 -0500)]
anv/android: Use VkFormat for externalFormat

Using a pointer to an internal data structure works but it's a bit
sketchy.  Since every anv_format maps to a VkFormat, we may as well
just use the VkFormat.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>

17 months agoanv: Refactor Android externalFormat handling in CreateYcbcrConversion
Jason Ekstrand [Wed, 31 Mar 2021 03:45:59 +0000 (22:45 -0500)]
anv: Refactor Android externalFormat handling in CreateYcbcrConversion

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>

17 months agoRevert "ci: build hasvk if we're building anv"
Lionel Landwerlin [Mon, 16 Jan 2023 12:01:25 +0000 (14:01 +0200)]
Revert "ci: build hasvk if we're building anv"

This reverts commit b4d3d11e43546a92a82c66a47e3bda0e6a6822cf.

We're seeing problems on the builders running the hasvk tests.

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

17 months agovulkan/wsi: check if image info was already freed
Alejandro Piñeiro [Fri, 13 Jan 2023 12:42:26 +0000 (13:42 +0100)]
vulkan/wsi: check if image info was already freed

We set the different data being freed to NULL after freeing it, and
checks for NULL before freeing it.

This fixes several double free crash with v3dv, when running OOM wsi
tests, like for example:
dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha

Although note that only one person got those on a new fresh install of
the Raspbian OS, so this problem was rare.

Fixes: 5b13d74583513ddd029e ("vulkan/wsi/drm: Break create_native_image in pieces")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20695>

17 months agopvr: Add support for geometry-only render jobs
Matt Coster [Thu, 8 Dec 2022 14:50:07 +0000 (14:50 +0000)]
pvr: Add support for geometry-only render jobs

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20545>

17 months agopvr: Extract setup of winsys job submit flags into separate functions
Matt Coster [Mon, 5 Dec 2022 15:29:43 +0000 (15:29 +0000)]
pvr: Extract setup of winsys job submit flags into separate functions

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20545>

17 months agobroadcom/compiler: produce better code for f2f16 with RTZ rounding
Iago Toral Quiroga [Mon, 16 Jan 2023 08:04:10 +0000 (09:04 +0100)]
broadcom/compiler: produce better code for f2f16 with RTZ rounding

Suggested by Georg Lehmann, this generates far less code and should
be more correct.

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

17 months agoac: don't call ac_query_pci_bus_info from ac_query_gpu_info
Pierre-Eric Pelloux-Prayer [Thu, 12 Jan 2023 14:05:06 +0000 (15:05 +0100)]
ac: don't call ac_query_pci_bus_info from ac_query_gpu_info

Instead let each driver call it.

radeonsi ignores the error because it doesn't require correct
pci-bus info to work properly.

radv keeps the existing behavior and fails if the pci-bus infos
is missing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>

17 months agoac: add ac_query_pci_bus_info helper
Pierre-Eric Pelloux-Prayer [Thu, 12 Jan 2023 14:04:38 +0000 (15:04 +0100)]
ac: add ac_query_pci_bus_info helper

No functional changes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>

17 months agoac/info: move pci bus info in a struct
Pierre-Eric Pelloux-Prayer [Thu, 12 Jan 2023 14:02:40 +0000 (15:02 +0100)]
ac/info: move pci bus info in a struct

And add a validity flag because there's no way to
tell if they're valid, unless for the caller of
drmGetDevice2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>

17 months agoradeonsi: simplify dpbb settings
Pierre-Eric Pelloux-Prayer [Wed, 11 Jan 2023 14:45:11 +0000 (15:45 +0100)]
radeonsi: simplify dpbb settings

Use only 2 sets of parameters and add some debug variables
to ease tweaking them when testing.

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

18 months agofreedreno/ci: Switch also performance a630 job to manual
David Heidelberg [Sun, 15 Jan 2023 21:04:17 +0000 (22:04 +0100)]
freedreno/ci: Switch also performance a630 job to manual

Fixes: 0cc370133817 ("freedreno/ci: Switch a630 jobs over to manual")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20716>

18 months agoci/zink: Penumbra is now fixed.
David Heidelberg [Sun, 15 Jan 2023 22:58:02 +0000 (23:58 +0100)]
ci/zink: Penumbra is now fixed.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20718>

18 months agoradv: Fix memory leak.
Vinson Lee [Sun, 15 Jan 2023 01:33:47 +0000 (17:33 -0800)]
radv: Fix memory leak.

Fix defect reported by Coverity Scan.

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

Fixes: 8d0e6c02c70 ("radv: Add RMV tracing utilities")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20711>

18 months agoradv/rt: Divide by the correct workgroup size
Friedrich Vock [Sun, 15 Jan 2023 20:54:50 +0000 (21:54 +0100)]
radv/rt: Divide by the correct workgroup size

Improves build performance by around 25%.

Fixes: 9369b407 ("radv: Use PLOC for BVH building")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20717>

18 months agoglsl/nir: only set uses_sample_shading when the output is a fbfetch
Gert Wollny [Fri, 13 Jan 2023 09:53:16 +0000 (10:53 +0100)]
glsl/nir: only set uses_sample_shading when the output is a fbfetch

Constructs like

  out vec4 fs_out;
  ....
  fs_out = vec4(...);
  if (fs_out.w < alpha_test_value)
     discard;

lead to initial nir that reads from fs_out, even though we don't actually
do a framebuffer fetch, and later nir passes will eliminate that direct
read from the output variable. As given in the commit message of 1124bee4
we are actually only interested in the framebuffer fetch, so set the
property only when an output is used for fbfetch reads.

v2: Iterate over all variables (Jason)

Fixes: commit 1124bee4baba49466d84b2bf274017dbba6360a7
  glsl/nir: Set sample_shading if a FS output ever shows up as an rvalue

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

18 months agoradv/rt: Get rid of accel struct null checks
Konstantin Seurer [Thu, 5 Jan 2023 16:48:45 +0000 (17:48 +0100)]
radv/rt: Get rid of accel struct null checks

Quake II RTX ray queries:

Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 167220 -> 165560 (-0.99%)
Instrs: 31674 -> 31454 (-0.69%)
Latency: 385145 -> 596737 (+54.94%)
InvThroughput: 78837 -> 122005 (+54.76%)
Copies: 4740 -> 4667 (-1.54%); split: -1.60%, +0.06%
Branches: 1565 -> 1493 (-4.60%)
PreSGPRs: 488 -> 501 (+2.66%); split: -0.41%, +3.07%
PreVGPRs: 617 -> 620 (+0.49%)

Performance stays the same.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>

18 months agoradv: Use the null accel struct instead of emitting 0
Konstantin Seurer [Thu, 5 Jan 2023 16:40:37 +0000 (17:40 +0100)]
radv: Use the null accel struct instead of emitting 0

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>

18 months agoradv: Create a null TLAS as meta state
Konstantin Seurer [Thu, 5 Jan 2023 16:39:39 +0000 (17:39 +0100)]
radv: Create a null TLAS as meta state

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>

18 months agoradv: Add a helper for finding memory indices
Konstantin Seurer [Sun, 15 Jan 2023 16:18:55 +0000 (17:18 +0100)]
radv: Add a helper for finding memory indices

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>

18 months agovulkan: Track the nullDescriptor feature
Konstantin Seurer [Thu, 5 Jan 2023 16:42:23 +0000 (17:42 +0100)]
vulkan: Track the nullDescriptor feature

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>

18 months agofreedreno/ci: Add a618 egl/skqp/piglit jobs
Rob Clark [Sun, 15 Jan 2023 17:14:28 +0000 (09:14 -0800)]
freedreno/ci: Add a618 egl/skqp/piglit jobs

Clone the existing a630 jobs and expectations.  This should give us a6xx
coverage to make up for the offline a630 runners.

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

18 months agofreedreno/ci: Cleanup a618 yaml
Rob Clark [Sun, 15 Jan 2023 17:03:10 +0000 (09:03 -0800)]
freedreno/ci: Cleanup a618 yaml

De-duplicate GPU_VERSION/VK_DRIVER and add different jobs that can be
extended for limozeen vs kingoftown runners in order to de-duplicate the
DEVICE_TYPE/DTB/RUNNER_TAG variables.  This should simplify moving jobs
between runners to load-balance.

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

18 months agofreedreno/ci: Switch a630 jobs over to manual
Rob Clark [Sun, 15 Jan 2023 16:54:43 +0000 (08:54 -0800)]
freedreno/ci: Switch a630 jobs over to manual

The a630 runners are not responding atm, so switch the jobs to manual
for the time being.

Note the other fd-farm runners are responding fine, which is why I
didn't take the entire farm offline.

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

18 months agoetnaviv: nir: use lower_fround_even
Christian Gmeiner [Sat, 14 Jan 2023 20:26:18 +0000 (21:26 +0100)]
etnaviv: nir: use lower_fround_even

The generated asm is not as good as the one from the binary blob but
does its job.

Passes: dEQP-GLES3.functional.shaders.operator.common_functions.round*.*

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20709>

18 months agopanfrost: Don't use AFBC of sRGB luminance-alpha
Alyssa Rosenzweig [Thu, 12 Jan 2023 22:58:29 +0000 (17:58 -0500)]
panfrost: Don't use AFBC of sRGB luminance-alpha

This isn't allowed for the same reason that AFBC of regular luminance-alpha
isn't allowed (and will raise DATA_INVALID_FAULTs). Reorder the checks to
ensure these formats are checked.

Fixes Piglit texwrap GL_EXT_texture_sRGB-s3tc.

Fixes: 476be5cb273 ("panfrost: Don't use texture format swizzles on v7")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20686>

18 months agozink: add renderdoc handling
Mike Blumenkrantz [Thu, 4 Mar 2021 15:44:36 +0000 (10:44 -0500)]
zink: add renderdoc handling

renderdoc won't work with zink in frontends that aren't dri,
so ZINK_RENDERDOC should be used to specify start:end frames
to ensure that the vulkan command stream is captured

this is not a renderdoc issue: there are no frame boundaries in rusticl
or gallium-nine, so there is no possible way that renderdoc could
determine when/how to split frames

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

18 months agovenus: vn_queue: align vulkan object variable naming
Juston Li [Wed, 11 Jan 2023 19:56:43 +0000 (11:56 -0800)]
venus: vn_queue: align vulkan object variable naming

Per Yiwei:
"For vn_QueueSubmit and other exposed Vulkan entry points, we keep the
original Vulkan variable namings. If within the same function you need
to use struct vn_queue *queue, then we prefix a _ to the args in the
exposed entry points, so it becomes VkQueue _queue.

For all other places:

VkObject obj_handle
struct vn_object *obj

The obj in this file can be queue, fence, sem, event, cmd, dev, etc."

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>

18 months agovenus: refactor QueueSubmit/QueueSubmit2
Juston Li [Wed, 21 Dec 2022 17:33:57 +0000 (09:33 -0800)]
venus: refactor QueueSubmit/QueueSubmit2

Refactor the QueueSubmit functions to share a common function differing
in the vkQueueSubmit/vkQueueSubmit2 call with differences with
VkSubmitInfo/VkSubmitInfo2 handled in the
vn_queue_submission_prepare_submit().

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>

18 months agovenus: append fence feedback batch
Juston Li [Wed, 21 Dec 2022 00:53:47 +0000 (16:53 -0800)]
venus: append fence feedback batch

Instead of calling an additional QueueSubmit for fence feedback, append
a SubmitInfo batch for fence feedback. This does require copying the
submitted batches to a larger buffer with an additional slot for the
fence feedback batch.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>

18 months agovenus: drop VkQueueBindSparse
Juston Li [Tue, 20 Dec 2022 22:51:51 +0000 (14:51 -0800)]
venus: drop VkQueueBindSparse

Sparse binding is already disabled with fence feedback enabled by
default due to the difficulty getting both to work.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>

18 months agovenus: remove filtering external semaphores for QueueSubmit
Juston Li [Tue, 20 Dec 2022 22:47:20 +0000 (14:47 -0800)]
venus: remove filtering external semaphores for QueueSubmit

We now require VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT for
external semaphores.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>

18 months agovenus: require exportable/importable bit for ext semaphores sync fd
Juston Li [Tue, 20 Dec 2022 22:19:13 +0000 (14:19 -0800)]
venus: require exportable/importable bit for ext semaphores sync fd

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>