From ab0cc959cc47ee2002f1d980c6dee787123b9a5d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 7 Aug 2020 16:20:09 +0300 Subject: [PATCH] include: Add d3d12 reflection structures. Signed-off-by: Paul Gofman Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- include/Makefile.in | 1 + include/d3d12shader.idl | 184 ++++++++++++++++++++++++++++++++++++++++ include/d3dcommon.idl | 20 +++++ include/d3dcompiler.h | 1 + 4 files changed, 206 insertions(+) create mode 100644 include/d3d12shader.idl diff --git a/include/Makefile.in b/include/Makefile.in index 216adf0d7ae..1713f0b6279 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -109,6 +109,7 @@ SOURCES = \ d3d11sdklayers.idl \ d3d11shader.h \ d3d12.idl \ + d3d12shader.idl \ d3d8.h \ d3d8caps.h \ d3d8types.h \ diff --git a/include/d3d12shader.idl b/include/d3d12shader.idl new file mode 100644 index 00000000000..61a285bf179 --- /dev/null +++ b/include/d3d12shader.idl @@ -0,0 +1,184 @@ +/* + * Copyright 2020 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "oaidl.idl"; +import "ocidl.idl"; +import "d3dcommon.idl"; + +typedef struct _D3D12_SHADER_DESC +{ + UINT Version; + const char *Creator; + UINT Flags; + UINT ConstantBuffers; + UINT BoundResources; + UINT InputParameters; + UINT OutputParameters; + UINT InstructionCount; + UINT TempRegisterCount; + UINT TempArrayCount; + UINT DefCount; + UINT DclCount; + UINT TextureNormalInstructions; + UINT TextureLoadInstructions; + UINT TextureCompInstructions; + UINT TextureBiasInstructions; + UINT TextureGradientInstructions; + UINT FloatInstructionCount; + UINT IntInstructionCount; + UINT UintInstructionCount; + UINT StaticFlowControlCount; + UINT DynamicFlowControlCount; + UINT MacroInstructionCount; + UINT ArrayInstructionCount; + UINT CutInstructionCount; + UINT EmitInstructionCount; + D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; + UINT GSMaxOutputVertexCount; + D3D_PRIMITIVE InputPrimitive; + UINT PatchConstantParameters; + UINT cGSInstanceCount; + UINT cControlPoints; + D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; + D3D_TESSELLATOR_PARTITIONING HSPartitioning; + D3D_TESSELLATOR_DOMAIN TessellatorDomain; + UINT cBarrierInstructions; + UINT cInterlockedInstructions; + UINT cTextureStoreInstructions; +} D3D12_SHADER_DESC; + +typedef struct _D3D12_SHADER_VARIABLE_DESC +{ + const char *Name; + UINT StartOffset; + UINT Size; + UINT uFlags; + void *DefaultValue; + UINT StartTexture; + UINT TextureSize; + UINT StartSampler; + UINT SamplerSize; +} D3D12_SHADER_VARIABLE_DESC; + +typedef struct _D3D12_SHADER_TYPE_DESC +{ + D3D_SHADER_VARIABLE_CLASS Class; + D3D_SHADER_VARIABLE_TYPE Type; + UINT Rows; + UINT Columns; + UINT Elements; + UINT Members; + UINT Offset; + const char *Name; +} D3D12_SHADER_TYPE_DESC; + +typedef struct _D3D12_SHADER_BUFFER_DESC +{ + const char *Name; + D3D_CBUFFER_TYPE Type; + UINT Variables; + UINT Size; + UINT uFlags; +} D3D12_SHADER_BUFFER_DESC; + +typedef struct _D3D12_SHADER_INPUT_BIND_DESC +{ + const char *Name; + D3D_SHADER_INPUT_TYPE Type; + UINT BindPoint; + UINT BindCount; + UINT uFlags; + D3D_RESOURCE_RETURN_TYPE ReturnType; + D3D_SRV_DIMENSION Dimension; + UINT NumSamples; + UINT Space; + UINT uID; +} D3D12_SHADER_INPUT_BIND_DESC; + +typedef struct _D3D12_SIGNATURE_PARAMETER_DESC +{ + const char *SemanticName; + UINT SemanticIndex; + UINT Register; + D3D_NAME SystemValueType; + D3D_REGISTER_COMPONENT_TYPE ComponentType; + BYTE Mask; + BYTE ReadWriteMask; + UINT Stream; + D3D_MIN_PRECISION MinPrecision; +} D3D12_SIGNATURE_PARAMETER_DESC; + +typedef struct _D3D12_PARAMETER_DESC +{ + const char *Name; + const char *SemanticName; + D3D_SHADER_VARIABLE_TYPE Type; + D3D_SHADER_VARIABLE_CLASS Class; + UINT Rows; + UINT Columns; + D3D_INTERPOLATION_MODE InterpolationMode; + D3D_PARAMETER_FLAGS Flags; + UINT FirstInRegister; + UINT FirstInComponent; + UINT FirstOutRegister; + UINT FirstOutComponent; +} D3D12_PARAMETER_DESC; + +typedef struct _D3D12_FUNCTION_DESC +{ + UINT Version; + const char *Creator; + UINT Flags; + UINT ConstantBuffers; + UINT BoundResources; + UINT InstructionCount; + UINT TempRegisterCount; + UINT TempArrayCount; + UINT DefCount; + UINT DclCount; + UINT TextureNormalInstructions; + UINT TextureLoadInstructions; + UINT TextureCompInstructions; + UINT TextureBiasInstructions; + UINT TextureGradientInstructions; + UINT FloatInstructionCount; + UINT IntInstructionCount; + UINT UintInstructionCount; + UINT StaticFlowControlCount; + UINT DynamicFlowControlCount; + UINT MacroInstructionCount; + UINT ArrayInstructionCount; + UINT MovInstructionCount; + UINT MovcInstructionCount; + UINT ConversionInstructionCount; + UINT BitwiseInstructionCount; + D3D_FEATURE_LEVEL MinFeatureLevel; + UINT64 RequiredFeatureFlags; + const char *Name; + INT FunctionParameterCount; + BOOL HasReturn; + BOOL Has10Level9VertexShader; + BOOL Has10Level9PixelShader; +} D3D12_FUNCTION_DESC; + +typedef struct _D3D12_LIBRARY_DESC +{ + const char *Creator; + UINT Flags; + UINT FunctionCount; +} D3D12_LIBRARY_DESC; diff --git a/include/d3dcommon.idl b/include/d3dcommon.idl index 29404efd69d..7d1c0d25cf3 100644 --- a/include/d3dcommon.idl +++ b/include/d3dcommon.idl @@ -686,4 +686,24 @@ typedef enum _D3D_SHADER_CBUFFER_FLAGS D3D_CBF_FORCE_DWORD = 0x7fffffff } D3D_SHADER_CBUFFER_FLAGS; +typedef enum _D3D_PARAMETER_FLAGS +{ + D3D_PF_NONE, + D3D_PF_IN, + D3D_PF_OUT, + D3D_PF_FORCE_DWORD = 0x7fffffff +} D3D_PARAMETER_FLAGS; + +typedef enum _D3D_INTERPOLATION_MODE +{ + D3D_INTERPOLATION_UNDEFINED, + D3D_INTERPOLATION_CONSTANT, + D3D_INTERPOLATION_LINEAR, + D3D_INTERPOLATION_LINEAR_CENTROID, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID, + D3D_INTERPOLATION_LINEAR_SAMPLE, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE, +} D3D_INTERPOLATION_MODE; + cpp_quote("DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);") diff --git a/include/d3dcompiler.h b/include/d3dcompiler.h index bd1b3d1d44d..f11251e9dbf 100644 --- a/include/d3dcompiler.h +++ b/include/d3dcompiler.h @@ -20,6 +20,7 @@ #define __D3DCOMPILER_H__ #include "d3d11shader.h" +#include "d3d12shader.h" #ifdef __cplusplus extern "C" {