Module: Mesa
Branch: master
Commit: aea36ee05e996f504186176b139b5ef9737cd323
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aea36ee05e996f504186176b139b5ef9737cd323

Author: Michel Zou <[email protected]>
Date:   Wed Feb 10 14:27:52 2021 +0100

zink: Fix win32 build

Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8957>

---

 src/gallium/drivers/zink/zink_screen.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_screen.c 
b/src/gallium/drivers/zink/zink_screen.c
index b20e04a7150..6a30c1f4a74 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -1247,7 +1247,11 @@ zink_create_screen(struct sw_winsys *winsys)
       * luck!
       */
       gallium_driver = getenv("GALLIUM_DRIVER");
+#ifdef _WIN32
+      _putenv("GALLIUM_DRIVER=llvmpipe");
+#else
       setenv("GALLIUM_DRIVER", "llvmpipe", 1);
+#endif
    }
 #endif
 
@@ -1256,9 +1260,16 @@ zink_create_screen(struct sw_winsys *winsys)
       ret->winsys = winsys;
 
 #ifdef ZINK_WITH_SWRAST_VK
-   if (gallium_driver)
+   if (gallium_driver) {
+#ifdef _WIN32
+      char envstr[64] = "";
+      snprintf(envstr, 64, "GALLIUM_DRIVER=%s", gallium_driver);
+      _putenv(envstr);
+#else
       setenv("GALLIUM_DRIVER", gallium_driver, 1);
 #endif
+   }
+#endif
 
    return &ret->base;
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to