Commit graph

56614 commits

Author SHA1 Message Date
Gert Wollny
a34003d472 r600/sfn: Always enforce LDS operation order
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
6b767f83c3 r600/sfn: Unroll loops after doing some optimizations
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
3290978053 r600/sfn: assert on use of abs modifier in op3
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
e840645bb7 r600/sfn:explicitly initialize the memory pool
This reduces the overhead of checking with each allocation
whether the pool is already initialized.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
04aea1c0ba r600/sfn: Use the correct allocator for loop lists
This fixes a memory leak.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
4b7ae72c46 r600/sfn: Fix typo
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
5bdbbe5399 r600/sfn: Delete final lowered nir shader early
Since this is no longer needed we can as well free the
memory right away instead of waiting until the parent
shader is freed.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
47bd2b7afc r600/sfn: Add peephole optimization for kill instructions
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
6de40d17ba r600/sfn: don't propagate registers into conditional test
We don't check whether the register is overwritten between the actual
conditional test and the test of the used result, so don't try to
optimize the evaluation of the conditional.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
99b7a12ec1 r600/sfn: Always start a new CF after a KILL instruction
Docu says:

   Ensure that the KILL* instruction is the last instruction
   in an ALU clause, because the remaining instructions executed
   in the clause do not reflect the updated valid state after
   the kill operation.

Fixes: 79ca456b48
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Gert Wollny
82b22e7fb9 r600/sfn: Only run 64 bit ops lowering passes when really needed
If the shader doesn't do 64 bit then there is no need to run these
lowering passes.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
2022-10-07 11:33:57 +02:00
Lucas Stach
ed3caf4866 etnaviv: pass shader key by reference
The shader key has grown substancially since the introduction of the
shadow sampler lowering to the point where passing it by value when
looking for the right variant matching the current state is showing
up in the CPU profiles. Pass the key by reference to get rid of this
overhead.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18968>
2022-10-07 08:36:31 +00:00
Lucas Stach
a1af7ae96a etnaviv: slim down etna_shader_key
The max number of exposed fragment samplers and views on any hardware is 16,
so there is no point in having arrays of 128 entries to track information
for the shadow sampler lowering in the shader key. Most of them will never
be used. Reduce the size of the arrays to what is actually necessary and add
a assert to make sure the sampler (view) limit isn't bumped without a
matching change in the shader key.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18968>
2022-10-07 08:36:31 +00:00
Lionel Landwerlin
1964899c28 intel: add INTEL_DEBUG=capture-all to capture everything upon hang
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewd-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18977>
2022-10-07 07:45:22 +00:00
Jason Ekstrand
650880105e vulkan,lavapipe: Use a tri-state enum for depth clip enable
This should make it a lot more clear how depth clip enables work.
Annoyingly, because of the way they originally worked in Vulkan 1.0,
it's dependent on the depth clamp if the state isn't set in the pipeline
and isn't declared dynamic.  The enum is explicitly set up so that
drivers don't need to be aware of this change unless they already
implement VK_EXT_extended_dynamic_state3.  If depth clamp/clamp are not
dynamic, depth clip will be either TRUE or FALSE which map to 1/0 so the
field can still be treated as a boolean.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18889>
2022-10-07 06:22:32 +00:00
Pavel Ondračka
0d3bc8c5b9 r300: be more careful when pair merging with presubtract
and when some argument reads both from rgb and apha. We would fail to
properly rewrite the sources in such case.

Consider the following instructions:
2: src0.xyz = const[3], src1.xyz = temp[6], srcp.xyz = (src1 - src0)
   CMP temp[8].x, src0.0__, src0.1__, srcp.x__
   ...
5: src0.xyz = const[1], src0.w = const[1]
   MAX temp[10].xy, |src0.xz_|, |src0.yw_|

