platform/upstream/mesa.git
23 months agoutil: Fixes memory leak in u_printf_test.cpp
Yonggang Luo [Sun, 7 Aug 2022 14:33:50 +0000 (22:33 +0800)]
util: Fixes memory leak in u_printf_test.cpp

That's Fixes: bdc0a862 ("printf: add some unit tests")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18024>

23 months agoutil: Fixes memory leak in create_cache_item_header_and_blob
Yonggang Luo [Sun, 7 Aug 2022 15:46:13 +0000 (23:46 +0800)]
util: Fixes memory leak in create_cache_item_header_and_blob

stack-trace by asan
Direct leak of 238 byte(s) in 6 object(s) allocated from:
    #0 0x7f101e1dbe8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55ce3a959e2c in create_cache_item_header_and_blob ../src/util/disk_cache_os.c:647
    #2 0x55ce3a95c217 in disk_cache_write_item_to_disk_foz ../src/util/disk_cache_os.c:967
    #3 0x55ce3a97bce1 in util_queue_thread_func ../src/util/u_queue.c:306
    #4 0x55ce3a989c3b in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #5 0x7f101ddc7ea6 in start_thread nptl/pthread_create.c:477

Fixes: 2a9b4ad1774 ("util/disk_cache: Add option to disable compression")

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18024>

23 months agointel: Fixes compile error of aubinator_viewer.cpp with gcc
Yonggang Luo [Sun, 7 Aug 2022 12:47:48 +0000 (20:47 +0800)]
intel: Fixes compile error of aubinator_viewer.cpp with gcc

Remove '-Wno-class-memaccess' from cpp_args because clang don't support this option

aubinator_viewer.cpp:1183:39: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct Context'; use assignment or value-initialization instead [-Werror=class-memaccess]
 1183 |    memset(&context, 0, sizeof(context));

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18024>

23 months agopanfrost: Do no use designated initializer for union
Yonggang Luo [Sun, 7 Aug 2022 14:23:15 +0000 (22:23 +0800)]
panfrost: Do no use designated initializer for union

../src/panfrost/lib/tests/test-earlyzs.cpp: In function 'void test(pan_earlyzs, pan_earlyzs, uint32_t)':
../src/panfrost/lib/tests/test-earlyzs.cpp:59:4: error: 'pan_shader_info::<unnamed union>' has no non-static data member named 'can_discard'
   59 |    };
      |    ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18024>

23 months agonine: Fixes compile of nine_pipe.h with clang
Yonggang Luo [Sun, 7 Aug 2022 13:20:00 +0000 (21:20 +0800)]
nine: Fixes compile of nine_pipe.h with clang
../../src/gallium/frontends/nine/nine_pipe.h:377:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
        default:
        ^
../../src/gallium/frontends/nine/nine_pipe.h:377:9: note: insert 'break;' to avoid fall-through
        default:

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18024>

23 months agomeson: Microsoft / maybe Intel CLC need the all-targets workaround
pal1000 [Thu, 21 Jul 2022 10:59:11 +0000 (13:59 +0300)]
meson: Microsoft / maybe Intel CLC need the all-targets workaround
just like clover

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5666
Fixes: 1506ea2ecb ("Move a bunch of the CLC stuff from src/microsoft to common code")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17682>

23 months agomeson: Don't include glsl compiler if flex/bison aren't found
Jesse Natalie [Fri, 22 Jul 2022 22:47:46 +0000 (15:47 -0700)]
meson: Don't include glsl compiler if flex/bison aren't found

Use a disabler for not-found, which causes the GLSL targets to simply
not be generated if the tools don't exist.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17724>

23 months agoutil: Add os_create_anonymous_file support on win32
Yonggang Luo [Mon, 28 Mar 2022 16:41:50 +0000 (00:41 +0800)]
util: Add os_create_anonymous_file support on win32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18017>

23 months agomeson: Enable graw tests on mingw
Yonggang Luo [Thu, 11 Aug 2022 02:24:31 +0000 (10:24 +0800)]
meson: Enable graw tests on mingw

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18016>

