Commit Graph

57 Commits

Author SHA1 Message Date
Jesse Natalie 1ef329b825 wgl, d3d12: Handle front buffer writes for double-buffered MSAA surfaces backed by swapchains
We don't need to go as far as the fake front thing when MSAA is being used, because the
swapchain (single-sampled) is already decoupled from the app render buffers. But we do
need to direct the frontbuffer flush to the single-sampled back buffer, and then present
the back buffer. We also need to swap the buffers when we do this, so the next blit
targets the former front buffer.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16227>
2022-06-01 16:18:12 -07:00
xperia64 e5afbfbed5 wgl: Add driver_zink as a dependency of the wgl frontend
Fixes: 01ed71f945 ("wgl: support kopper")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16569>
2022-05-18 02:18:06 +00:00
Mike Blumenkrantz 70f5360037 wgl: always set alpha on kopper windows
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16153>
2022-05-03 20:12:27 +00:00
Jesse Natalie 06ae10bb92 wgl: Implement WGL_ARB_create_context_robustness
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>
2022-04-28 19:33:04 +00:00
Sidney Just 01ed71f945 wgl: support kopper
this is semi transposed from the dri version of kopper and mostly ignores
what wgl tries to do in order to let zink drive everything

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>
2022-04-22 01:11:52 +00:00
Sidney Just 863ce662b4 wgl: add a flag to determine if running on zink
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16068>
2022-04-22 01:11:52 +00:00
Mike Blumenkrantz f8f5b5455a wgl: support GL 4.6
somehow we never supported anything above 4.5?

cc: mesa-stable

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16085>
2022-04-21 19:37:55 +00:00
Erik Faye-Lund 82ca8a707e wgl: do not disable error-dialogs by default
We don't know if an application developer wants error-dialog by default
or not, even when using a Mesa OpenGL driver.

So let's not assume this is a good thing, and instead make an option for
this behavior that we can enable for CI testing.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Erik Faye-Lund ae73a26355 util: limit error-dialogs to win32
These dialogs only exist on Windows, so let's not even expose a util
function for this on other platforms.

The code is only ever called from Windows specific code anyway.

While we're at it, clean up the name a bit as well.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Erik Faye-Lund 116553b554 wgl: rename force-msaa env-var
This env-var is not specific to the SVGA driver, so we should rename it
for consistency.

While we're at it, let's document the feature.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Pierre-Eric Pelloux-Prayer f5dc334b6d drirc: add mesa_extension_override option
This allows specific per-application override.
The existing MESA_EXTENSION_OVERRIDE env variable is kept.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13364>
2021-11-04 14:16:55 +00:00
Jesse Natalie 0574265256 wgl: Swap buffers via pointer instead of HDC
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 90d2b93731 wgl: Add a stw_dev getter
Data imports need to be marked __declspec(dllimport), so
just export a function instead of data.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie bb706ca93a wgl: Use HWND instead of HDC as primary framebuffer handle
EGL's native window is an HWND, so this removes the need to
GetDC from the creation path there.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie ddedf59625 wgl: Add an explicit iPixelFormat for context creation
If it's 0, then it's looked up from the framebuffer for the specified HDC

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 9c875b040c wgl: Un-inline helpers which use stw_own_mutex
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 7d96e19b92 wgl: Add iPixelFormat to stw_pixelformat_info
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 49d83de072 wgl: Split DrvReleaseContext to support unbind via pointer
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie c4806ae03c wgl: Make contexts current with framebuffers instead of HDCs
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie be9f9886fe wgl: Allow creating framebuffers that aren't in the global window list
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 8b9b5cdbf4 wgl: Make contexts current with pointer instead of DHGLRC
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 0d3a215819 wgl: Pass share context as pointer instead of DHGLRC
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie ca1cceeed5 wgl: Create contexts and DHGLRCs separately
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie e2bb111e02 wgl: Make overridden entrypoints local to stw_ext_context
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:35 -07:00
Jesse Natalie 739fb1057d wgl: Move wgl* non-extension definitions to libgl-gdi
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:24 -07:00
Jesse Natalie a153c78d6e wgl: Move opengl32.def to target instead of frontend
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:13 -07:00
Jesse Natalie 675775b140 wgl: Don't use BUILD_GL32 for wgl frontend
The set of GL exports from OpenGL32.dll is controlled by a .def file,
there's no need to also use __declspec(dllexport) for all of them.

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:00 -07:00
Jesse Natalie b3f9b347f9 wgl: Add a driver name for driconf
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie 35ec7e8b8e wgl: Parse driconf options
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jason Ekstrand d4b482d378 android: Drop the Android.mk build system
Android.mk files haven't really been supported by Mesa devs for a long
time.  Most of us have been willing to update Makefile.sources if we
remember and sometimes we try to blind code some Android.mk for a new
generator.  However, the reality is that it breaks regularly and ends up
being maintained by the Android community.  To address this problem
another approach was implemented in !10183 utilizing the maintained
meson build system.  The old Android.mk files are no longer required.

