platform/upstream/mesa.git
3 years agopan/mdg: Remove midgard_opt_copy_prop_reg
Alyssa Rosenzweig [Wed, 5 May 2021 14:28:44 +0000 (10:28 -0400)]
pan/mdg: Remove midgard_opt_copy_prop_reg

This is known broken code, and the fix is highly nontrivial. It isn't
doing terribly much for perf, so just rip off the band-aid. Prevents a
dEQP regression, and likely fixes bugs in real apps too.

total instructions in shared programs: 96640 -> 97089 (0.46%)
instructions in affected programs: 27831 -> 28280 (1.61%)
helped: 33
HURT: 301
helped stats (abs) min: 1 max: 6 x̄: 3.64 x̃: 5
helped stats (rel) min: 1.96% max: 10.00% x̄: 6.48% x̃: 7.94%
HURT stats (abs)   min: 1 max: 18 x̄: 1.89 x̃: 1
HURT stats (rel)   min: 0.46% max: 15.00% x̄: 3.17% x̃: 2.38%
95% mean confidence interval for instructions value: 1.09 1.59
95% mean confidence interval for instructions %-change: 1.80% 2.63%
Instructions are HURT.

total bundles in shared programs: 45615 -> 45612 (<.01%)
bundles in affected programs: 11257 -> 11254 (-0.03%)
helped: 121
HURT: 146
helped stats (abs) min: 1 max: 7 x̄: 2.34 x̃: 1
helped stats (rel) min: 1.22% max: 23.33% x̄: 7.85% x̃: 5.26%
HURT stats (abs)   min: 1 max: 17 x̄: 1.92 x̃: 2
HURT stats (rel)   min: 0.42% max: 25.00% x̄: 5.17% x̃: 3.85%
95% mean confidence interval for bundles value: -0.34 0.31
95% mean confidence interval for bundles %-change: -1.69% 0.23%
Inconclusive result (value mean confidence interval includes 0).

total quadwords in shared programs: 76662 -> 77275 (0.80%)
quadwords in affected programs: 20148 -> 20761 (3.04%)
helped: 28
HURT: 275
helped stats (abs) min: 1 max: 4 x̄: 1.54 x̃: 1
helped stats (rel) min: 0.43% max: 25.00% x̄: 4.89% x̃: 2.50%
HURT stats (abs)   min: 1 max: 12 x̄: 2.39 x̃: 2
HURT stats (rel)   min: 0.51% max: 28.57% x̄: 5.18% x̃: 4.26%
95% mean confidence interval for quadwords value: 1.80 2.25
95% mean confidence interval for quadwords %-change: 3.64% 4.86%
Quadwords are HURT.

total registers in shared programs: 7078 -> 7081 (0.04%)
registers in affected programs: 1028 -> 1031 (0.29%)
helped: 62
HURT: 70
helped stats (abs) min: 1 max: 2 x̄: 1.11 x̃: 1
helped stats (rel) min: 8.33% max: 50.00% x̄: 15.03% x̃: 12.50%
HURT stats (abs)   min: 1 max: 2 x̄: 1.03 x̃: 1
HURT stats (rel)   min: 8.33% max: 66.67% x̄: 20.13% x̃: 11.25%
95% mean confidence interval for registers value: -0.17 0.21
95% mean confidence interval for registers %-change: -0.14% 7.38%
Inconclusive result (value mean confidence interval includes 0).

total threads in shared programs: 5032 -> 5036 (0.08%)
threads in affected programs: 31 -> 35 (12.90%)
helped: 12
HURT: 6
helped stats (abs) min: 1 max: 2 x̄: 1.08 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1 max: 2 x̄: 1.50 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.43 0.87
95% mean confidence interval for threads %-change: 13.82% 86.18%
Inconclusive result (value mean confidence interval includes 0).

total loops in shared programs: 19 -> 19 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 0 -> 2
spills in affected programs: 0 -> 2
helped: 0
HURT: 1

total fills in shared programs: 0 -> 15
fills in affected programs: 0 -> 15
helped: 0
HURT: 1

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

3 years agopan/mdg: Use _output_ type for outmod printing
Alyssa Rosenzweig [Wed, 5 May 2021 14:13:36 +0000 (10:13 -0400)]
pan/mdg: Use _output_ type for outmod printing

Fixes incorrect outmods printed for conversions.

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

3 years agodocs: mark off VK_KHR_vulkan_memory_model for turnip
Danylo Piliaiev [Thu, 6 May 2021 13:54:44 +0000 (16:54 +0300)]
docs: mark off VK_KHR_vulkan_memory_model for turnip

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

3 years agolavapipe: don't access pipeline blend state when it should be ignored
Mike Blumenkrantz [Wed, 5 May 2021 13:29:41 +0000 (09:29 -0400)]
lavapipe: don't access pipeline blend state when it should be ignored

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

3 years agolavapipe: don't access pipeline dsa state when it should be ignored
Mike Blumenkrantz [Wed, 5 May 2021 13:29:25 +0000 (09:29 -0400)]
lavapipe: don't access pipeline dsa state when it should be ignored

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

3 years agolavapipe: don't access pipeline viewport state when it should be ignored
Mike Blumenkrantz [Wed, 5 May 2021 13:28:41 +0000 (09:28 -0400)]
lavapipe: don't access pipeline viewport state when it should be ignored

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

3 years agolavapipe: ignore tess pipeline info if no tess shaders in pipeline
Mike Blumenkrantz [Sat, 24 Apr 2021 17:17:34 +0000 (13:17 -0400)]
lavapipe: ignore tess pipeline info if no tess shaders in pipeline

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