23 months agozink: stop skipping bunch of GLESx tests
Samuel Pitoiset [Fri, 12 Aug 2022 07:58:09 +0000 (09:58 +0200)]
zink: stop skipping bunch of GLESx tests

Did 5 runs in Mesa CI (gles-navi10-valve) and 5 runs with vk-cts-image
on Navi21 without any GPU hangs. I think it's safe to re-enable them.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18029>

23 months agozink: Use DETECT_OS_WINDOWS instead of 'WIN32'
Yonggang Luo [Thu, 11 Aug 2022 02:12:34 +0000 (10:12 +0800)]
zink: Use DETECT_OS_WINDOWS instead of 'WIN32'

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>

23 months agoutil: Enable tests that disabled for msvc/mingw
Yonggang Luo [Wed, 30 Mar 2022 23:48:50 +0000 (07:48 +0800)]
util: Enable tests that disabled for msvc/mingw

mesa-sha1_test.cpp and string_buffer_test.cpp are working fine now

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>

23 months agoutil: Use `DETECT_OS_WINDOWS` instead `WIN32` in u_process.c
Yonggang Luo [Mon, 16 May 2022 20:44:07 +0000 (04:44 +0800)]
util: Use `DETECT_OS_WINDOWS` instead `WIN32` in u_process.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>

23 months agoutil: Implement os_get_available_system_memory on Win32
Yonggang Luo [Tue, 29 Mar 2022 20:45:31 +0000 (04:45 +0800)]
util: Implement os_get_available_system_memory on Win32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>

23 months agoutil: Fixes typo in function os_get_total_physical_memory
Yonggang Luo [Tue, 29 Mar 2022 20:44:55 +0000 (04:44 +0800)]
util: Fixes typo in function os_get_total_physical_memory

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>

23 months agoutil: Implement util_thread_get_time_nano on win32
Yonggang Luo [Tue, 29 Mar 2022 20:32:39 +0000 (04:32 +0800)]
util: Implement util_thread_get_time_nano on win32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>

23 months agomesa/st: simplify sampler border color swizzling
Mike Blumenkrantz [Mon, 1 Aug 2022 14:41:49 +0000 (10:41 -0400)]
mesa/st: simplify sampler border color swizzling

this reuses the pre-calculated swizzle value to resolve a TODO item and
improve perf

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa/st: use tracked samplerview swizzle values
Mike Blumenkrantz [Mon, 1 Aug 2022 14:37:51 +0000 (10:37 -0400)]
mesa/st: use tracked samplerview swizzle values

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa: track gl_texture_object swizzle internally
Mike Blumenkrantz [Mon, 1 Aug 2022 14:34:57 +0000 (10:34 -0400)]
mesa: track gl_texture_object swizzle internally

this moves updating of swizzles to the points at which it could possibly change

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa/st: use pre-calculated format swizzle for samplerviews
Mike Blumenkrantz [Mon, 1 Aug 2022 14:01:56 +0000 (10:01 -0400)]
mesa/st: use pre-calculated format swizzle for samplerviews

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa: track format swizzles on teximage objects
Mike Blumenkrantz [Mon, 1 Aug 2022 14:00:01 +0000 (10:00 -0400)]
mesa: track format swizzles on teximage objects

this will only very rarely change, so stop calculating it during sampler update

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agozink: add a driver workaround for broken L4A4 on nvidia
Mike Blumenkrantz [Wed, 3 Aug 2022 20:33:10 +0000 (16:33 -0400)]
zink: add a driver workaround for broken L4A4 on nvidia

KHR-GLES2.core.internalformat.copy_tex_image.luminance4_alpha4_oes,Fail
KHR-GLES2.core.internalformat.texture2d.luminance_alpha_unsigned_byte_luminance4_alpha4_oes,Fail

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agozink: support emulating alpha formats using new border color quirk
Mike Blumenkrantz [Tue, 2 Aug 2022 12:34:12 +0000 (08:34 -0400)]
zink: support emulating alpha formats using new border color quirk