This commit was created with the following commands:

    git rm **/Android.mk
    git rm **/Android.*.mk
    git rm **/Makefile.sources
    git rm CleanSpec.mk

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4487
Acked-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9728>
2021-07-08 14:44:02 -05:00
Erik Faye-Lund 91a1849ff0 wgl: remove hard limit on pixelformats
Zink on Intel's Windows driver supports more than 256 pixelformats,
triggering asserts. So let's get rid of the hard-coded limit, and
instead use u_dynarray to store the pixelformat info.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11447>
2021-06-22 06:57:03 +00:00
Jose Fonseca 6bb7d3bbc0 wgl: Remove opengl32.mingw.def.
MinGW DEF parsing is even more broken than before, and 32-bits import
libs are broken regardless one uses opengl32.mingw.def or opengl32.def.

This change removes opengl32.mingw.def and addresses the issue differently:

- link opengl32.dll with --enable-stdcall-fixup

- use the systems opengl32 import lib (libopengl32.a/opengl32.lib)
  instead of our own

This change also gets test_wgl built with MinGW (even if it's never tested),
which I used to verify this; and to not link against internal libraries.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

v2: Revert back to shared_library.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10767>
2021-05-13 13:18:16 +00:00
Adam Jackson 291aff3fcb gallium: Remove unused st_visual::render_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10675>
2021-05-07 16:47:30 -04:00
Michel Dänzer 2928c21eb7 Convert most remaining free-form fall-through comments to FALLTHROUGH
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is
explicitly disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Jesse Natalie 51df136c8b wgl: Add a context to framebuffer destruction
If the window is destroyed on a thread that has a currently-bound
context, use that context for destroying the framebuffer. This
ensures that the winsys can wait for in-flight work before
destroying any resources.

If the window did have a context bound beforehand but it was unbound,
we should've already done a glFinish. If the window is destroyed from
an unrelated thread... well, we're screwed, but that's the best we can do.

Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>
2021-04-01 16:19:41 +00:00
Jesse Natalie e3f48ac829 wgl: Fix wglCreatePbufferARB pixel format lookup
All other call sites of stw_pixelformat_get_info pass iPixelFormat as-is,
and stw_pixelformat_get_info also subtracts one internally, so I think
this was just an error.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9760>
2021-03-23 16:17:48 +00:00
Jose Fonseca 6e6cd7d93c scons: Remove.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9720>
2021-03-20 10:38:55 +00:00
Jose Fonseca d7184aa15b wgl: Match opengl32.dll export ordinals.
Some apps import GL/WGL symbols by ordinal.  See
https://github.com/apitrace/apitrace/issues/652

This is not an issue when Mesa is used as an OpenGL ICD, but it might
create troubles when used as a drop-in opengl32.dll replacement.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7372>
2021-02-25 10:47:59 +00:00
Marek Olšák 2813688f8d gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views
These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>
2021-01-15 04:01:12 -05:00
Louis-Francis Ratté-Boulianne a2751080aa wgl: Don't crash in stw_make_current if current framebuffer is NULL
Fixes #3878

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7999>
2021-01-12 15:41:00 +00:00
Jesse Natalie 9ac8f8f490 gallium: Add optional pipe_context to flush_frontbuffer
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>
2020-12-14 23:31:37 +00:00
Michel Zou 5a702fa4e5 wgl: fix maybe-uninitialized warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Jesse Natalie be4475c4a7 d3d12: Implement winsys framebuffer
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:18:37 +01:00
Louis-Francis Ratté-Boulianne e74b3e570a wgl: Wrap stw_pixelformat.h into extern C
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:18:24 +01:00
Louis-Francis Ratté-Boulianne 584061bdcd wgl: Create third buffer when drawing to front buffer
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:18:05 +01:00
Louis-Francis Ratté-Boulianne ece2cc3352 wgl: Wait for fence when not using winsys framebuffer
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:17:43 +01:00
Louis-Francis Ratté-Boulianne f49ff1548b wgl: Call flush_resource() before presenting
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:17:29 +01:00
Louis-Francis Ratté-Boulianne 0e79ee3741 wgl: Flush in-between resolving buffer and presenting
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:17:17 +01:00
Jesse Natalie d60913e392 wgl: Use winsys framebuffer interface if present
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:16:54 +01:00
Jesse Natalie 23bfe03567 wgl: Add winsys framebuffer object
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7535>
2020-11-18 11:16:42 +01:00