Mesa (master): d3d12: Include wsl/winadapter.h when not compiling for Windows

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 16 16:42:47 UTC 2020


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Tue Dec  8 09:56:46 2020 -0800

d3d12: Include wsl/winadapter.h when not compiling for Windows

The winadapter.h provides typedefs and defines to enable the
D3D/DXCore headers to be included as-is when targeting non-
Windows platforms.

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>

---

 src/gallium/drivers/d3d12/d3d12_batch.h                   | 4 ++++
 src/gallium/drivers/d3d12/d3d12_bufmgr.h                  | 4 ++++
 src/gallium/drivers/d3d12/d3d12_fence.h                   | 4 ++++
 src/gallium/drivers/d3d12/d3d12_pipeline_state.h          | 4 ++++
 src/gallium/drivers/d3d12/d3d12_screen.h                  | 4 ++++
 src/microsoft/resource_state_manager/D3D12ResourceState.h | 4 ++++
 6 files changed, 24 insertions(+)

diff --git a/src/gallium/drivers/d3d12/d3d12_batch.h b/src/gallium/drivers/d3d12/d3d12_batch.h
index 7180d957f58..05039eb9be0 100644
--- a/src/gallium/drivers/d3d12/d3d12_batch.h
+++ b/src/gallium/drivers/d3d12/d3d12_batch.h
@@ -27,6 +27,10 @@
 #include "util/u_dynarray.h"
 #include <stdint.h>
 
+#ifndef _WIN32
+#include <wsl/winadapter.h>
+#endif
+
 #define D3D12_IGNORE_SDK_LAYERS
 #include <directx/d3d12.h>
 
diff --git a/src/gallium/drivers/d3d12/d3d12_bufmgr.h b/src/gallium/drivers/d3d12/d3d12_bufmgr.h
index f66dd6aa564..338731a1bfc 100644
--- a/src/gallium/drivers/d3d12/d3d12_bufmgr.h
+++ b/src/gallium/drivers/d3d12/d3d12_bufmgr.h
@@ -27,6 +27,10 @@
 #include "pipebuffer/pb_buffer.h"
 #include "util/u_atomic.h"
 
+#ifndef _WIN32
+#include <wsl/winadapter.h>
+#endif
+
 #include <directx/d3d12.h>
 
 struct d3d12_bufmgr;
diff --git a/src/gallium/drivers/d3d12/d3d12_fence.h b/src/gallium/drivers/d3d12/d3d12_fence.h
index c72d8017bad..1ff9160a066 100644
--- a/src/gallium/drivers/d3d12/d3d12_fence.h
+++ b/src/gallium/drivers/d3d12/d3d12_fence.h
@@ -26,6 +26,10 @@
 
 #include "util/u_inlines.h"
 
+#ifndef _WIN32
+#include <wsl/winadapter.h>
+#endif
+
 #include <directx/d3d12.h>
 
 struct pipe_screen;
diff --git a/src/gallium/drivers/d3d12/d3d12_pipeline_state.h b/src/gallium/drivers/d3d12/d3d12_pipeline_state.h
index 972d291fe93..bcc64139166 100644
--- a/src/gallium/drivers/d3d12/d3d12_pipeline_state.h
+++ b/src/gallium/drivers/d3d12/d3d12_pipeline_state.h
@@ -26,6 +26,10 @@
 
 #include "pipe/p_state.h"
 
+#ifndef _WIN32
+#include <wsl/winadapter.h>
+#endif
+
 #define D3D12_IGNORE_SDK_LAYERS
 #include <directx/d3d12.h>
 
diff --git a/src/gallium/drivers/d3d12/d3d12_screen.h b/src/gallium/drivers/d3d12/d3d12_screen.h
index 1d32ad91e2e..75555211b99 100644
--- a/src/gallium/drivers/d3d12/d3d12_screen.h
+++ b/src/gallium/drivers/d3d12/d3d12_screen.h
@@ -28,6 +28,10 @@
 
 #include "util/slab.h"
 
+#ifndef _WIN32
+#include <wsl/winadapter.h>
+#endif
+
 #define D3D12_IGNORE_SDK_LAYERS
 #include <directx/d3d12.h>
 
diff --git a/src/microsoft/resource_state_manager/D3D12ResourceState.h b/src/microsoft/resource_state_manager/D3D12ResourceState.h
index 07071a3b85a..3a78f690da4 100644
--- a/src/microsoft/resource_state_manager/D3D12ResourceState.h
+++ b/src/microsoft/resource_state_manager/D3D12ResourceState.h
@@ -24,6 +24,10 @@
 #ifndef D3D12_RESOURCE_STATE_H
 #define D3D12_RESOURCE_STATE_H
 
+#ifndef _WIN32
+#include <wsl/winadapter.h>
+#endif
+
 #include <vector>
 #include <assert.h>
 #include <directx/d3d12.h>



More information about the mesa-commit mailing list