summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2021-05-05 11:57:43 +0100
committerJose Fonseca <jfonseca@vmware.com>2021-05-19 13:50:07 +0000
commit54b8137141a7c89956a51b8aa1e7fb7f7ef10cd7 (patch)
tree42d9dce141da5c4c0ff86b974bd0908e8e0033e6 /include
parent3927a2d946316d9a00d716df845e9320d4d3d9f7 (diff)
d3d10umd,d3d10sw: Initial import.
This change adds a gallium D3D10 state tracker that works as a WDDM UMD software driver, similar to Microsoft WARP, but using llvmpipe/softpipe. The final deliverable is a d3d10sw.dll, which is similar to WARP's d3d10warp.dll. This has been used to run Microsoft Windows HCK wgf11* tests with llvmpipe, and they were at one point passing 100%. Known limitations: - TGSI (no NIR) - D3D10 only (no D3D11 support yet) - no WINE integration (WINE doesn't implement WDDM DDI.) For further details see: - src/gallium/frontends/d3d10umd/README.md - src/gallium/targets/d3d10sw/README.md v2: Drop the DXBC-based disassembly. Add missing break statements. v3: Incorporate Jesse's feedback. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Acked-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10687>
Diffstat (limited to 'include')
-rw-r--r--include/winddk/.gitignore13
-rw-r--r--include/winddk/README.txt16
-rw-r--r--include/winddk/winddk_compat.h236
3 files changed, 265 insertions, 0 deletions
diff --git a/include/winddk/.gitignore b/include/winddk/.gitignore
new file mode 100644
index 00000000000..14e87aa12db
--- /dev/null
+++ b/include/winddk/.gitignore
@@ -0,0 +1,13 @@
+d3d10tokenizedprogramformat.hpp
+d3d10umddi.h
+d3d11tokenizedprogramformat.hpp
+d3dkmddi.h
+d3dkmdt.h
+d3dkmthk.h
+d3dukmdt.h
+d3dumddi.h
+dxgiddi.h
+dxgiformat.h
+dxgitype.h
+dxmini.h
+wmidata.h
diff --git a/include/winddk/README.txt b/include/winddk/README.txt
new file mode 100644
index 00000000000..a4d4edab260
--- /dev/null
+++ b/include/winddk/README.txt
@@ -0,0 +1,16 @@
+The gallium d3d10umd statetracker depends upon the follow Windows DDK headers
+being placed here:
+
+ d3d10tokenizedprogramformat.hpp
+ d3d10umddi.h
+ d3d11tokenizedprogramformat.hpp
+ d3dkmddi.h
+ d3dkmdt.h
+ d3dkmthk.h
+ d3dukmdt.h
+ d3dumddi.h
+ dxgiddi.h
+ dxgiformat.h
+ dxgitype.h
+ dxmini.h
+ wmidata.h
diff --git a/include/winddk/winddk_compat.h b/include/winddk/winddk_compat.h
new file mode 100644
index 00000000000..6438a89f71e
--- /dev/null
+++ b/include/winddk/winddk_compat.h
@@ -0,0 +1,236 @@
+/**************************************************************************
+ *
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/**
+ * @file
+ * SDK/DDK compatability.
+ *
+ * Different headers/defines on different Windows SDKs / DDKs, so define
+ * all used status here to keep the code portable.
+ *
+ * @author <jfonseca@vmware.com>
+ */
+
+#ifndef VMW_WDDM_COMPAT_H_
+#define VMW_WDDM_COMPAT_H_
+
+#ifndef __in
+#define __in /**/
+#endif
+
+#ifndef __out
+#define __out /**/
+#endif
+
+#ifndef __inout
+#define __inout /**/
+#endif
+
+#ifndef __in_opt
+#define __in_opt /**/
+#endif
+
+#ifndef __inout_opt
+#define __inout_opt /**/
+#endif
+
+#ifndef __ecount
+#define __ecount(x) /**/
+#endif
+
+#ifndef __in_ecount
+#define __in_ecount(x) /**/
+#endif
+
+#ifndef __deref_ecount
+#define __deref_ecount(x) /**/
+#endif
+
+#ifndef __in_bcount
+#define __in_bcount(x) /**/
+#endif
+
+#ifndef __out_bcount
+#define __out_bcount(x) /**/
+#endif
+
+#ifndef __out_ecount_opt
+#define __out_ecount_opt(x) /**/
+#endif
+
+#ifndef __deref_out
+#define __deref_out /**/
+#endif
+
+#ifndef __in_range
+#define __in_range(x,y) /**/
+#endif
+
+#ifndef __field_bcount
+#define __field_bcount(x) /**/
+#endif
+
+#ifndef __out_bcount
+#define __out_bcount(x) /**/
+#endif
+
+#ifndef __out_bcount_full_opt
+#define __out_bcount_full_opt(x) /**/
+#endif
+
+#ifndef __out_ecount_part_z_opt
+#define __out_ecount_part_z_opt(x, y) /**/
+#endif
+
+#ifndef __out_ecount_part_opt
+#define __out_ecount_part_opt(x, y) /**/
+#endif
+
+#ifndef __field_ecount
+#define __field_ecount(x) /**/
+#endif
+
+#ifndef __field_ecount_full
+#define __field_ecount_full(x) /**/
+#endif
+
+#ifndef __checkReturn
+#define __checkReturn /**/
+#endif
+
+#ifndef __drv_requiresIRQL
+#define __drv_requiresIRQL(x) /**/
+#endif
+
+#ifndef __drv_minIRQL
+#define __drv_minIRQL(x) /**/
+#endif
+
+#ifndef __drv_maxIRQL
+#define __drv_maxIRQL(x) /**/
+#endif
+
+#ifdef __MINGW32__
+#define __inline static __inline__
+#endif
+
+#ifndef EXTERN_C
+#define EXTERN_C /**/
+#endif
+
+#ifdef __MINGW32__
+typedef unsigned char UINT8;
+#endif
+
+
+#ifndef NTSTATUS
+#define NTSTATUS LONG
+#endif
+
+typedef LARGE_INTEGER PHYSICAL_ADDRESS;
+
+#ifndef NT_SUCCESS
+#define NT_SUCCESS(_status) ((_status) >= 0)
+#endif
+
+#ifndef STATUS_SUCCESS
+#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
+#endif
+
+#ifndef STATUS_UNSUCCESSFUL
+#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L)
+#endif
+
+#ifndef STATUS_INVALID_PARAMETER
+#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL)
+#endif
+
+#ifndef STATUS_NO_MEMORY
+#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L)
+#endif
+
+#ifndef STATUS_ILLEGAL_INSTRUCTION
+#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001DL)
+#endif
+
+#ifndef STATUS_BUFFER_TOO_SMALL
+#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
+#endif
+
+#ifndef STATUS_PRIVILEGED_INSTRUCTION
+#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096L)
+#endif
+
+#ifndef STATUS_NOT_SUPPORTED
+#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL)
+#endif
+
+#ifndef STATUS_DEVICE_REMOVED
+#define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6L)
+#endif
+
+#ifndef STATUS_INVALID_USER_BUFFER
+#define STATUS_INVALID_USER_BUFFER ((NTSTATUS)0xC00000E8L)
+#endif
+
+#ifndef STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER
+#define STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER ((NTSTATUS)0xC01E0000L)
+#endif
+
+#ifndef STATUS_NO_VIDEO_MEMORY
+#define STATUS_NO_VIDEO_MEMORY ((NTSTATUS)0xC01E0100L)
+#endif
+
+#ifndef STATUS_GRAPHICS_ALLOCATION_BUSY
+#define STATUS_GRAPHICS_ALLOCATION_BUSY ((NTSTATUS)0xC01E0102L)
+#endif
+
+#ifndef STATUS_GRAPHICS_TOO_MANY_REFERENCES
+#define STATUS_GRAPHICS_TOO_MANY_REFERENCES ((NTSTATUS)0xC01E0103L)
+#endif
+
+#ifndef STATUS_GRAPHICS_ALLOCATION_INVALID
+#define STATUS_GRAPHICS_ALLOCATION_INVALID ((NTSTATUS)0xC01E0106L)
+#endif
+
+#ifndef STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION
+#define STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION ((NTSTATUS)0xC01E0109L)
+#endif
+
+#ifndef STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION
+#define STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION ((NTSTATUS)0xC01E0111L)
+#endif
+
+#ifndef STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE
+#define STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE ((NTSTATUS)0xC01E0200L)
+#endif
+
+#ifndef STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET
+#define STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET ((NTSTATUS)0xC01E0333L)
+#endif
+
+#endif /* VMW_WDDM_COMPAT_H_ */