3 years agolavapipe: don't unnecessarily flag dsa states for updating
Mike Blumenkrantz [Wed, 5 May 2021 13:26:57 +0000 (09:26 -0400)]
lavapipe: don't unnecessarily flag dsa states for updating

these force a new dsa state to be created and bound, which isn't necessary
if the same value is being reset

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

3 years agolavapipe: zero out the blend state info and flag for updating on null blend state
Mike Blumenkrantz [Wed, 5 May 2021 13:25:50 +0000 (09:25 -0400)]
lavapipe: zero out the blend state info and flag for updating on null blend state

this still needs to be updated if there's no pipeline info available

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

3 years agolavapipe: zero out the dsa state info and flag for updating on null dsa state
Mike Blumenkrantz [Wed, 5 May 2021 13:25:50 +0000 (09:25 -0400)]
lavapipe: zero out the dsa state info and flag for updating on null dsa state

this still needs to be updated if there's no pipeline info available

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

3 years agolavapipe: update more states on null multisample pipeline info
Mike Blumenkrantz [Wed, 5 May 2021 13:25:01 +0000 (09:25 -0400)]
lavapipe: update more states on null multisample pipeline info

these all need to be unset to ensure expected functionality

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

3 years agolavapipe: flag renderpasses as having color/zs attachments
Mike Blumenkrantz [Tue, 4 May 2021 15:58:43 +0000 (11:58 -0400)]
lavapipe: flag renderpasses as having color/zs attachments

it's useful to track this info for reuse

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

3 years agolavapipe: set events to the unsignalled state on creation
Mike Blumenkrantz [Tue, 4 May 2021 15:58:09 +0000 (11:58 -0400)]
lavapipe: set events to the unsignalled state on creation

this is otherwise uninitialized and not compliant with spec

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

3 years agolavapipe: do not read sampler descriptor info during update if layout has immutables
Mike Blumenkrantz [Tue, 4 May 2021 15:57:41 +0000 (11:57 -0400)]
lavapipe: do not read sampler descriptor info during update if layout has immutables

this is illegal

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

3 years agolavapipe: handle buffer sizes better in CmdBindTransformFeedbackBuffersEXT
Mike Blumenkrantz [Tue, 4 May 2021 15:56:24 +0000 (11:56 -0400)]
lavapipe: handle buffer sizes better in CmdBindTransformFeedbackBuffersEXT

according to spec, the pSizes array member is only used if the array is non-null
and the value is not VK_WHOLE_SIZE, otherwise this value is calculated based
on the buffer size - the offset

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

3 years agopan/bi: Add two tuples to a clause when needed with NOSCHED
Icecream95 [Wed, 5 May 2021 21:02:02 +0000 (09:02 +1200)]
pan/bi: Add two tuples to a clause when needed with NOSCHED

Fixes SuperTuxKart with BIFROST_MESA_DEBUG=nosched.

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

3 years agopanfrost: Always write reloaded tiles when making CRC data valid
Icecream95 [Sat, 1 May 2021 10:45:11 +0000 (22:45 +1200)]
panfrost: Always write reloaded tiles when making CRC data valid

If CRC data is currently invalid and the current batch will make it
valid, write even clean tiles to make sure CRC data is updated.

