From fdfe4a4d307377f078a01d05a247c4f61d208be8 Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Mon, 16 Nov 2020 20:07:06 +0100 Subject: [PATCH] libgl-gdi: add zink support Reviewed-by: Erik Faye-Lund Reviewed-by: Jesse Natalie Acked-by: Jose Fonseca Closes #3802 Part-of: --- src/gallium/targets/libgl-gdi/libgl_gdi.c | 21 +++++++++++++++++++++ src/gallium/targets/libgl-gdi/meson.build | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c index 00b9de0f94f..dd4f4282260 100644 --- a/src/gallium/targets/libgl-gdi/libgl_gdi.c +++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c @@ -60,6 +60,10 @@ #include "d3d12/d3d12_public.h" #endif +#ifdef GALLIUM_ZINK +#include "zink/zink_public.h" +#endif + #ifdef GALLIUM_LLVMPIPE static boolean use_llvmpipe = FALSE; #endif @@ -69,6 +73,9 @@ static boolean use_swr = FALSE; #ifdef GALLIUM_D3D12 static boolean use_d3d12 = FALSE; #endif +#ifdef GALLIUM_ZINK +static boolean use_zink = FALSE; +#endif static struct pipe_screen * gdi_screen_create(void) @@ -114,6 +121,13 @@ gdi_screen_create(void) if (screen) use_d3d12 = TRUE; } +#endif +#ifdef GALLIUM_ZINK + if (strcmp(driver, "zink") == 0) { + screen = zink_create_screen( winsys ); + if (screen) + use_zink = TRUE; + } #endif (void) driver; @@ -174,6 +188,13 @@ gdi_present(struct pipe_screen *screen, } #endif +#ifdef GALLIUM_ZINK + if (use_zink) { + screen->flush_frontbuffer(screen, res, 0, 0, hDC, NULL); + return; + } +#endif + #ifdef GALLIUM_SOFTPIPE winsys = softpipe_screen(screen)->winsys, dt = softpipe_resource(res)->dt, diff --git a/src/gallium/targets/libgl-gdi/meson.build b/src/gallium/targets/libgl-gdi/meson.build index 50a308bcf50..87ee9f17c69 100644 --- a/src/gallium/targets/libgl-gdi/meson.build +++ b/src/gallium/targets/libgl-gdi/meson.build @@ -39,7 +39,7 @@ libopengl32 = shared_library( ], dependencies : [ dep_ws2_32, idep_nir, idep_mesautil, driver_swrast, driver_swr, - driver_d3d12 + driver_d3d12, driver_zink ], name_prefix : '', # otherwise mingw will create libopengl32.dll install : true,