this works for texturing only because swizzles can be used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agozink: handle emulated alpha format clears
Mike Blumenkrantz [Tue, 2 Aug 2022 12:33:02 +0000 (08:33 -0400)]
zink: handle emulated alpha format clears

technically zink doesn't support this, but mesa/st doesn't care what drivers
support for clears

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agozink: reject native blits for emulated alpha formats
Mike Blumenkrantz [Tue, 2 Aug 2022 12:31:56 +0000 (08:31 -0400)]
zink: reject native blits for emulated alpha formats

these need u_blitter

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agozink: add some format functions for emulating alpha formats
Mike Blumenkrantz [Tue, 2 Aug 2022 12:31:33 +0000 (08:31 -0400)]
zink: add some format functions for emulating alpha formats

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agozink: stop modifying samplerview swizzle on base struct
Mike Blumenkrantz [Thu, 21 Jul 2022 16:59:19 +0000 (12:59 -0400)]
zink: stop modifying samplerview swizzle on base struct

this gets (stupidly?) checked in mesa/st, so changing it might trigger
erroneous asserts

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agoutil/format: handle SRGB in util_format_luminance_to_red()
Mike Blumenkrantz [Wed, 20 Jul 2022 20:29:43 +0000 (16:29 -0400)]
util/format: handle SRGB in util_format_luminance_to_red()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agogallium: add PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_ALPHA_NOT_W
Mike Blumenkrantz [Thu, 21 Jul 2022 15:42:28 +0000 (11:42 -0400)]
gallium: add PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_ALPHA_NOT_W

mesa/gallium and util_format have different handling of alpha channels:
* mesa/gallium always uses w for the alpha swizzle
* util_format uses the actual component

for drivers which need to use the latter handling, this quirk will use the right
border color

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agogallium: convert PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE to enum
Mike Blumenkrantz [Thu, 21 Jul 2022 14:15:56 +0000 (10:15 -0400)]
gallium: convert PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE to enum

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa/st: use plumbed value for srgb_skip_decode in sampler conversion
Mike Blumenkrantz [Thu, 21 Jul 2022 15:41:55 +0000 (11:41 -0400)]
mesa/st: use plumbed value for srgb_skip_decode in sampler conversion

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa/st: plumb glsl130_or_later through sampler creation
Mike Blumenkrantz [Thu, 21 Jul 2022 13:55:44 +0000 (09:55 -0400)]
mesa/st: plumb glsl130_or_later through sampler creation

no functional changes

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa/st: add ignore_srgb_decode param to st_convert_sampler
Mike Blumenkrantz [Thu, 21 Jul 2022 13:27:30 +0000 (09:27 -0400)]
mesa/st: add ignore_srgb_decode param to st_convert_sampler

same as st_get_texture_sampler_view_from_stobj, no functional changes

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa: require render target bind for A/L/I in format selection
Mike Blumenkrantz [Tue, 2 Aug 2022 13:24:35 +0000 (09:24 -0400)]
mesa: require render target bind for A/L/I in format selection

these are required framebuffer formats in certain versions of GL,
so don't create a texture that can't later be bound to a framebuffer

see also spec@!opengl 3.0@required-texture-attachment-formats

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months agomesa: fix blending when using luminance/intensity emulation
Mike Blumenkrantz [Tue, 9 Aug 2022 20:56:08 +0000 (16:56 -0400)]
mesa: fix blending when using luminance/intensity emulation

neither of these have a real alpha channel, so reuse the xrgb blend
clamping here to ensure the "right" alpha value is used

cc: mesa-stable

fixes:
spec@arb_texture_float@fbo-blending-formats

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

23 months ago.mailmap: change spelling for Constantine Kharlamov
Konstantin Kharlamov [Wed, 10 Aug 2022 00:20:19 +0000 (03:20 +0300)]
.mailmap: change spelling for Constantine Kharlamov

The officially used spelling is Konstantin and I've been using it
everywhere for quite some time, so let's change it here as well

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>

23 months agomeson: remove source_root() call in main meson.build
Konstantin Kharlamov [Tue, 9 Aug 2022 23:53:18 +0000 (02:53 +0300)]
meson: remove source_root() call in main meson.build

