This matches the hardware's view of memory and helps catch spurious reads. (One
symptom of messing this up -- besides broken rendering -- is a kernel warning
about a "bogus texture handle 0".)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815>
A more natural place to put them, as the clear/store shaders use a similar
mechanism as the reload shaders. Now magic.c is exclusively kernel side piping.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815>
This uses Antonio's src/panfrost/perf for all the heavylifting, just
like the Perfetto producer. Unlike the Perfetto producer, it has no
dependencies and is a lot less useful. But it's a good smoke test.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
When the LD_VAR is only used once as an input to a texture instruction,
this is an improvement. We handle this case as a backwards pass.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
Set the .skip bit on texture instructions and the terminate discarded
threads bit on the clause header based on data flow analysis of helper
invocations. This code is adapted from Midgard, which requires the same
analysis with a few details changed.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
Redundant with the texture operation descriptor, but we don't want to
parse that in the rest of the compiler. Handling it as a pseudo-modifier
lets us share a code path with TEXS.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
Based on analysis of results from the Mali Offline Compiler. I am
uncertain how well these translate to real life, and they are
normalized counts only...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
This reduces number of spills and hence compile-time by avoiding
pointless decisions. In a terrain shader forced to use full threads:
Before: 39:168 spills:fills
After: 23:127 spills:fills
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
Bifrost v7 trades off register pressure and occupancy. If we restrict to
[R0, R15] U [R48, R63], we get full occupancy, but if we use the full
register file, we only get half occupancy. Try to allocate just 32
registers, and only use the full 64 registers if that would spill.
Clever heuristics could make this both more effective (live range
splitting, shuffling, spilling if deemed acceptable) and cheaper at
compile-time (tracking maximum liveness to determine if it's possible to
hit at all). For now, this should suffice.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
application_name_match is a regex... and DCC was also disabled for
DOOM Eternal (because DOOMEternal matches DOOM). Fun.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11805>
For virgl backend used in ARCVM, cros buffer info query brings back
real modifier info for the host image, which cannot be resolved by the
gallium virgl backend. Thus the fallback path is used here.
This patch fixes a behavior change introduced by a prior commit.
Fixes: 5d3e64f1 ("egl: android: prepare code for adding more buffer_info getters")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11771>
For compute shader textures that are backed by a display target, do not
leak the mapped pointer and unmap when access to the mapped resource is
not needed anymore.
Also use llvmpipe_resource_[un]map instead of calling winsys map
functions directly.
v2:
- use llvmpipe_resource_[un]map directly instead of winsys DT map
func and unneeded helper function for unmapping.
v3 (Emil Velikov):
- add comment in lp_csctx_set_sampler_views to explain
unmapping current texture early in the loop.
Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>
For fragment shader textures that are backed by a display target, do not
leak the mapped pointer, but unmap before unref'ing its associated
pipe_resource instances.
Also, make sure that the pointer that's mapped into a jit texture stays
valid while rasterization works on a jit context copy by mapping the
display target again during scene setup, and unmapping when finalizing
rasterization.
v2 (Daniel Stone):
- remove redundant helper function for [un]mapping DT, use
llvmpipe_resource_[un]map right away
v3 (Emil Velikov):
- add comment in lp_setup_set_fragment_sampler_views to explain
unmapping current texture early in the loop
Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>
Unmap display target in cleanup routine for sampler views that are using
textures backed by a display target.
v2:
- remove obsolete comment
Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>
Revive hooks for cleaning up shader sampler and image data and when
finalizing llvmpipe_draw_vbo. In cleanup routines, for any sampler or
image that was set up with displaytarget_map, call displaytarget_unmap.
This fixes leaks of mmap calls of the underlying displaytarget
resources.
v2 (Daniel Stone):
- Use a single cleanup function for sampler/image to simplify patchset
v3 (Emil Velikov):
- use llvmpipe_resource_[un]map instead of open-coding through
winsys
v4:
- check tex/image for NULL before calling into
llvmpipe_resource_unmap (fixes dEQP crash of llvmpipe runner)
Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>
Might fix spurious failures on GFX6 and some GFX7 chips.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11675>
We need to fill in the right line-mode here based on the state to get
the correct rasterization; bresenham isn't always the right one.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11795>
VK_EXT_line_rasterization allows us to specify a line-stilling pattern.
So let's do that.
While we're at it, use more bit-allocation here.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11795>
This reduces the size of the struct a bit, and we're about to add some
more bit-allocated stuff in the next commit.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11795>
The VK_EXT_line_rasterization extension allows to specify the
correct line-rasterization rules, which is needed for correct OpenGL
rendering.
So, let's prepare for filling this one out. Right now, it does a whole
lot of nothing, but that's about to change.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11795>
Example of blob's output:
(nop3) shlg.b16 hr8.x, (r)8, (r)hr8.x, 12
It does: (src2 << src1) | src2
src1 and src2 could be GPRs, relative GPRs, relative consts,
or immidiates. However, they could not be plain const registers.
Blob does use it in conjuncture with "samgq" instruction.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11760>