Commit Graph

47128 Commits

Author SHA1 Message Date
Juan A. Suarez Romero 557c86d6ce vc4: destroy renderonly object if present
When destroying the VC4 screen, check if renderonly exists before
freeing it.

This fixes for instance a segmentation fault caused when invoking
wflinfo.

Fixes: 187218395d ("renderonly: remove layering violations")
Reviewed-by: Andres Gomez <agomez@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9562>
2021-03-17 11:40:58 +00:00
Iago Toral Quiroga 1e4abf1fe3 vulkan/util: call glsl_type_singleton_init_or_ref from vk_instance_init
v2: link libvulkan_util with libglsl so it can find the glsl singleton symbols.
v3: link with libcompiler instead of libglsl (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> for the v3dv bits.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> for the turnip bits.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> for the radv bits.
Acked-by: Dave Airlie <airlied@redhat.com> for the lvp bits.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9457>
2021-03-17 08:15:36 +01:00
Mike Blumenkrantz 62d6ec083b zink: enable PIPE_CAP_INVALIDATE_BUFFER
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz d5367cee09 zink: invalidate resources on map when discarding range
we can dump the whole vulkan object here for this case, which ends up being
much neater

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz cfa361e6cd zink: handle streamout buffer rebinds
this really just means to nuke the counter buffer, and this can be done
by using a special bind_history bit that can be unset when the buffer has
been rebound

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz a00f10207c zink: set valid region for streamout buffers on bind
this catches rebinds and is more accurate about the state of the region

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz 8c1422dca5 zink: add a pipe_context::invalidate_resource hook
this creates new backing objects for the invalidated resource and, if
needed, rebinds it to any descriptor sets it might be used in by invalidating
the descriptor state and creating new view objects

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz d84c7c2a85 zink: remove direct samplerview batch-tracking
this moves tracking onto the surface/bufferview, which is more accurate
and allows the removal of a temporary hack in resource invalidation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz 2729513d29 zink: hook up resource bind history
seems like this should be a gallium thing with how many drivers copy/paste it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9546>
2021-03-17 01:40:55 +00:00
Mike Blumenkrantz 806c612131 ci/panfrost: disable the rest of these jobs temporarily
runners having a hard time right now

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9639>
2021-03-17 01:34:49 +00:00
Mike Blumenkrantz 08d8aee222 zink: ci updates
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 2f3b09e422 zink: set ntv variable descriptor sets during compile phase
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz c1cdf30a11 zink: apply Delete All The Code methodology to the ubo/ssbo variables
gallium rewrites all the ubo/ssbo instructions to use the buffer index as
the instruction src. the nir variables which are passed to zink after that
point are completely worthless, and it's impossible to accurately determine
which one corresponds to which buffer

thus, deleting all the variables and creating new ones based on the buffers
that are used is the best option, and it also enables simplifying a ton
of code as well as doing even better improvements in the future

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 769c6dce23 zink: move zink_binding() to compiler.c
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz dbbcf4e780 zink: directly set nir variable bindings for reuse during ntv
this lets us prepopulate the binding values without "fetching" them
twice

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 84293f5395 zink: flatten binding numbers a bit
now that descriptor types are split, we can just use the type-max values
per stage as the increment instead of all type max values

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz eeb23b15eb zink: break out sized uint array construction into util function
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 1950f8ec0c zink: add ntv util function for checking if a glsl type is an atomic counter
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 90a1aaf956 zink: add debug info about missing atomic ops
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 5783298027 zink: add unsized array type to get_glsl_type_element() handling
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 6399906843 zink: also break out whole ntv bo struct pointer construction
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 99a87a283a zink: break out bo array type construction into ntv util function
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 10bfe8759b zink: use intermediate var for glsl non-array type during shader create
minor readability change

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Mike Blumenkrantz 2b4609b66c zink: run nir_convert_from_ssa last during compile
running this too early breaks other passes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9624>
2021-03-17 01:27:00 +00:00
Dave Airlie a986d1ed63 lavapipe: add support for KHR_buffer_device_address.
Adds the missing magic lowering pass, and stores the pmem
pointer for easier returning to user.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9616>
2021-03-16 23:05:10 +00:00
Dave Airlie 7b8d53afdd lavapipe: only init immutable samplers for correct types.
This is ported from anv, and it needed to stop crashes with
the buffer_device_address CTS tests

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9616>
2021-03-16 23:05:10 +00:00
Dave Airlie c16f63b343 gallivm: convert packing to uint64 not double
Fixes some issues with later inttopotr casting.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9616>
2021-03-16 23:05:10 +00:00
Eric Anholt f3a7a8a4dc ci/freedreno: Switch the piglit testing to the new piglit runner.
Getting piglit to fit onto our test devices was proving difficult, and we
need the ability to handle flakes, so switch to the rust piglit runner
that @pepp wrote as part of the deqp-runner repo which gives us flake
detection, sharding across boards, fractional runs, and almost half the
runtime.

It doesn't handle piglit subtests yet, but if you can't run piglit's
python on your devices because it's too bloated and unstable, this is a
way forward.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9468>
2021-03-16 22:19:30 +00:00
Eric Anholt 0b4691d615 ci: Bump deqp-runner to v0.6.3.
This adds a piglit runner that we'll be using on freedreno, better
xfail/unexpectedpass handling for some cases (Missing->Pass, Warn->Warn),
better error logging for the Missing issue we've had in CI, a fix for a
source of Missing, and a pile more unit tests.

As a result, we now catch that the Missing results for a bunch of our
tests have gone away.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9468>
2021-03-16 22:19:30 +00:00
Eric Anholt 0a1c533c6e ci/panfrost: Disable t860/radeonsi testing while the runners are struggling.
These jobs keep getting stuck, so disable for now.  Info on what is going
on is at
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3437#note_841920 (the
grunt and stoney runners are maybe still operational at the moment)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9636>
2021-03-16 21:36:22 +00:00
Mike Blumenkrantz 4b063d636e zink: unset last_vertex_stage_dirty after applying it
turns out that having extra flags for stuff isn't that useful if you never reset them