source_root function is deprecated in Meson version 0.56.0, so let's use
instead a current_source_dir() function, available in all Meson
versions.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>

23 months agomeson: remove source_root() call in nir compiler path
Konstantin Kharlamov [Tue, 9 Aug 2022 23:04:51 +0000 (02:04 +0300)]
meson: remove source_root() call in nir compiler path

source_root function is deprecated in Meson version 0.56.0, so let's use
instead a current_source_dir() function, available in all Meson
versions. This also allows to deduplicate some code by declaring
commonly used string at the top meson.build file.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>

23 months agoloader/dri3: remove a no-op free call
Konstantin Kharlamov [Tue, 9 Aug 2022 22:24:39 +0000 (01:24 +0300)]
loader/dri3: remove a no-op free call

When modifiers == NULL, the free(modifiers) is a no-op, so we can just
remove it

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>

23 months agoloader/dri3: simplify check for reply
Konstantin Kharlamov [Tue, 9 Aug 2022 22:18:16 +0000 (01:18 +0300)]
loader/dri3: simplify check for reply

if reply == NULL, the call `free(reply)` is a no-op, so we can have a
single check instead of two.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>

23 months agoisl: fix bug where sb.MOCS is not being set
sjfricke [Wed, 10 Aug 2022 12:15:27 +0000 (21:15 +0900)]
isl: fix bug where sb.MOCS is not being set

Currently the sb.MOCS is being reset to zero after struct init.

Signed-off-by: sjfricke <spencerfricke@gmail.com>
Fixes: c27fcb1d3ba ("isl: Fill in MOCS for NULL depth, stencil, and HiZ buffers.")
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17985>

23 months agoglsl: add check for too large atomic counter buffer offset
Tapani Pälli [Fri, 5 Aug 2022 08:00:27 +0000 (11:00 +0300)]
glsl: add check for too large atomic counter buffer offset

Fixes upcoming CTS test for atomic counter buffer offsets.

   "It's being clarified that placing an atomic counter into
    a buffer at such an offset that the buffer is too large
    results in a compilation error."

https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3124

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17905>

23 months agopvr: fix memleak in error paths
Eric Engestrom [Fri, 12 Aug 2022 08:31:20 +0000 (09:31 +0100)]
pvr: fix memleak in error paths

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18027>

23 months agoAndroid.mk: Disable lmsensors
Alessandro Astone [Thu, 7 Jul 2022 08:34:37 +0000 (10:34 +0200)]
Android.mk: Disable lmsensors

Meson might incorrectly enable sensors if it detects lmsensors
on the host system.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6805
Cc: "22.0" "22.1" "22.2" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17391>

23 months agoutil/xmlconfig: allow drivers to override option values
Marek Olšák [Wed, 10 Aug 2022 00:41:01 +0000 (20:41 -0400)]
util/xmlconfig: allow drivers to override option values

This corrects the issue that we can't have DRI_CONF_MESA_GLTHREAD(false)
in gallium and then DRI_CONF_MESA_GLTHREAD(true) in drivers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>

23 months agoglthread: add missing code for GL_ARB_sparse_texture
Marek Olšák [Wed, 10 Aug 2022 01:23:22 +0000 (21:23 -0400)]
glthread: add missing code for GL_ARB_sparse_texture

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>

23 months agoglthread: track glBindFramebufferEXT, not just glBindFramebuffer
Marek Olšák [Tue, 9 Aug 2022 23:46:37 +0000 (19:46 -0400)]
glthread: track glBindFramebufferEXT, not just glBindFramebuffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>

23 months agoglthread: track GL_READ_FRAMEBUFFER bindings too
Marek Olšák [Tue, 9 Aug 2022 23:45:08 +0000 (19:45 -0400)]
glthread: track GL_READ_FRAMEBUFFER bindings too

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>

23 months agoglthread: call _mesa_glthread_DeleteBuffers unconditionally
Marek Olšák [Tue, 9 Aug 2022 23:15:35 +0000 (19:15 -0400)]
glthread: call _mesa_glthread_DeleteBuffers unconditionally

