Commit Graph

118818 Commits

Author SHA1 Message Date
Jason Ekstrand fa3c38ceb3 spirv: Only run repair_ssa if structured
We shouldn't need it if we're unstructured and the pass assumes
structure so attempting to run it will assert-fail.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6750>
2020-09-30 16:46:11 +00:00
Jason Ekstrand 719c68016a nir/dominance: Use _mesa_set_clear instead ofhand-rolling it
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6750>
2020-09-30 16:46:11 +00:00
Jason Ekstrand b6a4172f10 nir/lower_goto_ifs: Don't destroy SSA form in the process
There are two issues here:

 1. If there are any phi nodes, we'll make complete hash of them.  This
    isn't likely actually a problem because spirv_to_nir doesn't
    generate any actual phi nodes today.  However, if we start doing any
    other passes before this, we may have a problem.

 2. Even without phi nodes, we may still break SSA form.  This can
    happen if we ever have to stick a block inside a conditional to
    satisfy weird CFG constraints.  Doing so can cause it to no longer
    look like it dominates some of its uses even though, at runtime,
    it's guaranteed to be run first.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6750>
2020-09-30 16:46:11 +00:00
Jason Ekstrand 6f134a622b nir/validate: Improve the validation of blocks
This commit adds a number of new validation checks:

 1. We now check that every block pointer in the IR points to a block
    that actually exists in a block list that's reachable from the
    nir_function_impl.

 2. We assert that nir_function_impl::body is non-empty

 3. We assert that the start block has no predecessors.  This is
    important because we tend to put run-once code there.

 4. We now validate some stuff on the end block.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6750>
2020-09-30 16:46:11 +00:00
Marek Olšák 4fb2eddfdf gallium/util: remove empty file u_half.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Marek Olšák 7a1deb16f8 gallium/util: remove redundant util_float_to_half_rtz
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Marek Olšák 2b6a172343 util: remove util_float_to_half and util_half_to_float wrappers
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Marek Olšák 5af81393e4 util: move util_half_to_float code into _mesa_half_to_float_slow
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Marek Olšák 87900afe5b util: implement f16c - fast half<->float conversions
This also happens to fix bptc-float-modes on llvmpipe.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Jason Ekstrand 7dbb1f7462 nir/cf: Better handle intra-block splits
In the case where end was a instruction-based cursor, we would mix up
our blocks and end up with block_begin pointing after the second split.
This causes a segfault as the cf_node list walk at the end of the
function never terminates properly.  There's also a possibility of
mix-up if begin is an instruction-based cursor which was found by
inspection.

Fixes: fc7f2d2364 "nir/cf: add new control modification API's"
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Jason Ekstrand 5e2e882270 nir: Disallow goto and goto_if in clone and [de]serialize
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Jason Ekstrand 9a48ed84ec nir/copy_propagate: Copy-prop into jump conditions
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Connor Abbott 7f0cd6f153 nir/opt_if: Use early returns in opt_if_merge()
We would've had to add yet another level of indentation, or duplicated
finding the if conditions in the next commit. Refactor this function to
use early returns like our other optimizations, so that this isn't an
issue.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Connor Abbott 656e428ff4 nir/opt_if: Remove open-coded nir_ssa_def_rewrite_uses()
So that we don't have to change these two places later.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Connor Abbott c6f871b62e nir/lower_returns: Use nir control flow insertion helpers
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Connor Abbott f103bded0b ttn: Use nir control flow insertion helpers
As a side effect, we can delete the whole control flow stack thing.

v2 (Jason Ekstrand):
 - Drop the ttn_if helper and just inline it in the two uses

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Connor Abbott f504eb683d radv: Use nir control flow insertion helpers
v2 (Jason Ekstrand):
 - Rebased and tweaked a few cases
 - Use the helpers in build_timestamp_query_shader

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Connor Abbott b2ede6280c intel/nir: Use nir control flow helpers
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
2020-09-30 15:47:51 +00:00
Bas Nieuwenhuizen 55e2b3424d radeonsi: Fix imports with displayable DCC.
Otherwise we reset the displayable DCC on import.

