mesa: add NV_copy_depth_to_color support for nir Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6289>
st/mesa: optimize DEPTH_STENCIL copies using fragment shader Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6088>
st/mesa: fix st_CopyPixels without support for stencil exports Fixes: f611af35948e ("st/mesa: use fragment shader to copy stencil buffer") Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5940>
st/mesa: use fragment shader to copy stencil buffer Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5836>
remove final imports.h and imports.c bits This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
mesa: remove no longer needed _mesa_is_bufferobj function All buffers have Name != 0. Note that there is no longer the pointer dereference to get Name, so it's faster. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
Move compiler.h and imports.h/c from src/mesa/main into src/util Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
gallium/cso_context: remove cso_delete_xxx_shader helpers to fix the live cache With the live shader cache, equivalent shaders can be backed by the same CSO. This breaks the logic that identifies whether the shader being deleted is bound. For example, having shaders A and B, you can bind shader A and delete shader B. Deleting shader B will unbind shader A if they are equivalent. Pierre-Eric figured out the root cause for this issue. Fixes: 0db74f479b9 - radeonsi: use the live shader cache Closes: #2596 Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4078> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4078>
gallium: pass cso_velems_state into cso_context instead of pipe_vertex_element This removes one memcpy from the CSO hashing code. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
st/mesa: use uint-result for sampling stencil buffers Otherwise, we end up mismatching the result-type and the sampler-type. Fixes: 642125edd97 ("st/mesa: use uint-samplers for sampling stencil buffers") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3680> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3680>
st/mesa: use uint-samplers for sampling stencil buffers Otherwise, we end up mismatching the sampler types when rendering. Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
st/mesa: unmap pbo after updating cache Unmapping first leads to accessing an invalid pointer. So let's switch these lines around. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
st/mesa: add st_variant base class to simplify code for shader variants Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
mesa/st: Reuse st_choose_matching_format from st_choose_format(). We had this ad-hoc exact size matching for unsized internalformats, but st_choose_matching_format() can do exactly what we want. This means, that, for example, we'll now prefer the matching ordering for 565/565_REV if the driver supports both orders. We also pass Unpack.SwapBytes through from ChooseTextureFormat so that we can hit the memcpy path for 8888 formats when that flag is set. Some interesting format choice changes from this (on softpipe): intf/form/type before after ---------------------------------------------------- RGBA/RGBA/USHORT: R8G8B8A8_UNORM -> RGBA_UNORM16 RGB/RGBA/8888: X8B8G8R8_UNORM -> R8G8B8X8_UNORM RGB/ABGR/8888_REV: X8B8G8R8_UNORM -> R8G8B8X8_UNORM RGBA/RGBA/5551: B5G5R5A1_UNORM -> A1B5G5R5_UNORM RGBA/RGBA/4444: R8G8B8A8_UNORM -> A4B4G4R4_UNORM RGBA/GL_RGBA/1010102: R8G8B8A8_UNORM -> A2B10G10R10_UNORM DEPTH/DEPTH/UINT: Z24X8 -> Z_UNORM32 DEPTH/DEPTH/USHORT: Z24X8 -> Z_UNORM16 v2: Make sure that the baseformat still matches. v1 would pick MESA_FORMAT_L16_UNORM for RED/LUMINANCE/SHORT, when we clearly want a red format. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
util: Move gallium's PIPE_FORMAT utils to /util/format/ To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
mesa/st: Add depth clamping to rasterizer code implemented by Erik Faye-Lund <erik.faye-lund@collabora.com> v2: Use current depth range values for clamping (Erik) v3: fix scons-win64 build Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Reviewed-by: Marek Olšák <marek.olsak@amd.com>
tree-wide: replace MAYBE_UNUSED with ASSERTED Suggested-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
gallium+mesa: fix tgsi_semantic array type Fixes: ed23335a313dfc9cec26 ("gallium: use enums in p_shader_tokens.h (v2)") Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
st/mesa: accelerate glCopyPixels(STENCIL) Tested-by: Dieter Nützel
gallium: Redefine the max texture 2d cap from _LEVELS to _SIZE. The _LEVELS assumes that the max is always power of two. For V3D 4.2, we can support up to 7680 non-power-of-two MSAA textures, which will let X11 support dual 4k displays on newer hardware. Reviewed-by: Marek Olšák <marek.olsak@amd.com>