ifndef __REQUIRED_RPCNDR_H_VERSION__
define __REQUIRED_RPCNDR_H_VERSION__ 500
endif
ifndef __REQUIRED_RPCSAL_H_VERSION__
define __REQUIRED_RPCSAL_H_VERSION__ 100
endif
include rpc.inc
include rpcndr.inc
ifndef __RPCNDR_H_VERSION__
.err <this stub requires an updated version of rpcndr.h>
endif

ifndef COM_NO_WINDOWS_H
include windows.inc
include ole2.inc
endif

ifndef __d3d11ShaderTracing_h__
define __d3d11ShaderTracing_h__

include oaidl.inc
include ocidl.inc

.enum D3D11_SHADER_TYPE {
    D3D11_VERTEX_SHADER = 1,
    D3D11_HULL_SHADER	= 2,
    D3D11_DOMAIN_SHADER = 3,
    D3D11_GEOMETRY_SHADER	= 4,
    D3D11_PIXEL_SHADER	= 5,
    D3D11_COMPUTE_SHADER	= 6
    }

D3D11_TRACE_COMPONENT_X equ 0x1
D3D11_TRACE_COMPONENT_Y equ 0x2
D3D11_TRACE_COMPONENT_Z equ 0x4
D3D11_TRACE_COMPONENT_W equ 0x8
D3D11_TRACE_COMPONENT_MASK typedef UINT8

D3D11_VERTEX_SHADER_TRACE_DESC STRUC
Invocation		UINT64 ?
D3D11_VERTEX_SHADER_TRACE_DESC ENDS

D3D11_HULL_SHADER_TRACE_DESC STRUC
Invocation		UINT64 ?
D3D11_HULL_SHADER_TRACE_DESC ENDS

D3D11_DOMAIN_SHADER_TRACE_DESC STRUC
Invocation		UINT64 ?
D3D11_DOMAIN_SHADER_TRACE_DESC ENDS

D3D11_GEOMETRY_SHADER_TRACE_DESC STRUC
Invocation		UINT64 ?
D3D11_GEOMETRY_SHADER_TRACE_DESC ENDS

D3D11_PIXEL_SHADER_TRACE_DESC STRUC
Invocation		UINT64 ?
X			int_t ?
Y			int_t ?
SampleMask		UINT64 ?
D3D11_PIXEL_SHADER_TRACE_DESC ENDS

D3D11_COMPUTE_SHADER_TRACE_DESC STRUC
Invocation		UINT64 ?
ThreadIDInGroup		UINT  3	 dup(?)
ThreadGroupID		UINT  3	 dup(?)
D3D11_COMPUTE_SHADER_TRACE_DESC ENDS

D3D11_SHADER_TRACE_FLAG_RECORD_REGISTER_WRITES equ 0x1
D3D11_SHADER_TRACE_FLAG_RECORD_REGISTER_READS equ 0x2
D3D11_SHADER_TRACE_DESC STRUC
Type			D3D11_SHADER_TYPE ?
Flags			UINT ?
UNION
VertexShaderTraceDesc	D3D11_VERTEX_SHADER_TRACE_DESC <>
HullShaderTraceDesc	D3D11_HULL_SHADER_TRACE_DESC <>
DomainShaderTraceDesc	D3D11_DOMAIN_SHADER_TRACE_DESC <>
GeometryShaderTraceDesc D3D11_GEOMETRY_SHADER_TRACE_DESC <>
PixelShaderTraceDesc	D3D11_PIXEL_SHADER_TRACE_DESC <>
ComputeShaderTraceDesc	D3D11_COMPUTE_SHADER_TRACE_DESC <>
ENDS
D3D11_SHADER_TRACE_DESC ENDS

.enum D3D11_TRACE_GS_INPUT_PRIMITIVE {
    D3D11_TRACE_GS_INPUT_PRIMITIVE_UNDEFINED	= 0,
    D3D11_TRACE_GS_INPUT_PRIMITIVE_POINT	= 1,
    D3D11_TRACE_GS_INPUT_PRIMITIVE_LINE = 2,
    D3D11_TRACE_GS_INPUT_PRIMITIVE_TRIANGLE	= 3,
    D3D11_TRACE_GS_INPUT_PRIMITIVE_LINE_ADJ	= 6,
    D3D11_TRACE_GS_INPUT_PRIMITIVE_TRIANGLE_ADJ = 7
    }

