[PATCH] include/d3d12: add missing enum/structures/defines needed to use d3d12x.h

Steve Lhomme robux4 at ycbcr.xyz
Fri Jul 2 03:05:28 CDT 2021


d3dx12.h is a useful MIT licensed header from Microsoft to help do regular
things with D3D12 (in C++).
It's usable with mingw (and thus wine) with these additions.
---
 include/d3d12.idl | 77 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/include/d3d12.idl b/include/d3d12.idl
index 42f33a06e40..056e078ab9d 100644
--- a/include/d3d12.idl
+++ b/include/d3d12.idl
@@ -75,6 +75,9 @@ const UINT D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT = 4096;
 const UINT D3D12_VS_INPUT_REGISTER_COUNT = 32;
 const UINT D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16;
 
+cpp_quote("#define D3D12_MIN_DEPTH ( 0.0f )")
+cpp_quote("#define D3D12_MAX_DEPTH ( 1.0f )")
+
 cpp_quote("#endif")
 
 const UINT D3D12_SHADER_COMPONENT_MAPPING_MASK = 0x7;
@@ -2005,6 +2008,80 @@ typedef enum D3D12_PREDICATION_OP
     D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1,
 } D3D12_PREDICATION_OP;
 
+typedef enum D3D12_VIEW_INSTANCING_FLAGS
+{
+    D3D12_VIEW_INSTANCING_FLAG_NONE,
+    D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING
+} D3D12_VIEW_INSTANCING_FLAGS;
+
+typedef enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE
+{
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS,
+    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID
+} D3D12_PIPELINE_STATE_SUBOBJECT_TYPE;
+
+typedef struct D3D12_DEPTH_STENCIL_DESC1
+{
+    BOOL DepthEnable;
+    D3D12_DEPTH_WRITE_MASK DepthWriteMask;
+    D3D12_COMPARISON_FUNC DepthFunc;
+    BOOL StencilEnable;
+    UINT8 StencilReadMask;
+    UINT8 StencilWriteMask;
+    D3D12_DEPTH_STENCILOP_DESC FrontFace;
+    D3D12_DEPTH_STENCILOP_DESC BackFace;
+    BOOL DepthBoundsTestEnable;
+} D3D12_DEPTH_STENCIL_DESC1;
+
+typedef struct D3D12_VIEW_INSTANCE_LOCATION
+{
+    UINT ViewportArrayIndex;
+    UINT RenderTargetArrayIndex;
+} D3D12_VIEW_INSTANCE_LOCATION;
+
+typedef struct D3D12_VIEW_INSTANCING_DESC
+{
+    UINT ViewInstanceCount;
+    const D3D12_VIEW_INSTANCE_LOCATION *pViewInstanceLocations;
+    D3D12_VIEW_INSTANCING_FLAGS Flags;
+} D3D12_VIEW_INSTANCING_DESC;
+
+typedef struct D3D12_RT_FORMAT_ARRAY
+{
+    DXGI_FORMAT RTFormats[8];
+    UINT NumRenderTargets;
+} D3D12_RT_FORMAT_ARRAY;
+
+typedef struct D3D12_PIPELINE_STATE_STREAM_DESC
+{
+    SIZE_T SizeInBytes;
+    void *pPipelineStateSubobjectStream;
+} D3D12_PIPELINE_STATE_STREAM_DESC;
+
 [
     uuid(8efb471d-616c-4f49-90f7-127bb763fa51),
     object,
-- 
2.29.2




More information about the wine-devel mailing list