Deleted buffers were not unbound in glthread.

Fixes: 4fa24747b9089b - glthread: call _mesa_glthread_BindBuffer unconditionally

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>

23 months agoglthread: unbind framebuffers in glDeleteFramebuffers
Marek Olšák [Tue, 9 Aug 2022 23:10:35 +0000 (19:10 -0400)]
glthread: unbind framebuffers in glDeleteFramebuffers

Tests:
    dEQP-GLES2.functional.lifetime.delete_bound.framebuffer
    dEQP-GLES2.functional.state_query.integers.framebuffer_binding_getinteger

Fixes: e48f676835d - glthread: don't sync for more glGetIntegerv enums for glretrace

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>

23 months agoglsl: allow image*Shadow keywords on ES and GLSL >= 420
Tapani Pälli [Fri, 5 Aug 2022 06:15:04 +0000 (09:15 +0300)]
glsl: allow image*Shadow keywords on ES and GLSL >= 420

These were not reserved keywords in GLSL ES and also allowed on
desktop GLSL after 420. New CTS compiler tests will test this.

https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3007

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17904>

23 months agointel/drm-shim: update shim to support DG2
Lionel Landwerlin [Thu, 11 Aug 2022 10:25:17 +0000 (13:25 +0300)]
intel/drm-shim: update shim to support DG2

We were missing :
  * GEM_CREATE_EXT (for local memory allocations)
  * MMAP_OFFSET (new version of mmap required on DG2)
  * GEOMETRY_SUBSLICE query (also required on DG2)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18005>

23 months agomesa/st: fix reference to nir->info after nir_to_tgsi
Charmaine Lee [Tue, 9 Aug 2022 01:02:30 +0000 (18:02 -0700)]
mesa/st: fix reference to nir->info after nir_to_tgsi

The nir shader memory is freed in nir_to_tgsi(), but the already
freed shader info is referenced later when create compute state.
To avoid referencing the freed memory, copy the shader info first before
calling nir_to_tgsi.

Fixes vmx crash running aztec on SVGA driver.
Fixes: 580f1ac4736 ("nir: Extract shader_info->cs.shared_size out of union")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17999>

23 months agosvga: compare graphics shader stages against COMPUTE
Charmaine Lee [Thu, 11 Aug 2022 04:52:19 +0000 (21:52 -0700)]
svga: compare graphics shader stages against COMPUTE

This patch fixes the graphics shader stage comparisons that are left out in
commit 9bbf235fd9d.

Fixes: 9bbf235fd9d ("svga: compare shader type against compute not tess eval")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18004>

23 months agoradv: Fix stack size calculation with stage ids
Konstantin Seurer [Mon, 8 Aug 2022 10:37:42 +0000 (12:37 +0200)]
radv: Fix stack size calculation with stage ids

In create_rt_shader, we were setting group_idx to the stage index before.

Fixes the following tests:

dEQP-VK.ray_query.builtin.instancecustomindex.miss.aabbs
dEQP-VK.ray_query.builtin.objectrayorigin.miss.triangles

Fixes: c39ccce ("radv/rt: use stage ID as handle for general and closestHit shaders")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17936>

23 months agoetnaviv: fix standalone compiler to work without a tgsi backend
Italo Nicola [Fri, 29 Jul 2022 20:34:02 +0000 (17:34 -0300)]
etnaviv: fix standalone compiler to work without a tgsi backend

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17810>

23 months agoetnaviv: skip disk cache initialization on standalone compiler
Italo Nicola [Fri, 29 Jul 2022 20:32:12 +0000 (17:32 -0300)]
etnaviv: skip disk cache initialization on standalone compiler

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17810>

23 months agomicrosoft/compiler: Change calls to NIR_INSTR_UNSUPPORTED to log to dxil_logger instead
Michael Tang [Tue, 5 Oct 2021 22:33:26 +0000 (15:33 -0700)]
microsoft/compiler: Change calls to NIR_INSTR_UNSUPPORTED to log to dxil_logger instead

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12510>