D3D11_TRACE_STATS	STRUC
TraceDesc		D3D11_SHADER_TRACE_DESC <>
NumInvocationsInStamp	UINT8 ?
TargetStampIndex	UINT8 ?
NumTraceSteps		UINT ?
InputMask		D3D11_TRACE_COMPONENT_MASK  32	dup(?)
OutputMask		D3D11_TRACE_COMPONENT_MASK  32	dup(?)
NumTemps		UINT16 ?
MaxIndexableTempIndex	UINT16 ?
IndexableTempSize	UINT16	4096  dup(?)
ImmediateConstantBufferSize UINT16 ?
PixelPosition		UINT  4	 dup(?)
PixelCoverageMask	UINT64	4  dup(?)
PixelDiscardedMask	UINT64	4  dup(?)
PixelCoverageMaskAfterShader UINT64  4	dup(?)
PixelCoverageMaskAfterA2CSampleMask UINT64  4  dup(?)
PixelCoverageMaskAfterA2CSampleMaskDepth UINT64	 4  dup(?)
PixelCoverageMaskAfterA2CSampleMaskDepthStencil UINT64	4  dup(?)
PSOutputsDepth		BOOL ?
PSOutputsMask		BOOL ?
GSInputPrimitive	D3D11_TRACE_GS_INPUT_PRIMITIVE ?
GSInputsPrimitiveID	BOOL ?
HSOutputPatchConstantMask D3D11_TRACE_COMPONENT_MASK  32  dup(?)
DSInputPatchConstantMask D3D11_TRACE_COMPONENT_MASK  32	 dup(?)
D3D11_TRACE_STATS	ENDS

D3D11_TRACE_VALUE	STRUC
Bits			UINT  4	 dup(?)
ValidMask		D3D11_TRACE_COMPONENT_MASK ?
D3D11_TRACE_VALUE	ENDS

