Fixes the piglit tex-miplevel-selection test by:
1. properly taking texture baselevel and maxlevel into account
2. only enable lodbias when mipmapping is enabled
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/7634>
The DRM_RDWR flag is needed for mmap with PROT_WRITE to work.
Cc: mesa-stable
Signed-off-by: Robin Ole Heinemann <robin.ole.heinemann@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8075>
According to ANDROID_get_native_client_buffer, EGL implementations must
guarantee that the lifetime of an EGLClientBuffer returned by
eglGetNativeClientBufferANDROID is at least as long as that of the
EGLImage which is bound to. Do this by acquiring a reference to the
underlying AHardwareBuffer for all ANativeWindowBuffers which are bound
to an _EGLImage.
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
The callback may be used by dri drivers to perform cleanup when images
are destroyed. It is added to the dri2 and image loader extensions.
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
This is a noop, as no loader extensions pass a __DRIimage's
loader_private data back to the loader.
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
It's hooked up in all the pipe wrapper drivers, and all the
frontends except a couple places in glx/xlib.
This enables a more efficient path for drivers which use
swrast's Present, but hardware rendering (e.g. d3d12, zink).
Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Marek Olák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8045>
The small DCE of the spiller only removes the original instructions
of rematerialized variables in case they are unused. If a variable
has been renamed, it cannot match any original instruction anymore.
Thus, the lookup is then unnecessary and can be omitted.
No fossil-db changes.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8055>
Without it, FragCoord.z will have the value of one of the fine pixels
instead of the center of the coarse pixel.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7837>
Without it, FragCoord.z will have the value of one of the fine pixels
instead of the center of the coarse pixel.
It's only enabled for RADV.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7837>
Only supported on GFX10.3+. Attachment Fragment Shading Rate is
for later.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7837>
These register definitions are copied from AMDVLK because they
aren't even in the kernel.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7837>
This naming change should clarify what we are actually doing here.
We are defining/managing what data is stored in the GPUs
uniform data storage area. A shader can access this area with
the ETNA_RGROUP_UNIFORM register group.
In this uniform data area we need to store const buffer data and
own immediate/constant data.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8062>
If the image tiling is set to VK_IMAGE_TILING_LINEAR,
buffer_set_metadata will read an uninitialized radeon_bo_metadata.
Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: d5fd8cd46e ("radv: Allow non-dedicated linear images and buffer.")
Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7898>
the code here tries to be too smart and only use a geometry shader if there's
actually multiple layers being uploaded, but the fragment shader also unconditionally
reads gl_Layer as long as the pipe cap for gs is set, which means that
in the case when the gs is dynamically disabled due to uploading a
single-layer surface, the fs has no input to read for gl_Layer and everything breaks
always using a gs isn't ideal, but it's considerably more work to manage multiple
fs variants based on layer usage
Fixes: c99f2fe70e ("st/mesa: implement PBO upload for multiple layers")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8067>
I got confused and:
* used the vkformat instead of the pipe format for getting format description
* incorrectly calculated bpp
but this time it's definitely 100% fixed I promise
Fixes: 456b57802e ("zink: fix direct image mapping offset")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8074>
cmd_size was changed to size_t in commit 4b2445916e ("glthread:
change sizes to unsigned or size_t where needed").
Fix defect reported by Coverity Scan.
Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned
value is never true. cmd_size < 0UL
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8024>
Fix defects reported by Coverity Scan.
Identical code for different branches (IDENTICAL_BRANCHES)
identical_branches: The same code is executed regardless of
whether 0 is true, because the 'then' and 'else' branches are
identical. Should one of the branches be modified, or the entire
'if' statement replaced?
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8001>
Fix defect reported by Coverity Scan.
Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In texObj = texObj = _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt], texObj is written twice with the same value.
Fixes: d0e18550e2 ("mesa: optimize saving/restoring bound textures for glPush/PopAttrib")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8000>
With the block's end_ip accidentally being the ip of the next instruction,
contrary to the comment, you would end up doing end-of-block freeing early
and have the value missing when it came time to emit the next instruction.
Just expand the ips to have separate ones for start and end of block --
while it means that nir_instr->index is no longer incremented by 1 per
instruction, it makes sense for use in liveness because a backend is
likely to need to do other things at block boundaries (like emit the if
statement's code), and having an ip to identify that stuff is useful.
Fixes: a206b58157 ("nir: Add a block start/end ip to live instr index metadata.")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7658>
It made the nir_print_shader() for NIR_TO_TGSI_DEBUG not match up with the
instructions being emitted, confusing me. Given that I'm seeing only like
1/3 shrinking in the SSA indices, just drop the reindexing since it's not
doing much (and we don't store that much per SSA index).
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7658>
Getting the live SSA defs will do it if necessary, and that liveness is
what we use the instr index for. (We used to need to do it manually, and
cleanups for merging resulted in the index being treated as metadata).
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7658>
In 2900f82e19 I mistakenly used tc_set_resource_reference in both
tc_transfer_unmap and tc_call_transfer_unmap.
This causes a leak because tc_call_transfer_unmap clears dst before
acquiring a reference, so it must only be used when initializing
tc_payloads.
This fixes the perf drop reported by Marek in MR 7098.
Fixes: 2900f82e19 ("gallium/u_threaded: fix staging and non-staging conflicts")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8035>
Add support for the half float texel type and pixel types.
This enables the OES_texture_half_float extension.
Tested with piglit test oes_texture_float (half float and with linear
filtering) and passes all deqp half float related tests.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8020>
In targets that support half float textures but not float textures (so
without ARB_texture_float), the previous logic did not allow for
enabling half float texture support in desktop OpenGL.
OES_texture_half_float is only valid for OpenGL ES 2.0 contexts, so
include ARB_half_float_pixel in the logic to cover OpenGL too.
Remove _mesa_is_gles3 from the check since in case of a gles3 context,
OES_texture_half_float is already assumed to be enabled.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8020>
the x and y offsets here were improperly calculated without taking into account:
* layer/level offset
* x/y coord bpp
Fixes: 8d46e35d16 ("zink: introduce opengl over vulkan")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8058>
Now that we've soaked the Windows build in and it's working well,
restrict it to only running on given pipelines, albeit in a somewhat
surprising way.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8053>