We can merge them together into pair like
 2: src0.xyz = const[3], src1.xyz = temp[6], src2.xyz = const[1], src2.w = const[1], srcp.xyz = (src1 - src0)
    MAX temp[10].xy, |src2.xz_|, |src2.yw_|
    CMP temp[8].w, src0.0, src0.1, srcp.x

However the current code fails to do so properly and we end with this:
  2: src0.xyz = const[3], src0.w = const[1], src1.xyz = temp[6], src2.xyz = const[1], srcp.xyz = (src1 - src0)
     MAX temp[10].xy, |src2.xz_|, |src2.yw_|
     CMP temp[8].w, src0.0, src0.1, srcp.x
where the src2.w is undefined.

Just check for the the case where the arguments reads both from rgb and
alpha and bail out from the merge.

Fixes the following dEQPs:
dEQP-GLES2.functional.uniform_api.random.47
dEQP-GLES2.functional.uniform_api.value.initial.render.array_in_struct.float_vec4_both
dEQP-GLES2.functional.uniform_api.value.initial.render.basic_array.vec4_both

Only a minor change in shader-db with RV530:
total instructions in shared programs: 180847 -> 180864 (<.01%)
instructions in affected programs: 3178 -> 3195 (0.53%)
helped: 2
HURT: 16

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18991>
2022-10-07 05:40:00 +00:00
Brian Paul
458fc9ce81 cso: asst. clean-ups in cso_context.[ch]
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18954>
2022-10-05 19:03:27 +00:00
Brian Paul
faf8398893 cso: asst. clean-ups in cso_cache.[ch]
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18954>
2022-10-05 19:03:27 +00:00
Brian Paul
eaa93d7177 cso: use util_bitcount
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18954>
2022-10-05 19:03:27 +00:00
Brian Paul
983e06af2b cso: asst. clean-ups in cso_hash.[ch]
Consistent whitespace, move var decls to first use, add some const
qualifiers, etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18954>
2022-10-05 19:03:27 +00:00
Alyssa Rosenzweig
847361ba07 panfrost: Remove load_kernel_input path
Now the state tracker's responsible to lower away for us (and the state tracker
can do it correctly, our implementation is incorrect with a strict reading of
the Gallium contract).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18658>
2022-10-05 16:09:21 +00:00
Brian Paul
6dcad8a13b lavapipe: zero-init sampler objects
The cso code hashes these as a block of bytes.  This silences some
Valgrind uninitialized memory warnings and possibly avoids creating
some redundant sampler instances.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18953>
2022-10-05 14:55:57 +00:00
Brian Paul
2aac8ef125 lavapipe: remove continue statements in emit_state() to be more consistent
Rejig some dirty state checks to avoid continue and make it consistent
with surrounding code.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18953>
2022-10-05 14:55:57 +00:00
Emma Anholt
77515d722b zink: Map ETC1 to ETC2 to avoid uncompressing in the frontend.
Maybe the frontend should map for us in this case, but it's easy enough
here: ETC2 is an extension to use undefined states from ETC1, and is
backwards compatible.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18957>
2022-10-05 14:35:11 +00:00
Emma Anholt
061914ad83 zink: Enable ASTC texture format translation.
Without this, the frontend would decompress them for us without even the
kindness of a perf debug warning.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18957>
2022-10-05 14:35:11 +00:00
SoroushIMG
44894ba8b1 zink: enable native ETC2 if vk driver supports it
There is a 1-to-1 mapping from pipe to vk formats for ETC2.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18957>
2022-10-05 14:35:11 +00:00
Emma Anholt
270ea2ac7e zink: Skip border color clamping for compressed formats.
You won't have a non-void channel for block formats, because "how many
bits are there in the red channel" doesn't even make sense.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18957>
2022-10-05 14:35:11 +00:00
Emma Anholt
da04bbe586 ci/zink: Clear stale xfails for turnip.
The linked MR landed and fixed them.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18957>
2022-10-05 14:35:11 +00:00
Alejandro Tafalla
afe4b534b5 freedreno: Fix graphic glitches on a4xx and a5xx
Like on adreno 3xx, hw binning and scissor optimizations don't work correctly
together on a4xx and a5xx GPUs.

