Mesa (main): d3d10umd: Fix MSVC build.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 26 14:16:19 UTC 2021


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

Author: Jose Fonseca <jfonseca at vmware.com>
Date:   Mon Jul 19 14:39:45 2021 +0100

d3d10umd: Fix MSVC build.

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

---

 src/gallium/frontends/d3d10umd/D3DKMT.cpp       |  4 ++--
 src/gallium/frontends/d3d10umd/DriverIncludes.h | 13 +++++++++++--
 src/gallium/frontends/d3d10umd/ShaderParse.c    |  2 +-
 src/gallium/frontends/d3d10umd/ShaderParse.h    |  3 ---
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/gallium/frontends/d3d10umd/D3DKMT.cpp b/src/gallium/frontends/d3d10umd/D3DKMT.cpp
index 1649eddc41e..dc31e993187 100644
--- a/src/gallium/frontends/d3d10umd/D3DKMT.cpp
+++ b/src/gallium/frontends/d3d10umd/D3DKMT.cpp
@@ -244,7 +244,7 @@ D3DKMTGetMultisampleMethodList(D3DKMT_GETMULTISAMPLEMETHODLIST *pData)
 
 
 EXTERN_C NTSTATUS APIENTRY
-D3DKMTPresent(CONST D3DKMT_PRESENT *pData)
+D3DKMTPresent(D3DKMT_PRESENT *pData)
 {
    LOG_UNSUPPORTED_ENTRYPOINT();
    return STATUS_NOT_IMPLEMENTED;
@@ -409,7 +409,7 @@ D3DKMTSetVidPnSourceOwner(CONST D3DKMT_SETVIDPNSOURCEOWNER *pData)
 
 
 EXTERN_C NTSTATUS APIENTRY
-D3DKMTSetVidPnSourceOwner1(const void *pData)
+D3DKMTSetVidPnSourceOwner1(CONST D3DKMT_SETVIDPNSOURCEOWNER1 *pData)
 {
    LOG_UNSUPPORTED_ENTRYPOINT();
    return STATUS_NOT_IMPLEMENTED;
diff --git a/src/gallium/frontends/d3d10umd/DriverIncludes.h b/src/gallium/frontends/d3d10umd/DriverIncludes.h
index e78d46fafc5..c7df64042b5 100644
--- a/src/gallium/frontends/d3d10umd/DriverIncludes.h
+++ b/src/gallium/frontends/d3d10umd/DriverIncludes.h
@@ -43,12 +43,21 @@
 
 #include <windows.h>
 
-#include "winddk/winddk_compat.h"
+#include "winddk_compat.h"
 
 //typedef LARGE_INTEGER PHYSICAL_ADDRESS;
 //typedef __success(return >= 0) LONG NTSTATUS;
 
-#define D3D10DDI_MINOR_HEADER_VERSION 1
+#define D3D10DDI_MINOR_HEADER_VERSION 2
+
+/* Unfortunately WinDDK's d3d10umddi.h defines D3D10.x constants as global
+ * const variables instead of preprocessor defines, causing LINK to fail due
+ * to duplicate symbols.  Include d3d10_1.h to avoid the issue.
+ */
+#ifdef _MSC_VER
+#include <d3d10_1.h>
+#endif
+
 #include <d3d10umddi.h>
 
 #include "Debug.h"
diff --git a/src/gallium/frontends/d3d10umd/ShaderParse.c b/src/gallium/frontends/d3d10umd/ShaderParse.c
index e4b6b88aa72..1995d381880 100644
--- a/src/gallium/frontends/d3d10umd/ShaderParse.c
+++ b/src/gallium/frontends/d3d10umd/ShaderParse.c
@@ -392,7 +392,7 @@ Shader_parse_opcode(struct Shader_parser *parser,
    if (opcode_is_extended) {
       /* NOTE: DECODE_IS_D3D10_SB_OPCODE_DOUBLE_EXTENDED is broken.
        */
-      assert(!((*curr & D3D10_SB_OPCODE_DOUBLE_EXTENDED_MASK) >> D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT));
+      assert(!((*curr & D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK) >> D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT));
 
       switch (DECODE_D3D10_SB_EXTENDED_OPCODE_TYPE(*curr)) {
       case D3D10_SB_EXTENDED_OPCODE_EMPTY:
diff --git a/src/gallium/frontends/d3d10umd/ShaderParse.h b/src/gallium/frontends/d3d10umd/ShaderParse.h
index 5e8fba044ab..df95536f2b5 100644
--- a/src/gallium/frontends/d3d10umd/ShaderParse.h
+++ b/src/gallium/frontends/d3d10umd/ShaderParse.h
@@ -35,9 +35,6 @@
 
 #include "DriverIncludes.h"
 
-//#include "winddk/winddk_compat.h"
-#include "winddk/d3d10tokenizedprogramformat.hpp"
-
 #ifdef __cplusplus
 extern "C" {
 #endif



More information about the mesa-commit mailing list