23 months agonir: add nir_instr_as_str
Michael Tang [Tue, 5 Oct 2021 22:32:33 +0000 (15:32 -0700)]
nir: add nir_instr_as_str

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12510>

23 months agomicrosoft/compiler: Add dxil_logger type and parameter to nir_to_dxil
Michael Tang [Fri, 8 Oct 2021 22:23:35 +0000 (15:23 -0700)]
microsoft/compiler: Add dxil_logger type and parameter to nir_to_dxil

v2 (jenatali): Add a default logger which aborts via unreachable,
and use NULL from GL/Vulkan to use the default logger.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12510>

23 months agoradv: copy the sample locations only if the state isn't dynamic
Samuel Pitoiset [Thu, 11 Aug 2022 12:22:38 +0000 (14:22 +0200)]
radv: copy the sample locations only if the state isn't dynamic

If user sample locations is enabled and the state is dynamic we don't
have to copy them to the dynamic state struct.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18007>

23 months agoradv: copy line stipple factor/pattern only if the state isn't dynamic
Samuel Pitoiset [Thu, 11 Aug 2022 12:13:02 +0000 (14:13 +0200)]
radv: copy line stipple factor/pattern only if the state isn't dynamic

If line stipple is enabled and the state is dynamic we don't have to
copy factor/pattern to the dynamic state struct.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18007>

23 months agoradv: remove unecessary radv_pipeline::uses_dynamic_stride
Samuel Pitoiset [Thu, 11 Aug 2022 12:29:03 +0000 (14:29 +0200)]
radv: remove unecessary radv_pipeline::uses_dynamic_stride

We can just rely on the dynamic states.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18007>

23 months agoanv: don't return incorrect error code for vkCreateDescriptorPool
Lionel Landwerlin [Mon, 8 Aug 2022 19:01:28 +0000 (22:01 +0300)]
anv: don't return incorrect error code for vkCreateDescriptorPool

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7013
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17945>

23 months agoradv: force inlining on another draw function
Mike Blumenkrantz [Wed, 10 Aug 2022 18:43:57 +0000 (14:43 -0400)]
radv: force inlining on another draw function

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17993>

23 months agoradv: remove stupid conditional from draw path
Mike Blumenkrantz [Wed, 10 Aug 2022 18:43:22 +0000 (14:43 -0400)]
radv: remove stupid conditional from draw path

compilers are now provably smart enough to handle this

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17993>

23 months agoradeonsi/tests: cosmetic changes
Pierre-Eric Pelloux-Prayer [Mon, 8 Aug 2022 14:07:08 +0000 (16:07 +0200)]
radeonsi/tests: cosmetic changes

Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17907>

23 months agoradeonsi/tests: update navi21 expected results
Pierre-Eric Pelloux-Prayer [Mon, 8 Aug 2022 14:00:29 +0000 (16:00 +0200)]
radeonsi/tests: update navi21 expected results

Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17907>

23 months agoradeonsi/tests: update raven expected results
Pierre-Eric Pelloux-Prayer [Fri, 5 Aug 2022 08:56:07 +0000 (10:56 +0200)]
radeonsi/tests: update raven expected results

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17907>

23 months agoradeonsi/tests: add testing of the khr-single tests
Pierre-Eric Pelloux-Prayer [Fri, 5 Aug 2022 08:55:04 +0000 (10:55 +0200)]
radeonsi/tests: add testing of the khr-single tests

This is similar to what's done in !17876.

KHR-Single-GL46.arrays_of_arrays_gl.AtomicUsage is only executed when
--slow is used because it takes about 200 seconds.

Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17907>

23 months agoradeonsi/tests: remove left-over debug print
Pierre-Eric Pelloux-Prayer [Fri, 5 Aug 2022 08:54:26 +0000 (10:54 +0200)]
radeonsi/tests: remove left-over debug print

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17907>

23 months agovirgl: add support for hardware video acceleration
Feng Jiang [Mon, 20 Jun 2022 07:10:58 +0000 (15:10 +0800)]
virgl: add support for hardware video acceleration

Currently H.264 and H.265 decoding is supported, and other profiles
and encodings will be added in the future.