Fixes: 8ba2f9f6985 ("panfrost: Create a blitter library to replace the existing preload helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10566>

3 years agopanfrost: Make pan_select_crc_rt a non-static function
Icecream95 [Sat, 1 May 2021 10:44:45 +0000 (22:44 +1200)]
panfrost: Make pan_select_crc_rt a non-static function

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

3 years agonir: add nir_isub_imm
Mike Blumenkrantz [Wed, 5 May 2021 18:14:13 +0000 (14:14 -0400)]
nir: add nir_isub_imm

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10654>

3 years agogallium/inlines: remove atomic set from pipe_reference_init()
Mike Blumenkrantz [Wed, 5 May 2021 13:43:46 +0000 (09:43 -0400)]
gallium/inlines: remove atomic set from pipe_reference_init()

when an object is initialized with this, it should not be visible to any
other threads or contexts, so there should be no need to use an atomic set here

at the time of this commit, there are only two callers in the tree which pass
values != 1:
* zink uses a calculated number for framebuffer refcount on init (this is fine)
* aux/pb passes 0 on init (this is fine)

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

3 years agoRevert "gallium/util: Fix depth/stencil blit shaders"
Boris Brezillon [Tue, 4 May 2021 06:31:38 +0000 (08:31 +0200)]
Revert "gallium/util: Fix depth/stencil blit shaders"

This reverts commit 7ca72f172678116d29d254b786a9422b864aef3d.
Unlike what's stated in this commit, the depth or stencil components
have to be replicated on all channels, as specified in the
"Texture Sampling and Texture Formats" section of the TGSI doc
(docs/gallium/tgsi.rst).

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

3 years agozink: clamp zs samplers to XXXX swizzle for all non-zero/one swizzles
Mike Blumenkrantz [Wed, 5 May 2021 13:40:51 +0000 (09:40 -0400)]
zink: clamp zs samplers to XXXX swizzle for all non-zero/one swizzles

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

3 years agozink: do not ask glsl-compiler to unroll
Erik Faye-Lund [Fri, 9 Apr 2021 05:29:09 +0000 (07:29 +0200)]
zink: do not ask glsl-compiler to unroll

We don't really need loops unrolled, so let's just disable this. This is
generally recommended for NIR drivers, but we can do even better; not
even unroll in NIR. And since we don't set
nir_shader_compiler_options::max_unroll_iterations, we're already there.

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

3 years agolavapipe: emit correct textures_used for texture-arrays
Erik Faye-Lund [Mon, 3 May 2021 11:21:01 +0000 (13:21 +0200)]
lavapipe: emit correct textures_used for texture-arrays

When we lower a texture-lookup with a dynamic index, we need to mark the
entire array as used, because we don't know better.

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

3 years agov3d: enable NIR loop unrolling
Iago Toral Quiroga [Mon, 3 May 2021 09:12:43 +0000 (11:12 +0200)]
v3d: enable NIR loop unrolling

The GL driver was getting loop unrolling from the GLSL compiler frontend,
but NIR unrolling is more sophisticated, so prefer that.

The only caveat is that loop unrolling is implemented in the Mesa state
tracker, so our backend won't have a chance to undo the optimization if
it causes us to lower thread count or spill, so we choose to be a bit more
conservative with the configuration than what we were doing with GLSL.

Shader-db results follow. Increase in instruction counts is expected due
to additional unrolling. We lose threads in very few shaders, but we
make up for this with the additional unrolling and reduced spilling. We
also managed to get 3 more shaders to compile successfully.

total instructions in shared programs: 13416427 -> 13461431 (0.34%)
instructions in affected programs: 96936 -> 141940 (46.43%)
helped: 58
HURT: 216
Instructions are HURT.

total threads in shared programs: 410626 -> 410598 (<.01%)
threads in affected programs: 56 -> 28 (-50.00%)
helped: 0
HURT: 14
Threads are HURT.

total loops in shared programs: 2121 -> 1708 (-19.47%)
loops in affected programs: 468 -> 55 (-88.25%)
helped: 446
HURT: 47
Loops are helped.

total uniforms in shared programs: 3676567 -> 3691185 (0.40%)
uniforms in affected programs: 25304 -> 39922 (57.77%)
helped: 23
HURT: 199
Uniforms are HURT.

total spills in shared programs: 5902 -> 5727 (-2.97%)
spills in affected programs: 285 -> 110 (-61.40%)
helped: 19
HURT: 0

total fills in shared programs: 13308 -> 13121 (-1.41%)
fills in affected programs: 301 -> 114 (-62.13%)
helped: 19
HURT: 0

total sfu-stalls in shared programs: 31860 -> 32856 (3.13%)
sfu-stalls in affected programs: 1692 -> 2688 (58.87%)
helped: 25
HURT: 196
Sfu-stalls are HURT.

total inst-and-stalls in shared programs: 13448287 -> 13494287 (0.34%)
inst-and-stalls in affected programs: 98404 -> 144404 (46.75%)
helped: 57
HURT: 217
Inst-and-stalls are HURT.

total nops in shared programs: 329276 -> 329551 (0.08%)
nops in affected programs: 2189 -> 2464 (12.56%)
helped: 58
HURT: 181
Nops are HURT.

LOST:   0
GAINED: 3

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

3 years agobroadcom/compiler: specify maximum thread count in compile strategies
Iago Toral Quiroga [Wed, 5 May 2021 09:26:13 +0000 (11:26 +0200)]
broadcom/compiler: specify maximum thread count in compile strategies

Once we have exhausted compile strategies at 4 threads and we start
enabling lower thread counts, there is no point in starting compiles
with 4 threads for them, we know these will fail, so let's start at
2 in these cases.

This also has another nice implication: if the driver compiles at 4
threads and fails to register allocate, we were allowing it to try
with 2 threads, but this would only retry the register allocation
process and would not really recompile the shader with 2 threads. This
is not optimal, because at 2 threads we have more TMU fifo space for
each thread and we can do more TMU pipelining, so we were missing that
opportunity.

This improves performance in Sponza by ~1.5% and also seems to help
UE4 slightly.

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

3 years agobroadcom/compiler: refactor compile strategies
Iago Toral Quiroga [Mon, 3 May 2021 08:30:31 +0000 (10:30 +0200)]
broadcom/compiler: refactor compile strategies

Until now, if we can't compile at 4 threads we would lower thread count
with optimizations disabled, however, lowering thread count doubles the
amount of registers available per thread, so that alone is already a big
relief for register pressure so it makes sense to enable optimizations
when we do that, and progressively disable them until we enable spilling
as a last resort.

This can slightly improve performance for some applications. Sponza,
for example, gets a ~1.5% boost. I see several UE4 shaders that also get
compiled to better code at 2 threads with this, but it is more difficult
to assess how much this improves performance in practice due to the large
variance in frame times that we observe with UE4 demos.

Also, if a compiler strategy disables an optimization that did not make
any progress in the previous compile attempt, we would end up re-compiling
the exact same shader code and failing again. This, patch keeps track of
which strategies won't make progress and skips them in that case to save
some CPU time during shader compiles.

Care should be taken to ensure that we try to compile with the default
NIR scheduler at minimum thread count at least once though, so a specific
strategy for this is added, to prevent the scenario where no optimizations
are used and we skip directly to the fallback scheduler if the default
strategy fails at 4 threads.

Similarly, we now also explicitly specify which strategies are allowed to do
TMU spills and make sure we take this into account when deciding to skip
strategies. This prevents the case where no optimizations are used in a
shader and we skip directly to the fallback scheduler after failing
compilation at 2 threads with the default NIR scheduler but without trying
to spill first.

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

3 years agobroadcom/compiler: add a compiler strategy to disable loop unrolling
Iago Toral Quiroga [Mon, 3 May 2021 08:14:12 +0000 (10:14 +0200)]
broadcom/compiler: add a compiler strategy to disable loop unrolling

Loop unrolling can increase register pressure significantly, leading to
lower thread counts and spilling.

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

3 years agov3d: move NIR compiler options to GL driver
Iago Toral Quiroga [Mon, 3 May 2021 06:31:13 +0000 (08:31 +0200)]
v3d: move NIR compiler options to GL driver

The Vulkan driver was already creating and using its own set of options, so
the ones defined in the compiler are only used with GL, which is confusing.
Move them to the GL driver.

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

3 years agov3dv: setup loop unrolling
Iago Toral Quiroga [Mon, 3 May 2021 11:35:40 +0000 (13:35 +0200)]
v3dv: setup loop unrolling

We set the maximum at 16 iterations (the GL compiler chooses 32
iterations for the GLSL front-end loop unrolling pass) because we
have observed a bunch of shaders from Sascha Willems that spill
significantly with 32, leading to massive performance degradation,
while 16 avoids spilling and doesn't seem to cause visible
performance degradation compared to cases that unroll 32 without
spilling.

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

3 years agobroadcom/compiler: add a loop unrolling pass
Iago Toral Quiroga [Mon, 3 May 2021 09:33:46 +0000 (11:33 +0200)]
broadcom/compiler: add a loop unrolling pass

Right now this is useful for Vulkan onnly, because GL gets loop
unrolling from the GLSL compiler and/or mesa state tracker
NIR front-ends.

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

3 years agoRevert "CI: Disable Panfrost and radeonsi"
Tomeu Vizoso [Thu, 6 May 2021 08:31:45 +0000 (10:31 +0200)]
Revert "CI: Disable Panfrost and radeonsi"

Lab is up and running again.

This reverts commit de1a20f4bec789c690e5eeba728073ca9c9cfc08.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10663>

3 years agoradv: fix missing ITERATE_256 for D/S MSAA images that are TC-compat HTILE
Samuel Pitoiset [Mon, 3 May 2021 15:56:27 +0000 (17:56 +0200)]
radv: fix missing ITERATE_256 for D/S MSAA images that are TC-compat HTILE

To make them readable by shaders, only needed on GFX10+.

This also fixes corruption with Control and MSAA.

Cc: 21.1 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/10610>

3 years agoi965: support only color formats with memory objects
Tapani Pälli [Wed, 5 May 2021 06:57:01 +0000 (09:57 +0300)]
i965: support only color formats with memory objects

There are issues with depth support and lack of support for
combined depth+stencil, let's support only color formats for now.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4712
Fixes: f73aeca0ce3 ("i965: Initial implementation for EXT_memory_object_*")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10646>

3 years agoturnip: Move the extension tables to tu_device.c
Emma Anholt [Tue, 4 May 2021 20:32:53 +0000 (13:32 -0700)]
turnip: Move the extension tables to tu_device.c

Following intel's lead in 27d49670.  In the dEQP-VK.info.* tests, this
bumps apiVersion from 1.1.128 to 1.1.177.

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

3 years agoturnip: Switch to the shared vulkan ICD generator.
Emma Anholt [Tue, 4 May 2021 20:38:49 +0000 (13:38 -0700)]
turnip: Switch to the shared vulkan ICD generator.

One less python script to maintain.

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

3 years agogallium/tgsi_exec: Simplify bounds checks on the const file.
Eric Anholt [Thu, 3 Dec 2020 23:18:45 +0000 (15:18 -0800)]
gallium/tgsi_exec: Simplify bounds checks on the const file.

We were doing two < 0 checks, when we can just treat the value as unsigned
and check against our unsigned size limit.  Cuts 2k of text from the
various inlined copies of this function.

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

3 years agotgsi_exec: Mark the store file default case as unreachable.
Eric Anholt [Tue, 4 May 2021 04:19:38 +0000 (21:19 -0700)]
tgsi_exec: Mark the store file default case as unreachable.

It isn't reached, and shouldn't be, and it's not like returning NULL
(instead of the &null case for TGSI_FILE_NULL) will do anything good.

Shaves another tiny bit of dead code off of release builds.

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

3 years agotgsi_exec: Drop unused destination dimension support.
Eric Anholt [Tue, 4 May 2021 04:07:53 +0000 (21:07 -0700)]
tgsi_exec: Drop unused destination dimension support.

As you can see, nothing used the index2d value we computed.  Turns out
this does remove some unused code from release builds.

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

3 years agogallium/tgsi_exec: Drop the unused dst_datatypes from dest stores.
Eric Anholt [Wed, 6 Jan 2021 21:06:55 +0000 (13:06 -0800)]
gallium/tgsi_exec: Drop the unused dst_datatypes from dest stores.

It was just for the disabled check_inf_or_nan debugging, and if you want
to do that then you should do it with an assert at the end of
exec_instruction using tgsi_opcode_infer_type().

Despite the fact that this operand was dead, it actually reduces generated
code in release builds.

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

3 years agozink: remove incorrect border-swizzle assumption
Erik Faye-Lund [Mon, 19 Apr 2021 12:19:53 +0000 (14:19 +0200)]
zink: remove incorrect border-swizzle assumption

According to the Khronos issue[1], it seems like RADV and NVIDIA is in
the wrong, so let's turn the logic around here.

This makes us do the right thing for Lavapipe, and we should probablt
remove RADV from this list once !9731 lands.

[1]: https://github.com/KhronosGroup/Vulkan-Docs/issues/1421

Fixes: cdb9a4775bf ("zink: set PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10321>

3 years agovtn: Use relaxed 24bit opcodes for CL 24bit math
Jesse Natalie [Fri, 30 Apr 2021 18:47:15 +0000 (11:47 -0700)]
vtn: Use relaxed 24bit opcodes for CL 24bit math

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

3 years agonir: Add relaxed 24bit opcodes
Jesse Natalie [Fri, 30 Apr 2021 18:46:09 +0000 (11:46 -0700)]
nir: Add relaxed 24bit opcodes

These are equivalent to the 32bit opcodes if there are no more efficient
24bit opcodes available, but inputs are guaranteed to already be 24bit,
so the 24bit opcodes can be used instead if they exist and are efficient.

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

3 years agollvmpipe: Fix optimization loop to actually loop
Jesse Natalie [Fri, 30 Apr 2021 22:42:38 +0000 (15:42 -0700)]
llvmpipe: Fix optimization loop to actually loop

Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10549>

3 years agofreedreno/a5xx: Fix up border color pointers.
Eric Anholt [Mon, 29 Mar 2021 21:11:28 +0000 (14:11 -0700)]
freedreno/a5xx: Fix up border color pointers.

We were forgetting to increment in the loop, but also it looks from blob
dumps on Pixel 2 like all the pointers it emitted were shifted up by 3
compared to our xml, and that's the same shift that a6xx uses for its
pointers.  None of the tests seem to use more than one
border-color-requiring texture, so it's hard to tell.

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

3 years agoCI: Disable Panfrost and radeonsi
Daniel Stone [Wed, 5 May 2021 20:47:58 +0000 (21:47 +0100)]
CI: Disable Panfrost and radeonsi

The Cambridge office is having connection difficulty; disable the jobs
until it comes back.

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

3 years agofreedreno/tools: Fix async flush vs fdperf/computerator
Rob Clark [Tue, 4 May 2021 16:03:43 +0000 (09:03 -0700)]
freedreno/tools: Fix async flush vs fdperf/computerator

They need to wait on the ready fence to ensure the submit has been
flushed to the kernel.

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

3 years agomesa: NOTE! Default branch is now main
Jordan Justen [Mon, 26 Apr 2021 18:54:39 +0000 (11:54 -0700)]
mesa: NOTE! Default branch is now main

To update your local repository to use the new default branch, these
commands may help:

$ git fetch origin
$ git checkout master
$ git branch -m main
$ git branch --set-upstream-to=origin/main
$ git remote set-head origin --auto

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years agodocs: Rename master branch to main
Jordan Justen [Mon, 26 Apr 2021 20:51:33 +0000 (13:51 -0700)]
docs: Rename master branch to main

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years agodocs/releasing.rst: Rename master branch to main
Jordan Justen [Mon, 26 Apr 2021 20:48:30 +0000 (13:48 -0700)]
docs/releasing.rst: Rename master branch to main

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years agoissue_templates/Bug Report: Rename master branch to main
Jordan Justen [Mon, 26 Apr 2021 20:17:49 +0000 (13:17 -0700)]
issue_templates/Bug Report: Rename master branch to main

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years ago.gitlab-ci.yml: Use main branch for gitlab ci
Jordan Justen [Mon, 26 Apr 2021 20:16:55 +0000 (13:16 -0700)]
.gitlab-ci.yml: Use main branch for gitlab ci

Reworks:
 * Fix mesa/mesamaster typo to mesa/mesa main (anholt)
 * Use $CI_DEFAULT_BRANCH (eric_engestrom)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years agobin/pick: Rename master branch to main
Jordan Justen [Mon, 26 Apr 2021 19:29:30 +0000 (12:29 -0700)]
bin/pick: Rename master branch to main

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years agocommit_in_branch_test.py: Rename branch master to main
Jordan Justen [Mon, 26 Apr 2021 19:18:51 +0000 (12:18 -0700)]
commit_in_branch_test.py: Rename branch master to main

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
3 years agodocs: remove doxygen support
Erik Faye-Lund [Tue, 4 May 2021 08:56:48 +0000 (10:56 +0200)]
docs: remove doxygen support

It seems building the doxygen docs has bit-rotted over time, and now
generates a set of empty modules, apart from some basic descriptions.

Since Mesa is mostly implementing externally documented APIs, I don't
think it makes a whole lot of sense trying to fix this, and I think the
presence of these files might confuse users who try them out.

So let's just get rid of this.

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

3 years agoci/lavapipe: Add fractional NIR stress test job.
Emma Anholt [Tue, 4 May 2021 16:50:32 +0000 (09:50 -0700)]
ci/lavapipe: Add fractional NIR stress test job.

I think between the disk cache unit tests and testing that we can really
serialize/deserialize NIR, this covers what I cared about for testing disk
caching.

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

3 years agoci/llvmpipe: Add testing of gles3/31/gl.
Emma Anholt [Tue, 4 May 2021 16:48:35 +0000 (09:48 -0700)]
ci/llvmpipe: Add testing of gles3/31/gl.

llvmpipe is a pretty important driver, we should be fully testing it.
Also, enable some options to stress test some NIR internals.

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

3 years agoturnip: Demote API version to 1.1.
Eric Anholt [Mon, 26 Apr 2021 18:24:58 +0000 (11:24 -0700)]
turnip: Demote API version to 1.1.

We don't support major 1.2 required extensions like timeline semaphores.
Fixes many complaints in the dEQP-VK.info.vulkan1p2.* group.

We were originally bumped to 1.2 in 75755e0eba17 ("turnip: Pretend to
support Vulkan 1.2") but hopefully that build issue has been fixed in the
entrypoint reworks since then.

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

3 years agovenus: populate VK_ERROR_OUT_OF_HOST_MEMORY if applied
Yiwei Zhang [Tue, 4 May 2021 23:35:06 +0000 (23:35 +0000)]
venus: populate VK_ERROR_OUT_OF_HOST_MEMORY if applied

Fix dEQP-VK.wsi.android.swapchain.simulate_oom.* failures.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10639>

3 years agofreedreno/a5xx: Remove ppgtt hack
Erik Faye-Lund [Wed, 5 May 2021 09:30:27 +0000 (11:30 +0200)]
freedreno/a5xx: Remove ppgtt hack

This should no longer be needed after !7773, which fixes the issue that
lead to the crash. Sorry for not fixing the issue earlier ;)

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

3 years agoaux/cso_cache: add handling for save/restore of compute states
Mike Blumenkrantz [Sat, 24 Apr 2021 17:18:02 +0000 (13:18 -0400)]
aux/cso_cache: add handling for save/restore of compute states

just shader and samplers for now

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

3 years agopanfrost: Fix format definitions to match gallium expectations
Boris Brezillon [Tue, 4 May 2021 06:44:35 +0000 (08:44 +0200)]
panfrost: Fix format definitions to match gallium expectations

Gallium wants the depth or stencil component replicated on all .XYZW.
That's easily done on pre-v7 since we can forge all the swizzles we
want, but Bifrost v7 only supports a few combinations, so we have to
combine the user swizzle with our own 'replicate' swizzle to make it
work. Note that v7 has a trick to make border color work when the GRBA
order is chosen: they apply the red border color to the green component.

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

3 years agoandroid: pan/bi: add bi_opt_constant_fold.c to Makefile.sources
Mauro Rossi [Mon, 3 May 2021 20:50:26 +0000 (22:50 +0200)]
android: pan/bi: add bi_opt_constant_fold.c to Makefile.sources

Fixes the following building error:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: bi_opt_constant_fold
>>> referenced by bifrost_compile.c:3105 (external/mesa/src/panfrost/bifrost/bifrost_compile.c:3105)

Fixes: 1cb11969bec0 ("pan/bi: Add simple constant folding pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10603>

3 years agoanv: Allow storage on all formats that support typed writes
Jason Ekstrand [Tue, 4 May 2021 15:40:55 +0000 (10:40 -0500)]
anv: Allow storage on all formats that support typed writes

In particular, this gives us B8G8R8A8_UNORM storage support which is
useful for writing WSI images from compute shaders.  These formats can
only be accessed in a spec-compliant way by decorating the variable
NonReadable in the SPIR-V (writeonly in GLSL).  If the client doesn't so
decorate the variable, it'll get the null surface state where reads
return 0 and writes are ignored.

Tested-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10624>

3 years agoisl: document format fields
Lionel Landwerlin [Tue, 4 May 2021 18:43:50 +0000 (21:43 +0300)]
isl: document format fields

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10624>

3 years agoanv: Check offset instead of alloc_size for freeing surface states
Jason Ekstrand [Tue, 4 May 2021 18:30:35 +0000 (13:30 -0500)]
anv: Check offset instead of alloc_size for freeing surface states

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10624>

3 years agogallium/u_vbuf: avoid dereferencing NULL pointer
Erik Faye-Lund [Tue, 4 May 2021 11:04:48 +0000 (13:04 +0200)]
gallium/u_vbuf: avoid dereferencing NULL pointer

When I last time fixed this, I missed that continuing here would make us
leak pointers in the translate state, which is what made this avoid a
crash in the first place.

That's not great, we need to set *some* pointer in this case. The
obvious option would be NULL, but that means that the translate-code
also needs to support NULL-pointers here.

Instead, let's point to a small, static buffer that contains enough
zero-data for the largest possible vertex attribute. This avoids having
to add more NULL-checks.

Fixes: a8e8204b186 ("gallium/u_vbuf: support NULL-resources")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7773>

3 years agoradeon/vcn: Use the correct pitch for chroma surface.
Bas Nieuwenhuizen [Tue, 4 May 2021 23:34:42 +0000 (23:34 +0000)]
radeon/vcn: Use the correct pitch for chroma surface.

The pitch of the chroma plane isn't necessarily half that of the
luma plane, as tiling (and presumably even linear) swizzle modes
apply some alignment.

Fixes: 35e25ea1d07 ("ac/surface: allow non-DCC modifiers for YUV on GFX9+")
Reviewed-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10638>

3 years agoturnip: implement VK_KHR_vulkan_memory_model
Danylo Piliaiev [Mon, 15 Feb 2021 11:51:54 +0000 (13:51 +0200)]
turnip: implement VK_KHR_vulkan_memory_model

No handling of Acquire/Release because at the moment scheduler
works as if any barrier is Acq+Rel.

Instead of removing scoped_barrier with scope/mode that for TCS
corresponds to a control_barrier or a memory_barrier_tcs_patch in
ir3_nir_lower_tess_ctrl - remove them in emit_intrinsic_barrier.
And do the same for memory_barrier_tcs_patch and control_barrier.
While in any case hw fence/barrier shouldn't be emitted for them,
they still affect ordering of stores, and in feature ir3 backend
may want to have that information.

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

3 years agoir3: update bar/fence bits in accordance to blob
Danylo Piliaiev [Fri, 30 Apr 2021 11:12:03 +0000 (14:12 +0300)]
ir3: update bar/fence bits in accordance to blob

On a6xx blob uses .l rather differently from a5xx.

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

3 years agoir3: memory_barrier also controls shared memory access order
Danylo Piliaiev [Mon, 15 Feb 2021 13:53:46 +0000 (15:53 +0200)]
ir3: memory_barrier also controls shared memory access order

nir_intrinsic_memory_barrier has the same semantic as memoryBarrier()
in GLSL, which is:

GLSL 4.60, 4.10. "Memory Qualifiers":
 "The built-in function memoryBarrier() can be used if needed to
 guarantee the completion and relative ordering of memory accesses
 performed by a single shader invocation."

GLSL 4.60, 8.17. "Shader Memory Control Functions":
 "The built-in functions memoryBarrier() and groupMemoryBarrier() wait
 for the completion of accesses to all of the above variable types."

Fixes tests:
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.device.payload_local.image.guard_nonlocal.workgroup.comp
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.device.payload_nonlocal.workgroup.guard_local.image.comp

Fixes: 819a613a ("freedreno/ir3: moar better scheduler")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9054>

3 years agodocs: do not generate redirects on error
Erik Faye-Lund [Thu, 22 Apr 2021 11:46:41 +0000 (13:46 +0200)]
docs: do not generate redirects on error

The build-finished event is also triggered when there's an error. I
somehow got the second argument wrong, and ended up ignoring the case.
This can lead to new exceptions being thrown due to missing files, that
ends up hiding the real problem.

Fixes: 64a4ba9e1ce ("docs: add an extension to generate redirects")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10407>

3 years agozink: only emit ImageBuffer cap if needed
Erik Faye-Lund [Wed, 21 Apr 2021 10:55:12 +0000 (12:55 +0200)]
zink: only emit ImageBuffer cap if needed

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

3 years agozink: emit cap early
Erik Faye-Lund [Wed, 21 Apr 2021 10:50:24 +0000 (12:50 +0200)]
zink: emit cap early

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

3 years agozink: emit sample-shading cap early
Erik Faye-Lund [Wed, 21 Apr 2021 10:36:28 +0000 (12:36 +0200)]
zink: emit sample-shading cap early

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

3 years agozink: remove needless shader-info from context
Erik Faye-Lund [Wed, 21 Apr 2021 10:30:54 +0000 (12:30 +0200)]
zink: remove needless shader-info from context

There's no longer any code reading this, so let's get rid of it. It
always rubbed me a bit the wrong way, because this repeated some
information already present in the context.

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

3 years agozink: emit cap early
Erik Faye-Lund [Wed, 21 Apr 2021 10:30:23 +0000 (12:30 +0200)]
zink: emit cap early

We have enough information to emit this cap early, so let's do that.

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

3 years agozink: do not check for varying output for fragment shaders
Erik Faye-Lund [Wed, 21 Apr 2021 10:23:52 +0000 (12:23 +0200)]
zink: do not check for varying output for fragment shaders

This will make us emit these caps needlessly, possibly on implementations
not supporting the enabling features.

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

3 years agozink: always enable fixed shader-caps
Erik Faye-Lund [Wed, 21 Apr 2021 10:09:45 +0000 (12:09 +0200)]
zink: always enable fixed shader-caps

This is required for a bunch of stuff that can occur in any Vulkan
shader stage, not just these few. So let's always emit this cap.

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

3 years agointel/decoder: add gen4/5 geometry state decode
Dave Airlie [Mon, 22 Mar 2021 00:03:52 +0000 (10:03 +1000)]
intel/decoder: add gen4/5 geometry state decode

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10642>

3 years agointel/decoder: fixup batch decoder for binding tables on gen4/5
Dave Airlie [Thu, 31 Dec 2020 02:14:58 +0000 (12:14 +1000)]
intel/decoder: fixup batch decoder for binding tables on gen4/5

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10642>

3 years agoradv: expose 2/3rd of total memory as VRAM and 1/3rd as GTT on APUs
Samuel Pitoiset [Tue, 23 Mar 2021 14:43:28 +0000 (14:43 +0000)]
radv: expose 2/3rd of total memory as VRAM and 1/3rd as GTT on APUs

A bunch of games complain when the VRAM size is too small. The most
compatible solution seems to return memory heaps like a dGPU.

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

3 years agoradv: adjust the computation of the total usage of memory used
Samuel Pitoiset [Mon, 26 Apr 2021 11:43:44 +0000 (11:43 +0000)]
radv: adjust the computation of the total usage of memory used

internal_usage is the memory allocated by the current process (intent)
while system_usage is the memory allocated globally (actual).

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

3 years agogallium/u_threaded: don't set resource pointers to NULL after driver calls
Marek Olšák [Thu, 29 Apr 2021 04:42:40 +0000 (00:42 -0400)]
gallium/u_threaded: don't set resource pointers to NULL after driver calls

The pointers won't be used at that point. Just decrement the refcounts.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>

3 years agogallium/u_threaded: rewrite slot layout to reduce wasted space
Marek Olšák [Wed, 28 Apr 2021 23:25:53 +0000 (19:25 -0400)]
gallium/u_threaded: rewrite slot layout to reduce wasted space

A lot of space was wasted due to 16-byte alignment for slots. This new
layout tries to match glthread. Highlights:

- the slot size changed to 8 bytes (was 16), so less padding
- the header size changed to 4 bytes (was 8), so some calls can use
  the remaining 4 bytes in the slot for parameters
- draw merging merges up to 307 draws (was 256) due to space savings
- parameters in structures are sorted based on implicit type alignment
  (uint8_t first, pointers last) to make it easier to utilize the 4 bytes
  after the header and to remove holes
- some structures use smaller types for parameters than pipe_context where
  it's safe (e.g. clear uses float instead of double for depth)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>

3 years agogallium/u_threaded: handle sampler views == NULL better
Marek Olšák [Thu, 22 Apr 2021 01:22:14 +0000 (21:22 -0400)]
gallium/u_threaded: handle sampler views == NULL better

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>

3 years agogallium/u_threaded: move base_valid_buffer_range to transfer where it belongs
Marek Olšák [Tue, 20 Apr 2021 10:19:14 +0000 (06:19 -0400)]
gallium/u_threaded: move base_valid_buffer_range to transfer where it belongs

This saves 8 bytes per resource.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>

3 years agoRevert "gallium/u_threaded: align batches and call slots to 16 bytes"
Marek Olšák [Wed, 28 Apr 2021 21:19:43 +0000 (17:19 -0400)]
Revert "gallium/u_threaded: align batches and call slots to 16 bytes"

This reverts commit 3b1ce49bc1e5aff87805b0bab255885c84bf5052.

It will be completely rewritten, but let's revert this first.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>

3 years agogallium: Reset attachments to ST_ATTACHMENT_INVALID when revalidating
Adam Jackson [Mon, 26 Apr 2021 21:22:18 +0000 (17:22 -0400)]
gallium: Reset attachments to ST_ATTACHMENT_INVALID when revalidating

It is *super* *confusing* to leave this initialized to zero, i.e.
ST_ATTACHMENT_FRONT_LEFT.

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

3 years agomesa: Ignore the depth buffer when computing framebuffer floatness
Adam Jackson [Wed, 31 Mar 2021 22:03:01 +0000 (18:03 -0400)]
mesa: Ignore the depth buffer when computing framebuffer floatness

Not that Z32F is especially common, but we shouldn't consider it to
imply that the color buffers are also float, which is what floatMode
is meant to mean.

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

3 years agomesa: Remove unused _mesa_{create,destroy}_visual
Adam Jackson [Wed, 31 Mar 2021 20:13:56 +0000 (16:13 -0400)]
mesa: Remove unused _mesa_{create,destroy}_visual

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

3 years agoutil/math: change ROUND_DOWN_TO to return a uint64_t
Samuel Pitoiset [Tue, 4 May 2021 15:08:58 +0000 (17:08 +0200)]
util/math: change ROUND_DOWN_TO to return a uint64_t

For 32-bit builds.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10622>

3 years agointel/genxml: fix raster op fields on gen4/5
Dave Airlie [Tue, 29 Dec 2020 04:44:02 +0000 (14:44 +1000)]
intel/genxml: fix raster op fields on gen4/5

These should be unsigned integers

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10636>

3 years agointel/gemxml: move blitter command to render on gen4/5
Dave Airlie [Tue, 22 Dec 2020 03:25:59 +0000 (13:25 +1000)]
intel/gemxml: move blitter command to render on gen4/5

The blitter commands don't show up in INTEL_DEBUG=bat, but on
gen4/5 they are emitted on the render engine ring so just change
the XML to reflect that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10636>

3 years agointel/genxml: rewrite the prefilterop xml to be more consistent.
Dave Airlie [Wed, 5 May 2021 01:18:23 +0000 (11:18 +1000)]
intel/genxml: rewrite the prefilterop xml to be more consistent.

This uses a prefix at Ken's suggestion and aligns it across gens

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10636>

3 years agointel/genxml: align gen4/5 xml for store data immediate
Dave Airlie [Wed, 5 May 2021 00:58:22 +0000 (10:58 +1000)]
intel/genxml: align gen4/5 xml for store data immediate

Just align with the gen6 and later xml

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10636>

3 years agointel: fix MI builder for pre-gen7
Ilia Mirkin [Fri, 6 Dec 2019 02:40:51 +0000 (21:40 -0500)]
intel: fix MI builder for pre-gen7

MI_LOAD_REGISTER_MEM is only available on gen7+, so avoid build errors
on earlier generations.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10636>

3 years agozink: export PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE
Mike Blumenkrantz [Sun, 4 Apr 2021 17:28:59 +0000 (13:28 -0400)]
zink: export PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE

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

3 years agozink: implement sparse buffer creation/mapping
Mike Blumenkrantz [Sun, 4 Apr 2021 17:25:51 +0000 (13:25 -0400)]
zink: implement sparse buffer creation/mapping

sparse buffers are not cpu-readable, so any mapping requires that they
use a staging buffer, either the stream uploader for writes or a manual
copy for readback

future work here should attempt to resolve two perf issues:
* sparse allocations should be allocated dynamically using a suballocator
  or some other, more useful strategy
* readback shouldn't allocate a huge staging buffer

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

3 years agozink: add a pipe_context::resource_commit hook
Mike Blumenkrantz [Sun, 4 Apr 2021 17:17:23 +0000 (13:17 -0400)]
zink: add a pipe_context::resource_commit hook

so many structs

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