Start explicitly passing the pan_fb_info-pointer to use for building
preloads rather than implicitly fetching it from the passed
command_buffer.
This allows building preloads for different fb_infos, which is required
for incremental rendering.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
This commit provides a block-like macro to to define exception handlers
instead of requiring the user to call the start/end helpers.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
Make the register dump address dynamic instead of passing it at handler
creation time. This is needed for PanVK if we want to re-use the same
handlers for different VkQueues, since the dump buffer needs to be per
VkQueue.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
Align exception handlers to cache lines to allow having multiple
exception handlers in the same BO.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
This allows us to modify the exception handler start arguments without
having to modify the function declaration.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
Add support for masks to reg_perm in order to not erroneously hit
asserts for restricted registers that are parts of tuples but are not
read/written to due to register mask.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
The pass converts:
...
%.. = load_deref(input)
to:
temp = copy_deref(input) // beginning of the shader
...
%.. = load_deref(temp)
If interp_deref_at_* occurs between copy_deref and load_deref,
the interp_deref_at_* lowering overwrites temp, so all future
load_deref(temp) return the result of interp_deref_at_* instead of
copy_deref, which is incorrect.
The issue manifests when the same input is used by both load_deref
and interp_deref_at_* in the same shader and when interp_deref_at_*
happens to be before load_deref.
This fixes it by using a completely new temporary for each instance
of interp_deref_at_*.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32344>
This imports 35 libdrm_amdgpu functions into Mesa.
The following 15 functions are still in use:
amdgpu_bo_alloc
amdgpu_bo_cpu_map
amdgpu_bo_cpu_unmap
amdgpu_bo_export
amdgpu_bo_free
amdgpu_bo_import
amdgpu_create_bo_from_user_mem
amdgpu_device_deinitialize
amdgpu_device_get_fd
amdgpu_device_initialize
amdgpu_get_marketing_name
amdgpu_query_sw_info
amdgpu_va_get_start_addr
amdgpu_va_range_alloc
amdgpu_va_range_free
We can't import them because they make sure that we only use 1 VMID
per process shared by all APIs. (except the marketing name)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32067>
Builtin functions do no make use of gl_shader at all other than to store
a symbol table. So lets just create and use the symbol table directly
instead. This will allow us to drop the symbol table member from
gl_shader in the following patch.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32293>
This is no longer needed since we switched to a full nir base linker. The
symbol table witchcraft is now only used in the ast code.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32293>
This is a very silly case, but there's no reason not to handle it efficiently,
and this implementation is faster than the fallback. Noticed when playing with
scratch optimizations.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32322>
this can happen with CL, but it seems it's just informational.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32322>
The DETECT_OS_LINUX constant defined in util/detect_os.h allows
replacing the ocurrences of defined(__linux__) and __linux__. They
are equivalent in functionality but the util's one is easier to read and
write. Also it does not require the define() syntax.
The change involve replacing every ocurrence of defined(__linux__) with
DETECT_OS_LINUX. Then replacing every ocurrence of #ifdef __linux__
with #if DETECT_OS_LINUX.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32286>
The DETECT_OS_FUCHSIA constant defined in util/detect_os.h allows
replacing the ocurrences of defined(__Fushsia__) and __Fuschsia__. They
are equivalent in functionality but the util's one is easier to read and
write. Also it does not require the define() syntax.
The change involve replacing every ocurrence of defined(__Fuchsia__) with
DETECT_OS_FUCHSIA. Then replacing every ocurrence of #ifdef __Fuchsia__
with #if DETECT_OS_FUCHSIA.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32286>
The DETECT_OS_ANDROID constant defined in util/detect_os.h allows
replacing the ocurrences of defined(__ANDROID__) and __ANDROID__. They are
equivalent in functionality but the util's one is easier to read and
write. Also it does not require the define() syntax.
The change involve replacing every ocurrence of defined(__ANDROID__) with
DETECT_OS_ANDROID. Then replacing every ocurrence of #ifdef __ANDROID__
with #if DETECT_OS_ANDROID.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32286>
This is required to support VK_EXT_image_robustness properly as
otherwise the array index would be clamped to the array size on
TEX_FETCH and would not end up returning zeroes as expected by
the extension.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32331>
This will help prepare for multiplane, where panvk_image will have an array
of pan_image structs to represent the planes. The format modifier is the
same for all planes, so we can use vk_image::drm_format_mod.
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31776>
We currently support D32_S8 as a single-planar format on Bifrost, so
fix the panvk_plane_index() accordingly.
We will restore this once we move to multi-planar D32_S8, which should
happen soon.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31776>
We've supported GL_ARB_transform_feedback3 since 2019,
GL_ARB_draw_indirect and GL_ARB_texture_cube_map_array since 2021.
...you get the picture. There's more, and they've all been around for a
good while. But it seems we forgot to tell features.txt about them.
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32300>
Both of GL_OES_sample_shading and GL_OES_shader_multisample_interpolation
are enabled on panfrost when GL_OES_gpu_shader5 is enabled. And that's
the case on Bifrost and later, but not Midgard.
Let's fix up features.txt to match reality here.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32300>
We always support the extension. Wether we support any formats or not
depends on one of two conditions:
1. If Mesa is built with shader-cache support or not, which is not a
driver decision.
2. If GL_ARB_gl_spirv is supported or not, which is covered elsewhere.
So there's no reason to list individual drivers here, as that doesn't
really change anything.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32300>
Update panfrost to add support for NV16 and for the 10 bit
NV15 and NV20 formats.
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31854>
Although there are no DRI formats directly corresponding to 10bpp
planes (as used in e.g. NV15), some hardware can emulate NV15 with
R10_G10B10_420. Check for this in dri2_yuv_dma_buf_supported, so
that we can advertise support for these formats if available.
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31854>
Support external images with 10 bit YUV in NV15 and NV20 formats.
These are produced by some hardware decoders, so this will be
useful.
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31854>
Support for NV16 was kind of half done, by declaring it to be
NV12. That didn't actually work though, so add some more stuff
to make it work.
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31854>
Y8_U8V8_422_UNORM is more commonly known as NV16. There has been
a fourcc for NV16 for a while now, so let's rename it to be in
line with NV12 and similar formats.
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31854>
It's also possible to use ALL_GRAPHICS and PRE_RASTERIZATION as
alternatives.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32323>
This was obviously broken because demote results in more helper invocations.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: b447f5049b ("nir: Add a discard optimization pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32310>
When simul_use=true, the tiler descriptors are allocated from
the descriptor ringbuf. We set state.gfx.render.tiler to a
non-NULL value to satisfy the is_tiler_desc_allocated() tests,
but we want it to point to a faulty address so we can easily
detect if it's used in the command stream/framebuffer
descriptors.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32213>
Fix cross command buffer render pass suspend/resume by
emitting a render context (tiler+framebuffer descriptors)
on suspend that we can re-use on resume.
This involves splitting the issue_fragment_jobs() logic to
decouple the framebuffer descriptor initialization and the
run_fragment emission. This also requires patching a few
places where we were testing the tiler/fbd values to
determine if we are in a render pass, which no longer works
when a render pass is resumed.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32213>
This allows us to start from the HW reg file state instead of a
zero-initialized reg file.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32213>
We don't need to check anymore if this was already applied and it turned
out the check was not working properly in the first place.
The check for vs is kept in place, because that one still detects that
few wine shaders already have the sin/cos input in correct range.
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/32160>