Disable binning as a workaround if scissor optimizations are being used.

Fixes: f68c6951b8 8efaae3e19

Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18925>
2022-10-05 13:04:07 +00:00
Lionel Landwerlin
1d32bcdcb2 iris: better error message with GuC loading failures
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18952>
2022-10-05 12:37:48 +00:00
Jeremy Rand
537176181e llvmpipe: bump LP_MAX_THREADS to 32
On my ppc64le machine with 32 hardware threads, this speeds up OpenArena
(1920x1200) from 7.2 fps to 8.1 fps.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18415>
2022-10-04 22:59:12 +00:00
Dave Airlie
6f27bf2504 gallivm: remove legacy pointer_get apis
These are no longer used.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
2022-10-05 06:20:42 +10:00
Dave Airlie
0c86524590 gallivm/sample: use retrieved types to do opaque pointer loads.
This uses the types to do the loads using opaque ptr interfaces.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
2022-10-05 06:20:37 +10:00
Dave Airlie
1a9889ae12 draw/llvmpipe: add way to return pointer types to generic code.
Some of the generic code tries to load from things it has no
types for, mip offsets, row and image strides.

Fix the interfaces to allow returning types for these.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
2022-10-05 06:20:20 +10:00
Dave Airlie
02c675b196 draw/llvmpipe: move texture/sampler/image member load to opaque.
This removes the non-opaque paths from the draw/lp sampling code.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
2022-10-05 06:20:14 +10:00
Dave Airlie
9fe8e5ccf7 gallivm/llvmpipe: add opaque pointers support to sampler
This adds explicit context types wiring through the sampler code

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
2022-10-05 06:20:11 +10:00
Dave Airlie
3d242c0447 llvmpipe/tests: port to new pointer interfaces.
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
2022-10-05 06:19:50 +10:00
José Roberto de Souza
03b959286e intel: Make engine related functions and types not i915 dependent
There is too much i915_drm.h code spread, this patch start to fix that
by re-organizing engine related code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18942>
2022-10-04 18:35:50 +00:00
Tapani Pälli
1cf1a94f97 intel: revert preemption disable via VFG changes
This register will not be whitelisted and this change will be
done in kernel instead.

This change reverts commits d5d4604a, ddcd6b38, 27c5b93d.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18897>
2022-10-04 10:38:49 +00:00
Dave Airlie
fbe7b6f6a2 gallium/tgsi: handle temps/outputs array.
The old code used GetElementType on a pointer, to pick a path,
I cant find a test to hit the second path, so just hardcode it
for now.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
4a0394f54a gallivm/tgsi: port tgsi to explicit types.
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
d728355f60 draw: handle primid for tess being a different pointer type
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
bbc1fe6585 draw: fix gs/tes explicit pointer handling
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
4ac29d1b4b llvmpipe/fs/linear: port to explicit pointers.
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
28afc22179 gallivm/llvmpipe: hand sample position type in for loading.
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
270668f7b1 gallivm/sample: move border color load to explicit pointers
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
61b2d2e0a8 gallivm/nir: fixup atomic path for explicit pointers.
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Dave Airlie
09d4eb92e8 gallivm/nir: move to explicit pointer interfaces.
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
2022-10-03 22:42:07 +00:00
Ruijing Dong
ba64f45124 d3d12: Updating refactored fields in pipe_h264_enc_picture_desc
Updating accesses to refactored fields in pipe_h264_enc_picture_desc

Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18877>
2022-10-03 16:45:27 +00:00
Ruijing Dong
e568d5d073 radeonsi/vcn: support aspect ratio and vui timing info
add aspect ratio and vui timing info into vui
for both avc/hevc encoder.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18877>
2022-10-03 16:45:27 +00:00