.enum D3D11_TRACE_REGISTER_TYPE {
    D3D11_TRACE_OUTPUT_NULL_REGISTER	= 0,
    D3D11_TRACE_INPUT_REGISTER	= ( D3D11_TRACE_OUTPUT_NULL_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_PRIMITIVE_ID_REGISTER	= ( D3D11_TRACE_INPUT_REGISTER + 1 ) ,
    D3D11_TRACE_IMMEDIATE_CONSTANT_BUFFER	= ( D3D11_TRACE_INPUT_PRIMITIVE_ID_REGISTER + 1 ) ,
    D3D11_TRACE_TEMP_REGISTER	= ( D3D11_TRACE_IMMEDIATE_CONSTANT_BUFFER + 1 ) ,
    D3D11_TRACE_INDEXABLE_TEMP_REGISTER = ( D3D11_TRACE_TEMP_REGISTER + 1 ) ,
    D3D11_TRACE_OUTPUT_REGISTER = ( D3D11_TRACE_INDEXABLE_TEMP_REGISTER + 1 ) ,
    D3D11_TRACE_OUTPUT_DEPTH_REGISTER	= ( D3D11_TRACE_OUTPUT_REGISTER + 1 ) ,
    D3D11_TRACE_CONSTANT_BUFFER = ( D3D11_TRACE_OUTPUT_DEPTH_REGISTER + 1 ) ,
    D3D11_TRACE_IMMEDIATE32	= ( D3D11_TRACE_CONSTANT_BUFFER + 1 ) ,
    D3D11_TRACE_SAMPLER = ( D3D11_TRACE_IMMEDIATE32 + 1 ) ,
    D3D11_TRACE_RESOURCE	= ( D3D11_TRACE_SAMPLER + 1 ) ,
    D3D11_TRACE_RASTERIZER	= ( D3D11_TRACE_RESOURCE + 1 ) ,
    D3D11_TRACE_OUTPUT_COVERAGE_MASK	= ( D3D11_TRACE_RASTERIZER + 1 ) ,
    D3D11_TRACE_STREAM	= ( D3D11_TRACE_OUTPUT_COVERAGE_MASK + 1 ) ,
    D3D11_TRACE_THIS_POINTER	= ( D3D11_TRACE_STREAM + 1 ) ,
    D3D11_TRACE_OUTPUT_CONTROL_POINT_ID_REGISTER	= ( D3D11_TRACE_THIS_POINTER + 1 ) ,
    D3D11_TRACE_INPUT_FORK_INSTANCE_ID_REGISTER = ( D3D11_TRACE_OUTPUT_CONTROL_POINT_ID_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_JOIN_INSTANCE_ID_REGISTER = ( D3D11_TRACE_INPUT_FORK_INSTANCE_ID_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_CONTROL_POINT_REGISTER	= ( D3D11_TRACE_INPUT_JOIN_INSTANCE_ID_REGISTER + 1 ) ,
    D3D11_TRACE_OUTPUT_CONTROL_POINT_REGISTER	= ( D3D11_TRACE_INPUT_CONTROL_POINT_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_PATCH_CONSTANT_REGISTER	= ( D3D11_TRACE_OUTPUT_CONTROL_POINT_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_DOMAIN_POINT_REGISTER	= ( D3D11_TRACE_INPUT_PATCH_CONSTANT_REGISTER + 1 ) ,
    D3D11_TRACE_UNORDERED_ACCESS_VIEW	= ( D3D11_TRACE_INPUT_DOMAIN_POINT_REGISTER + 1 ) ,
    D3D11_TRACE_THREAD_GROUP_SHARED_MEMORY	= ( D3D11_TRACE_UNORDERED_ACCESS_VIEW + 1 ) ,
    D3D11_TRACE_INPUT_THREAD_ID_REGISTER	= ( D3D11_TRACE_THREAD_GROUP_SHARED_MEMORY + 1 ) ,
    D3D11_TRACE_INPUT_THREAD_GROUP_ID_REGISTER	= ( D3D11_TRACE_INPUT_THREAD_ID_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_REGISTER	= ( D3D11_TRACE_INPUT_THREAD_GROUP_ID_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_COVERAGE_MASK_REGISTER	= ( D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_FLATTENED_REGISTER	= ( D3D11_TRACE_INPUT_COVERAGE_MASK_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_GS_INSTANCE_ID_REGISTER	= ( D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_FLATTENED_REGISTER + 1 ) ,
    D3D11_TRACE_OUTPUT_DEPTH_GREATER_EQUAL_REGISTER	= ( D3D11_TRACE_INPUT_GS_INSTANCE_ID_REGISTER + 1 ) ,
    D3D11_TRACE_OUTPUT_DEPTH_LESS_EQUAL_REGISTER	= ( D3D11_TRACE_OUTPUT_DEPTH_GREATER_EQUAL_REGISTER + 1 ) ,
    D3D11_TRACE_IMMEDIATE64	= ( D3D11_TRACE_OUTPUT_DEPTH_LESS_EQUAL_REGISTER + 1 ) ,
    D3D11_TRACE_INPUT_CYCLE_COUNTER_REGISTER	= ( D3D11_TRACE_IMMEDIATE64 + 1 ) ,
    D3D11_TRACE_INTERFACE_POINTER	= ( D3D11_TRACE_INPUT_CYCLE_COUNTER_REGISTER + 1 )
    }

D3D11_TRACE_REGISTER_FLAGS_RELATIVE_INDEXING equ 0x1
D3D11_TRACE_REGISTER	STRUC
RegType			D3D11_TRACE_REGISTER_TYPE ?
UNION
Index1D			UINT16 ?
Index2D			UINT16 2 dup(?)
ENDS
OperandIndex		UINT8 ?
Flags			UINT8 ?
D3D11_TRACE_REGISTER	ENDS

D3D11_TRACE_MISC_GS_EMIT equ 0x1
D3D11_TRACE_MISC_GS_CUT equ 0x2
D3D11_TRACE_MISC_PS_DISCARD equ 0x4
D3D11_TRACE_MISC_GS_EMIT_STREAM equ 0x8
D3D11_TRACE_MISC_GS_CUT_STREAM equ 0x10
D3D11_TRACE_MISC_HALT	equ 0x20
D3D11_TRACE_MISC_MESSAGE equ 0x40
D3D11_TRACE_MISC_OPERATIONS_MASK typedef UINT16

D3D11_TRACE_STEP	STRUC
ID			UINT ?
InstructionActive	BOOL ?
NumRegistersWritten	UINT8 ?
NumRegistersRead	UINT8 ?
MiscOperations		D3D11_TRACE_MISC_OPERATIONS_MASK ?
OpcodeType		UINT ?
CurrentGlobalCycle	UINT64 ?
D3D11_TRACE_STEP	ENDS


ifndef __ID3D11ShaderTrace_INTERFACE_DEFINED__
define __ID3D11ShaderTrace_INTERFACE_DEFINED__

DEFINE_IIDX(ID3D11ShaderTrace, "36b013e6-2811-4845-baa7-d623fe0df104")

.comdef ID3D11ShaderTrace : public IUnknown

    TraceReady		proc :ptr
    ResetTrace		proc
    GetTraceStats	proc :ptr
    PSSelectStamp	proc :UINT
    GetInitialRegisterContents proc :ptr, :ptr
    GetStep		proc :UINT, :ptr
    GetWrittenRegister	proc :UINT, :UINT, :ptr, :ptr
    GetReadRegister	proc :UINT, :UINT, :ptr, :ptr
   .ends

endif


ifndef __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__
define __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__

DEFINE_IIDX(ID3D11ShaderTraceFactory, "1fbad429-66ab-41cc-9617-667ac10e4459")

.comdef ID3D11ShaderTraceFactory : public IUnknown

    CreateShaderTrace	proc :ptr, :ptr, :ptr
   .ends

endif

D3DDisassemble11Trace proto WINAPI :LPCVOID, :SIZE_T, :ptr, :UINT, :UINT, :UINT, :ptr

endif