Fixes: 9b8c121917 ("zink: flag shaders as needing update when clip_halfz changes")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9633>
2021-03-16 21:29:09 +00:00
Erik Faye-Lund 30cf07cc8a lavapipe: fix primitive-restart for uint8 indices
I forgot to add an implicit primitive-restart index for uint8 while
adding support for this initially. But we also have a nice little
helper to simplify this, so let's use that instead of open-coding.

Fixes: 6526e6d11b ("lavapipe: implement VK_EXT_index_type_uint8")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9622>
2021-03-16 21:17:16 +00:00
Mike Blumenkrantz 3aa2da96df zink: add missing null check
mismerged from an earlier patch...

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9623>
2021-03-16 20:42:43 +00:00
Rob Clark 441fba45ed freedreno: Fix fd_fence_finish()
fd_fence_create_unflushed() is called with the driver context, but
fd_fence_finish() is called with the threaded/frontend context, which
is what threaded_context_flush() expects to be passed.

Fixes: c4e5beef07 ("freedreno: threaded_context async flush support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9627>
2021-03-16 17:12:14 +00:00
Eric Anholt 739486de2f freedreno/a5xx: Fix the max texture buffer size.
The GLES minmax is 65536.  The blob vulkan exposes 65536 on both a5xx and
a6xx, but try just doing the same as we do for a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9617>
2021-03-16 16:15:48 +00:00
Eric Anholt b93d21810a freedreno/a5xx: Fix the texel buffer alignment requirement.
Info comes from the a540 vulkan blob driver minTexelBufferOffsetAlignment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9617>
2021-03-16 16:15:48 +00:00
Jesse Natalie 3b687722b3 d3d12: Really handle null constant buffers
Previous attempt was checking the wrong pointer...

Fixes: eb27db86 ("d3d12: Handle null constant buffers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4362
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9349>
2021-03-16 15:22:35 +00:00
Jesse Natalie 8708d32d9c d3d12: Handle is_new_style_shadow comparison filtering
Note: the tex instruction is modified in place, so the correct
number of expected result components needs to be cached before
the shadow state is modified

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9349>
2021-03-16 15:22:35 +00:00
Jesse Natalie 6db28f5201 d3d12: Move descriptor pools to screen, and add lock
Surfaces can be shared across contexts, and can even outlive the
original context that created them, so move the pools to the screen.
Since they no longer belong to a single context, they need a lock now.

v2: Samplers moved back to the context
v3: Fix Linux build

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3812
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9349>
2021-03-16 15:22:35 +00:00
Mike Blumenkrantz 23538ed7a8 zink: cache bufferviews
we can cache bufferviews just like we do surfaces, so let's do that

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz da2b841798 zink: properly handle null bufferview descriptor states
now that we have this state properly stored we can use it for more accurate
hashing and caching

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz ebdc0cd4ad zink: improve debug asserts for samplers/images during descriptor updates
these are now more accurate for null bufferviews/imageviews

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz 545625600b zink: update null descriptor hashes to reflect current descriptor states
also add a bufferview hash since we use these now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz c380a46036 zink: add helper function for getting a resource for a descriptor
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz 1b96e3e2b0 zink: massively beef up batch tracking for shader images
the struct for these isn't allocated, so we need to ensure that the objects
in it are explicitly tracked on batches when they're used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz 78068d039b zink: add extra batch tracking for sampler views
we're going to start invalidating and rebinding resources, which means
we need to be extra sure that we have our lifetimes in order here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz dc80529e1f zink: simplify bufferview and imageview descriptor state hashing
now that we have the hash for the internal objects available at all times, we
can directly reuse this instead of computing it each time, giving us more
accurate hashes as well as saving us cpu cycles

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz 473ee28cf3 zink: store bufferview hash to bufferview struct
this lets us do a lot of things more precisely for bufferviews

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz 5acbba4e41 zink: explicitly use zink_surface objects for sampler/image view objects
we can reuse this codepath instead of NIHing it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz 054f53e3d0 zink: use an explicit zink_buffer_view struct
this gives us an object to work with similar to zink_surface

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00