Commit graph

48291 commits

Author SHA1 Message Date
Karol Herbst
98280e8348 clover/memory: fix data race in buffer subclasses
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8765>
2021-05-10 12:20:21 +00:00
Alyssa Rosenzweig
dd64463d5f asahi: Pass through "reads tilebuffer?" bit
To be determined if there's more to this, but it's the only bit I see
varying with Metal when blending is enabled.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
e2332dea05 asahi: Fix shader key hash function
Fixes: 080b05e29e ("asahi: Add Gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
bedf1019be asahi: Call nir_lower_fragcolor
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:18:19 -04:00
Alyssa Rosenzweig
d76ab2b5d6 asahi: Add blend constant system value
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:18:19 -04:00
Alyssa Rosenzweig
30d1223247 asahi: Implement set_blend_color
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:18:19 -04:00
Alyssa Rosenzweig
6b7cc1fa8f asahi: Garbage collect bind_state
From noop.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:18:19 -04:00
Alyssa Rosenzweig
91b9839bf7 asahi: Call nir_lower_blend with selected key
Also need to key to pipe formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:18:11 -04:00
Alyssa Rosenzweig
f2179ed4f3 asahi: Augment Gallium key with blend state
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:17:50 -04:00
Alyssa Rosenzweig
77f1f12000 asahi: Translate blend CSO to lower_blend options
We'll just stick this in the key.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>
2021-05-09 23:17:49 -04:00
Mike Blumenkrantz
564519dc84 zink: rework memory_barrier hook again (third time's the charm)
this improves granularity for the barriers and is more in line with the
spec for glMemoryBarrier

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10706>
2021-05-10 02:21:13 +00:00
Mike Blumenkrantz
25ab2347f8 zink: fix texture barriers for real this time
according to spec, this is supposed to handle fragment shader fetch
from previous draw output, not color output readback from previous
color output write

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10706>
2021-05-10 02:21:13 +00:00
Mike Blumenkrantz
4ebae25e17 zink: break out draw dispatch into separate functions
this is much easier to read and is going to greatly simplify the eventual
multidraw implementation which will be dropped in

also it allows moving conditionals outside of loops to very slightly improve
drawoverhead performance (with multidraw)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10701>
2021-05-10 01:39:46 +00:00
Mike Blumenkrantz
9e5d927d22 zink: remove compute cruft from resource mapping
this used to sync the compute batch, now it does nothing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10707>
2021-05-10 01:12:36 +00:00
Mike Blumenkrantz
b0c51cdc9e zink: add debug assert to verify that zink_clear_framebuffer() is accurate
this should never be called for buffers that don't have pending clears

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10705>
2021-05-10 01:02:22 +00:00
Mike Blumenkrantz
5ac6c70214 zink: break zs clear loop once both bits are set when beginning renderpass
no point in looping this any more than we have to

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10705>
2021-05-10 01:02:22 +00:00
Mike Blumenkrantz
94aeb1041f zink: handle in-renderpass clears in fb_clears_apply_internal()
this isn't used yet, but it may as well be handled in case that changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10705>
2021-05-10 01:02:22 +00:00
Mike Blumenkrantz
b715aaa5f1 zink: only set layer info for samplerviews if there are multiple layers
fixes a bunch of validation errors

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
2021-05-10 00:52:08 +00:00
Mike Blumenkrantz
3c1ecb93d3 zink: simplify samplerview surface creation
instead of manually creating the ivci, there's already a util function for
that which will handle everything

also only set layer info if there are multiple layers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
2021-05-10 00:52:08 +00:00
Mike Blumenkrantz
b243b1d963 zink: add a target param to create_ivci()
allow creating views of different types than the base resource

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
2021-05-10 00:52:08 +00:00
Mike Blumenkrantz
438f0b31e2 zink: clamp 3D surface viewtype to 2D only in the create_surface hook
this is only applicable to things that go through the hook, not for internal
surfaces

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
2021-05-10 00:52:08 +00:00
Mike Blumenkrantz
0c2453bb59 zink: make ZINK_INLINE_UNIFORMS more standardized in function
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10696>
2021-05-10 00:41:31 +00:00
Jose Fonseca
24043d215f lavapipe: Fix lvp_pipeline_compile's nir_xfb_info leak.
v2: Cleanup, as suggested by Mike Blumenkrantz.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10688>
2021-05-08 07:17:49 +01:00
Jose Fonseca
c1609c3531 lavapipe: Fix lvp_execute_cmds' pipe_stream_output_target leak.
v2: Unbind SO targets, as suggested by Mike Blumenkrantz.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10688>
2021-05-08 07:17:49 +01:00
Vinson Lee
38de1cd5f0 nv50/ir: Initialize CodeEmitterNV50 member progType.
Make progType a constructor argument.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member progType is not initialized
in this constructor nor in any functions that it calls.

Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10562>
2021-05-08 01:31:20 +00:00
Vinson Lee
b1f6aa6e48 nv50/ir: Initialize BuildUtil member tail.
Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member tail is not initialized in
this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10561>
2021-05-08 01:21:35 +00:00
Vinson Lee
9b50ebfb2d nvc0: Remove unnecessary bsp_bo NULL check.
Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking bsp_bo suggests that it may be
null, but it has already been dereferenced on all paths leading
to the check.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10564>
2021-05-08 01:11:15 +00:00
Vinson Lee
2ba50c1a01 nv50/ir: Initialize Graph::Node member tag.
Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member tag is not initialized in
this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10563>
2021-05-07 17:49:11 -07:00
Mike Blumenkrantz
edd06995d7 zink: never use LINEAR for VK_EXT_4444_formats
we shouldn't be reading these back, and some drivers lie about what features
are supported in linear tiling anyway

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10702>
2021-05-07 21:13:46 +00:00
Adam Jackson
291aff3fcb gallium: Remove unused st_visual::render_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10675>
2021-05-07 16:47:30 -04:00
Ernst Sjöstrand
ca3dbecea6 nv50: Fix use of initializers on older compilers
Fixes the following error on Ubuntu 18.04 with GCC 7.

src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp:1448:72:
sorry, unimplemented: non-trivial designated initializers not supported
info_out->prop.cp.gmem[gmemSlot++] = {.valid = 1, .slot = i};

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Fixes: f451854f3 ("nv50: add remapping of buffers/images into unified space")
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10668>
2021-05-07 19:36:21 +00:00
Danylo Piliaiev
daad8f2245 freedreno/a5xx: SP_BLEND_CNTL has per-mrt blend enable bit
Blending in SP_BLEND_CNTL is not a binary flag but the same
mask as in RB_BLEND_CNTL. It is a per-mrt enable bit for blending.

Copied form a6xx, on a5xx it should be have the same since it seems
to have the same structure layout.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10682>
2021-05-07 19:12:17 +00:00
Danylo Piliaiev
14da2444a9 turnip,freedreno/a6xx: SP_BLEND_CNTL has per-mrt blend enable bit
Blending in SP_BLEND_CNTL is not a binary flag but the same
mask as in RB_BLEND_CNTL. It is a per-mrt enable bit for blending.

Example SP_BLEND_CNTL produced by blob on a630 and different MRT
blendings:
  SP_BLEND_CNTL: { UNK8 | 0x6 }
  SP_BLEND_CNTL: { ENABLED | UNK8 | 0xe }
(Decoded before this commit)

Fixes mis-rendering with D3D11 game "Spelunky 2".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10682>
2021-05-07 19:12:17 +00:00
Erik Faye-Lund
39a938ecf4 lavapipe: fix fsum with swizzle
We can do stuff like this:

vec1 32 ssa_207 = fsum3 ssa_209.xxx

In this case, we'd end up not swizzling in get_alu_src, and reading
components out-of-bounds, which LLVM isn't very happy about, and thus
takes punitive actions, in the form of a segfault.

We don't want that, and we already know from the opcode what the
component counts should be here.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10690>
2021-05-07 18:48:28 +00:00
Alyssa Rosenzweig
e0419c29cc panfrost: Use common blend lowering
Contains a number of bugfixes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10601>
2021-05-07 17:25:21 +00:00
Mike Blumenkrantz
91bd4fc613 zink: add a pipe_context::clear_buffer hook
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10679>
2021-05-07 17:00:30 +00:00
Boris Brezillon
0ab2336f3f panfrost: Use pan_blit() when PAN_MESA_DEBUG=panblit
Hook-up support for native blits. We keep using u_blitter by default
for now.

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/10548>
2021-05-07 15:58:56 +00:00
Boris Brezillon
e2b8f3d036 panfrost: Pass an image view to panfrost_estimate_texture_payload_size()
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/10548>
2021-05-07 15:58:56 +00:00
Matti Hamalainen
fefd853a56 gallium/tools: add option to use Meld for diffing
Add option -m/--meld to tracediff.sh to use Meld
<https://meldmerge.org/> instead of sdiff for comparing
traces.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
118e8a505a gallium/tools: improve pointer type tracking in parse.py
In our simplistic model of assigning types to pointer, we treat
return values specially because their "type" can't be known
easily before their first use. Improve the "ret" handling by
removing one from their count when we reassign the type to
something else.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
7ef828b563 gallium/tools: implement "high-level" overview mode option in dump scripts
As per the suggestion in #4609, implement mode/option -M/--method-only
which only prints call method names, for quick overview of what is
happening in the trace. The same option can be used with both
dump.py and tracediff.sh.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
0112e3c7ea gallium/tools: improve tracediff.sh argument handling
Implement better argument parsing/handling in tracediff.sh
so that the options passed to dump.py and sdiff are not required
to be positional.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
3369a132c4 gallium/tools: use left-column output mode of sdiff in tracediff.sh
Enabling --left-column option for sdiff inside tracediff.sh we
get output that only shows the differing lines on the right column.

This, when used with the -N/--named option should make many
trace diffs more understandable.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
d730c18bdb gallium/tools: implement 'named' pointers option in dump.py
As suggested by zmike in issue #4609, raw pointer values in
are problematic for diffing state dumps. In attempt to remedy
this, we implement an option --named/-N in dump.py that
generates symbolic names for all pointers based on the context.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
054b2afcb9 gallium/tools: implement better suppression of variants
Previously some variants (such as execution time and call number
were suppressed in tracediff.sh via a sed script. It makes sense
to implement an option to leave out such variants to begin with
in dump.py, so let's do so and use it.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
0834a42773 gallium/tools: improve option handling in dump_state.py
Previously we inherited some options from parse.py, but
that made no sense for some of the options that are not
needed for dump_state.py (such as --plain, as we output
only JSON format text.)

So, remove the inherit and implement filename argument
here independantly.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Matti Hamalainen
a6765412fe gallium/tools: clean up tracediff.sh a bit
Clean up tracediff.sh shellscript slightly, partially in preparation
for upcoming changes. Also add a signal handler for removing the
created temporary directory and files if we are interrupted.

Also, use the new --plain option of dump.py to suppress output
of ANSI color/formatting codes, so we do not have to post-filter
them later.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
2021-05-07 15:48:03 +00:00
Iago Toral Quiroga
e5fc2064fc v3d: re-enable GLSL loop unrolling
Disabling it that made us start to fail register allocation for a
few tests. Re-enable it until we figure out what is causing that.

Fixes: ca9e0871fb ('v3d: enable NIR loop unrolling')

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10684>
2021-05-07 12:34:36 +00:00
Gert Wollny
c80877b535 r600/sfn: lower to scalar with filter applied
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9943>
2021-05-07 12:09:03 +00:00
Dave Airlie
83a05caaf2 gallivm: handle texture arrays in non-fragment shaders with lod.
We have to unwind the lod into the scalar path correctly.

Fixes a crash with renderdoc demo

Fixes: e168d148d7 ("gallivm/nir: handle non-uniform texture offsets")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10676>
2021-05-07 02:41:29 +00:00