This function relies on the virglrenderer commit:
a92fed821f5ac173ca82c011a5d7e5b25e7bd0eb

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Ming Xie <xieming@kylinos.cn>
Signed-off-by: Liming Sun <sunliming@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17157>

23 months agogallium/util: add a new helper function pipe_buffer_size()
Feng Jiang [Mon, 20 Jun 2022 06:35:35 +0000 (14:35 +0800)]
gallium/util: add a new helper function pipe_buffer_size()

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Liming Sun <sunliming@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17157>

23 months agovl: change vl_video_buffer_destroy() to non-static
Feng Jiang [Mon, 20 Jun 2022 06:30:08 +0000 (14:30 +0800)]
vl: change vl_video_buffer_destroy() to non-static

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Ming Xie <xieming@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17157>

23 months agogallium: add key size to the structure pipe_picture_desc
Feng Jiang [Mon, 20 Jun 2022 06:22:28 +0000 (14:22 +0800)]
gallium: add key size to the structure pipe_picture_desc

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Liming Sun <sunliming@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17157>

23 months agopvr: Fix bo mapping on alloc with PVR_BO_ALLOC_FLAG_CPU_ACCESS.
Karmjit Mahil [Mon, 8 Aug 2022 15:24:41 +0000 (16:24 +0100)]
pvr: Fix bo mapping on alloc with PVR_BO_ALLOC_FLAG_CPU_ACCESS.

If PVR_BO_ALLOC_FLAG_CPU_ACCESS was specified when calling
pvr_bo_alloc() the new bo was also being cpu mapped while this
was not the intention as the PVR_BO_ALLOC_FLAG_CPU_MAPPED is meant
to be used for that purpose. Fixed in this commit.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17984>

23 months agonouveau: implement and enable PIPE_CAP_QUERY_MEMORY_INFO
Yusuf Khan [Sun, 7 Aug 2022 21:35:11 +0000 (17:35 -0400)]
nouveau: implement and enable PIPE_CAP_QUERY_MEMORY_INFO

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17931>

23 months agoegl/wgl: Fix some awkward sizeof formatting
Jesse Natalie [Wed, 10 Aug 2022 20:16:45 +0000 (13:16 -0700)]
egl/wgl: Fix some awkward sizeof formatting

Fixes: 3415bf02 ("egl: Add a basic Windows driver")
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Delete unused variables/code
Jesse Natalie [Thu, 28 Apr 2022 17:41:12 +0000 (10:41 -0700)]
egl/wgl: Delete unused variables/code

Fixes: 3415bf02 ("egl: Add a basic Windows driver")
Suggested-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agowgl: Use pfi instead of iPixelFormat more often
Jesse Natalie [Tue, 21 Sep 2021 22:33:26 +0000 (15:33 -0700)]
wgl: Use pfi instead of iPixelFormat more often

Also, support config-less contexts, and surface-less contexts.

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Support sync objects
Jesse Natalie [Tue, 21 Sep 2021 17:43:07 +0000 (10:43 -0700)]
egl/wgl: Support sync objects

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Support EGL_MESA_query_driver
Jesse Natalie [Tue, 21 Sep 2021 16:42:16 +0000 (09:42 -0700)]
egl/wgl: Support EGL_MESA_query_driver

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Hook up image validate/get in smapi
Jesse Natalie [Tue, 21 Sep 2021 16:21:42 +0000 (09:21 -0700)]
egl/wgl: Hook up image validate/get in smapi

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Use a per-display st_manager
Jesse Natalie [Tue, 21 Sep 2021 16:00:29 +0000 (09:00 -0700)]
egl/wgl: Use a per-display st_manager

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agowgl: Pass smapi explicitly to framebuffer creation
Jesse Natalie [Tue, 21 Sep 2021 15:45:04 +0000 (08:45 -0700)]
wgl: Pass smapi explicitly to framebuffer creation

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agowgl: Pass smapi explicitly to context creation
Jesse Natalie [Tue, 21 Sep 2021 15:39:23 +0000 (08:39 -0700)]
wgl: Pass smapi explicitly to context creation

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl,wgl: Support eglCreateImageKHR
Jesse Natalie [Mon, 20 Sep 2021 22:24:19 +0000 (15:24 -0700)]
egl,wgl: Support eglCreateImageKHR

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Support eglWaitNative
Jesse Natalie [Mon, 20 Sep 2021 16:51:01 +0000 (09:51 -0700)]
egl/wgl: Support eglWaitNative

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Support eglWaitClient
Jesse Natalie [Mon, 20 Sep 2021 16:49:48 +0000 (09:49 -0700)]
egl/wgl: Support eglWaitClient

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Support eglSwapInterval
Jesse Natalie [Mon, 20 Sep 2021 16:41:52 +0000 (09:41 -0700)]
egl/wgl: Support eglSwapInterval