Fixes: c6c1fa9a26 "radeonsi: Put retile map in separate buffers."
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3577
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6918>
2020-09-30 11:39:03 +00:00
Jason Ekstrand 92a594b154 spirv: Delete the legacy offset/index UBO/SSBO lowering
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5275>
2020-09-30 07:20:39 +00:00
Jason Ekstrand 1cadbe5141 vallium: Stop using lower_ubo_ssbo_access_to_offsets
This legacy path needs to die.  Drivers shouldn't be using it anymore.
While we're here, we also implement the resource_reindex intrinsic which
doesn't come up in most direct-access cases but can depending on how the
OpAccessChains are structured.  It comes up all the time in the variable
pointers world.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5275>
2020-09-30 07:20:39 +00:00
Jason Ekstrand 657d49a9ba spirv: Use derefs for push constants
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5275>
2020-09-30 07:20:39 +00:00
Jason Ekstrand d3fa7451a6 anv,radv,tu,val: Call nir_lower_io for push constants
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5275>
2020-09-30 07:20:39 +00:00
Jason Ekstrand ac7537f155 nir/lower_io: Add support for push constants
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5275>
2020-09-30 07:20:38 +00:00
Jason Ekstrand 7a2b4ce22e nir: Allow creating variables with nir_var_mem_push_const.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5275>
2020-09-30 07:20:38 +00:00
Dave Airlie b0504ed682 llvmpipe: use an alternate env var to enable clover.
This can be used outside debug contexts.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6928>
2020-09-30 16:54:10 +10:00
Dave Airlie 760ba65733 gallivm/nir: handle non-32-bit mul high
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6928>
2020-09-30 16:54:07 +10:00
Dave Airlie 5d4502c085 gallivm/nir: fix up non 32-bit load stores
This fixes a bunch of opencl tests.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6928>
2020-09-30 16:54:04 +10:00
Dave Airlie 2891136050 gallivm: fix 64-bit CL intrinsics.
This fixes a bunch of bad casts in piglit tests

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6928>
2020-09-30 16:53:55 +10:00
Jonathan Marek 728061b968 turnip: signal fence and semaphore in AcquireNextImage2KHR
As a result of doing semaphores correctly, this is needed for things to
work correctly.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek e192f8f30a turnip: share code between semaphores/fences + fence import/export
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek 0497c9cb6c turnip: remove remaining uses of drmSyncobj helpers
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek c4d5010c54 turnip: rework ImportSemaphoreFdKHR
The behavior of OPAQUE_FD should be unchanged.

SYNC_FD case is reworked to be more like what anv does: a new temporary
syncobj is always created, with the CREATE_SIGNALED flag if necessary.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek 8343c32f5a turnip: rework GetSemaphoreFdKHR
Fixes:
- permanent payload not being restored for the OPAQUE_FD case
- incorrectly resetting the permanent payload in SYNC_FD case

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek fb76af24a2 turnip: semaphores simplification (only syncobj semaphores supported)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek 1dfb5a93d2 turnip: set MSM_SUBMIT_SYNCOBJ_RESET for submit pWaitSemaphores
From VK spec:

"the act of waiting for a binary semaphore also unsignals that semaphore"

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek 2a3f6e0267 turnip: always create permanent syncobj for semaphore
This allows non-exported semaphores to behave correctly instead of being
ignored in QueueSubmit().

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6719>
2020-09-30 00:32:40 +00:00
Jonathan Marek dcc278c722 turnip: clean up tu_device_memory
Delete unused code.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6913>
2020-09-29 23:24:32 +00:00
Dave Airlie d12cdc9374 gallivm: fix pow(0, y) to be 0
The log2(0) was producing bad results.

Fixes:
piglit pow tests on llvmpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6907>
2020-09-29 21:51:22 +00:00
Gert Wollny 89a1a3e9d6 r600/sfn: extend life range of all variables by one
This is a strange fix for some gles 3.1 tests with atomics. Maybed
the register holding the atomic add value can't be re-used in the
first instruction after an GDS instruction.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6925>
2020-09-29 21:30:42 +00:00
Gert Wollny 02245e38fc r600/sfn: Add support for more barrier instructions
These barriers should probably be global, but currently we only issue
a shared barrir (i.e. for only one wave front).

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6925>
2020-09-29 21:30:42 +00:00
Gert Wollny 48edb98a7e r600/sfn: Fix IDX register ID
Fixes: 9a6b11a733
   r600/sfn: Fix indirect const buffer access

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6925>
2020-09-29 21:30:42 +00:00
Gert Wollny 7683e27561 r600/sfn: Fix enabling the right interpolator for inerpolate_at_sample
Fixes: 73c5f45191
   r600/sfn: Fix interpolate at sample

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6925>
2020-09-29 21:30:42 +00:00
Rob Clark 16a3a56321 freedreno: Don't leak LRZ bo's
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6900>
2020-09-29 20:56:54 +00:00
Rob Clark 7454ae4ea6 freedreno/registers: Add a couple things used on kernel side
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6900>
2020-09-29 20:56:54 +00:00
Rob Clark 27c8d97657 freedreno/drm: Also clean ring_cache
We also need to release all the entries from the ring_cache when tearing
down the dev.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6900>
2020-09-29 20:56:54 +00:00
Rob Clark 98093e2780 freedreno/a6xx: Small cleanup
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6900>
2020-09-29 20:56:54 +00:00
Rob Clark 5be3cfdc13 freedreno: Don't leak border_color_buf reference
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6900>
2020-09-29 20:56:54 +00:00
Rob Clark 69a3ef6511 freedreno/drm: drop bo's dev reference
This is a bit over-paranoid, and can cause drm device fd leaks if there
is a bo leak somewhere.  Which is kind of a worse outcome.

This "fixes" a fd leak seen in:

dEQP-EGL.functional.query_context.get_current_display.*
dEQP-EGL.functional.query_context.get_current_context.*
dEQP-EGL.functional.query_context.get_current_display.*

(Still tracking down the root leak)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6900>
2020-09-29 20:56:54 +00:00
Mike Blumenkrantz 6a20c630b9 zink: unify all occurrences of waiting on a fence
this was duplicated in a few places

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6922>
2020-09-29 20:49:15 +00:00