Note, eglSwapInterval spec says "The default swap interval is 1."

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agowgl: Allow per-framebuffer swap interval overrides
Jesse Natalie [Mon, 20 Sep 2021 16:39:55 +0000 (09:39 -0700)]
wgl: Allow per-framebuffer swap interval overrides

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Implement bind/release texture buffer
Jesse Natalie [Sat, 18 Sep 2021 01:54:19 +0000 (18:54 -0700)]
egl/wgl: Implement bind/release texture buffer

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Set YInvert attribute to always true
Jesse Natalie [Sat, 18 Sep 2021 01:54:02 +0000 (18:54 -0700)]
egl/wgl: Set YInvert attribute to always true

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Implement PBuffer surfaces
Jesse Natalie [Thu, 16 Sep 2021 21:43:02 +0000 (14:43 -0700)]
egl/wgl: Implement PBuffer surfaces

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agowgl: Split pbuffer creation into two functions
Jesse Natalie [Thu, 16 Sep 2021 20:31:04 +0000 (13:31 -0700)]
wgl: Split pbuffer creation into two functions

One creates a window and framebuffer, the other deals with
wgl-specific attribute parsing and GDI interactions.

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Implement QuerySurface
Jesse Natalie [Thu, 16 Sep 2021 18:52:05 +0000 (11:52 -0700)]
egl/wgl: Implement QuerySurface

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoegl/wgl: Don't require a native display to support window surfaces
Jesse Natalie [Fri, 24 Sep 2021 15:41:05 +0000 (08:41 -0700)]
egl/wgl: Don't require a native display to support window surfaces

Found a Windows EGL/GLES app that inits EGL without a native display,
and then creates a window surface from that EGL display:
https://github.com/danginsburg/opengles3-book/

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>

23 months agoc11: Implement and use of thrd_current properly on win32
Yonggang Luo [Tue, 19 Apr 2022 20:13:25 +0000 (04:13 +0800)]
c11: Implement and use of thrd_current properly on win32

Now thrd_t are a struct that contains both thread handle and thread id.
For threads that not created by thrd_create, thrd_current are returning pseudo thread handle;
but we can still compare threads differences by using thread id.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17071>

23 months agoc11: call impl_tss_dtor_invoke with tls callback for win32
Yonggang Luo [Tue, 9 Aug 2022 17:32:33 +0000 (01:32 +0800)]
c11: call impl_tss_dtor_invoke with tls callback for win32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17071>

23 months agoc11: It's should detect PTHREAD_DESTRUCTOR_ITERATIONS when define TSS_DTOR_ITERATIONS
Yonggang Luo [Thu, 16 Jun 2022 05:56:10 +0000 (13:56 +0800)]
c11: It's should detect PTHREAD_DESTRUCTOR_ITERATIONS when define TSS_DTOR_ITERATIONS

INIT_ONCE_STATIC_INIT looks like miscopied from Win32's init once macro
Correct implementation for reference
https://gitlab.inria.fr/gustedt/p99/-/blob/master/p99/p99_threads_posix.h#L64

C11 standard:
https://en.cppreference.com/w/c/thread/TSS_DTOR_ITERATIONS

As TSS_DTOR_ITERATIONS didn't used in mesa codebase, so it's won't affect anything in mesa

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17071>