module external.directx.d3d11;

/*-------------------------------------------------------------------------------------
 *
 * Copyright (c) Microsoft Corporation
 *
 *-------------------------------------------------------------------------------------*/
// DirectX 11 Main Header translation from d3d11.h
// Latest update: Windows 10, version 1809

import std.bitmanip : bitfields;
public import external.directx.dxgi;
public import external.directx.d3dcommon;

mixin(uuid!(ID3D11DeviceChild, "1841e5c8", "16b0", "489b", ["bc", "c8", "44", "cf", "b0", "d5", "de", "ae"]));
extern (C++) interface ID3D11DeviceChild : IUnknown
{
    HRESULT QueryInterface(REFIID riid, void** ppvObject);
    ULONG AddRef();
    ULONG Release();
    void GetDevice(ID3D11Device** ppDevice);
    HRESULT GetPrivateData(REFGUID guid, uint* pDataSize, void* pData);
    HRESULT SetPrivateData(REFGUID guid, uint DataSize, const void* pData);
    HRESULT SetPrivateDataInterface(REFGUID guid, const IUnknown* pData);
}

mixin(uuid!(ID3D11DepthStencilState, "03823efb", "8d8f", "4e1c", ["9a", "a2", "f6", "4b", "b2", "cb", "fd", "f1"]));
extern (C++) interface ID3D11DepthStencilState : ID3D11DeviceChild
{
    void GetDesc(D3D11_DEPTH_STENCIL_DESC* pDesc);
}

mixin(uuid!(ID3D11BlendState, "75b68faa", "347d", "4159", ["8f", "45", "a0", "64", "0f", "01", "cd", "9a"]));
extern (C++) interface ID3D11BlendState : ID3D11DeviceChild
{
    void GetDesc(D3D11_BLEND_DESC* pDesc);
}

mixin(uuid!(ID3D11RasterizerState, "9bb4ab81", "ab1a", "4d8f", ["b5", "06", "fc", "04", "20", "0b", "6e", "e7"]));
extern (C++) interface ID3D11RasterizerState : ID3D11DeviceChild
{
    void GetDesc(D3D11_RASTERIZER_DESC* pDesc);
}

mixin(uuid!(ID3D11Resource, "dc8e63f3", "d12b", "4952", ["b4", "7b", "5e", "45", "02", "6a", "86", "2d"]));
extern (C++) interface ID3D11Resource : ID3D11DeviceChild
{
    void GetType(D3D11_RESOURCE_DIMENSION* pResourceDimension);
    void SetEvictionPriority(uint EvictionPriority);
    uint GetEvictionPriority();
}

mixin(uuid!(ID3D11Buffer, "48570b85", "d1ee", "4fcd", ["a2", "50", "eb", "35", "07", "22", "b0", "37"]));
extern (C++) interface ID3D11Buffer : ID3D11Resource
{
    void GetDesc(D3D11_BUFFER_DESC* pDesc);
}

mixin(uuid!(ID3D11Texture1D, "f8fb5c27", "c6b3", "4f75", ["a4", "c8", "43", "9a", "f2", "ef", "56", "4c"]));
extern (C++) interface ID3D11Texture1D : ID3D11Resource
{
    void GetDesc(D3D11_TEXTURE1D_DESC* pDesc);
}

mixin(uuid!(ID3D11Texture2D, "6f15aaf2", "d208", "4e89", ["9a", "b4", "48", "95", "35", "d3", "4f", "9c"]));
extern (C++) interface ID3D11Texture2D : ID3D11Resource
{
    void GetDesc(D3D11_TEXTURE2D_DESC* pDesc);
}

mixin(uuid!(ID3D11Texture3D, "037e866e", "f56d", "4357", ["a8", "af", "9d", "ab", "be", "6e", "25", "0e"]));
extern (C++) interface ID3D11Texture3D : ID3D11Resource
{
    void GetDesc(D3D11_TEXTURE3D_DESC* pDesc);
}

mixin(uuid!(ID3D11View, "839d1216", "bb2e", "412b", ["b7", "f4", "a9", "db", "eb", "e0", "8e", "d1"]));
extern (C++) interface ID3D11View : ID3D11DeviceChild
{
    void GetResource(ID3D11Resource** ppResource);
}

mixin(uuid!(ID3D11ShaderResourceView, "b0e06fe0", "8192", "4e1a", ["b1", "ca", "36", "d7", "41", "47", "10", "b2"]));
extern (C++) interface ID3D11ShaderResourceView : ID3D11View
{
    void GetDesc(D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11RenderTargetView, "dfdba067", "0b8d", "4865", ["87", "5b", "d7", "b4", "51", "6c", "c1", "64"]));
extern (C++) interface ID3D11RenderTargetView : ID3D11View
{
    void GetDesc(D3D11_RENDER_TARGET_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11DepthStencilView, "9fdac92a", "1876", "48c3", ["af", "ad", "25", "b9", "4f", "84", "a9", "b6"]));
extern (C++) interface ID3D11DepthStencilView : ID3D11View
{
    void GetDesc(D3D11_DEPTH_STENCIL_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11UnorderedAccessView, "28acf509", "7f5c", "48f6", ["86", "11", "f3", "16", "01", "0a", "63", "80"]));
extern (C++) interface ID3D11UnorderedAccessView : ID3D11View
{
    void GetDesc(D3D11_UNORDERED_ACCESS_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11VertexShader, "3b301d64", "d678", "4289", ["88", "97", "22", "f8", "92", "8b", "72", "f3"]));
extern (C++) interface ID3D11VertexShader : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11HullShader, "8e5c6061", "628a", "4c8e", ["82", "64", "bb", "e4", "5c", "b3", "d5", "dd"]));
extern (C++) interface ID3D11HullShader : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11DomainShader, "f582c508", "0f36", "490c", ["99", "77", "31", "ee", "ce", "26", "8c", "fa"]));
extern (C++) interface ID3D11DomainShader : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11GeometryShader, "38325b96", "effb", "4022", ["ba", "02", "2e", "79", "5b", "70", "27", "5c"]));
extern (C++) interface ID3D11GeometryShader : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11PixelShader, "ea82e40d", "51dc", "4f33", ["93", "d4", "db", "7c", "91", "25", "ae", "8c"]));
extern (C++) interface ID3D11PixelShader : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11ComputeShader, "4f5b196e", "c2bd", "495e", ["bd", "01", "1f", "de", "d3", "8e", "49", "69"]));
extern (C++) interface ID3D11ComputeShader : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11InputLayout, "e4819ddc", "4cf0", "4025", ["bd", "26", "5d", "e8", "2a", "3e", "07", "b7"]));
extern (C++) interface ID3D11InputLayout : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11SamplerState, "da6fea51", "564c", "4487", ["98", "10", "f0", "d0", "f9", "b4", "e3", "a5"]));
extern (C++) interface ID3D11SamplerState : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11Asynchronous, "4b35d0cd", "1e15", "4258", ["9c", "98", "1b", "13", "33", "f6", "dd", "3b"]));
extern (C++) interface ID3D11Asynchronous : ID3D11DeviceChild
{
    uint GetDataSize();
}

mixin(uuid!(ID3D11Query, "d6c00747", "87b7", "425e", ["b8", "4d", "44", "d1", "08", "56", "0a", "fd"]));
extern (C++) interface ID3D11Query : ID3D11Asynchronous
{
    void GetDesc(D3D11_QUERY_DESC* pDesc);
}

mixin(uuid!(ID3D11Predicate, "9eb576dd", "9f77", "4d86", ["81", "aa", "8b", "ab", "5f", "e4", "90", "e2"]));
extern (C++) interface ID3D11Predicate : ID3D11Query
{
}

mixin(uuid!(ID3D11Counter, "6e8c49fb", "a371", "4770", ["b4", "40", "29", "08", "60", "22", "b7", "41"]));
extern (C++) interface ID3D11Counter : ID3D11Asynchronous
{
    void GetDesc(D3D11_COUNTER_DESC* pDesc);
}

mixin(uuid!(ID3D11ClassInstance, "a6cd7faa", "b0b7", "4a2f", ["94", "36", "86", "62", "a6", "57", "97", "cb"]));
extern (C++) interface ID3D11ClassInstance : ID3D11DeviceChild
{
    void GetClassLinkage(ID3D11ClassLinkage** ppLinkage);
    void GetDesc(D3D11_CLASS_INSTANCE_DESC* pDesc);
    void GetInstanceName(LPSTR pInstanceName, size_t* pBufferLength);
    void GetTypeName(LPSTR pTypeName, size_t* pBufferLength);
}

mixin(uuid!(ID3D11ClassLinkage, "ddf57cba", "9543", "46e4", ["a1", "2b", "f2", "07", "a0", "fe", "7f", "ed"]));
extern (C++) interface ID3D11ClassLinkage : ID3D11DeviceChild
{
    HRESULT GetClassInstance(LPCSTR pClassInstanceName, uint InstanceIndex, ID3D11ClassInstance** ppInstance);
    HRESULT CreateClassInstance(LPCSTR pClassTypeName, uint ConstantBufferOffset, uint ConstantVectorOffset, uint TextureOffset, uint SamplerOffset, ID3D11ClassInstance** ppInstance);
}

mixin(uuid!(ID3D11CommandList, "a24bc4d1", "769e", "43f7", ["80", "13", "98", "ff", "56", "6c", "18", "e2"]));
extern (C++) interface ID3D11CommandList : ID3D11DeviceChild
{
    uint GetContextFlags();
}

mixin(uuid!(ID3D11DeviceContext, "c0bfa96c", "e089", "44fb", ["8e", "af", "26", "f8", "79", "61", "90", "da"]));
extern (C++) interface ID3D11DeviceContext : ID3D11DeviceChild
{
    void VSSetConstantBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers);
    void PSSetShaderResources(uint StartSlot, uint NumViews, const ID3D11ShaderResourceView** ppShaderResourceViews);
    void PSSetShader(ID3D11PixelShader* pPixelShader, const ID3D11ClassInstance** ppClassInstances, uint NumClassInstances);
    void PSSetSamplers(uint StartSlot, uint NumSamplers, const ID3D11SamplerState** ppSamplers);
    void VSSetShader(ID3D11VertexShader* pVertexShader, const ID3D11ClassInstance** ppClassInstances, uint NumClassInstances);
    void DrawIndexed(uint IndexCount, uint StartIndexLocation, int BaseVertexLocation);
    void Draw(uint VertexCount, uint StartVertexLocation);
    HRESULT Map(ID3D11Resource* pResource, uint Subresource, D3D11_MAP MapType, uint MapFlags, D3D11_MAPPED_SUBRESOURCE* pMappedResource);
    void Unmap(ID3D11Resource* pResource, uint Subresource);
    void PSSetConstantBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers);
    void IASetInputLayout(ID3D11InputLayout* pInputLayout);
    void IASetVertexBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppVertexBuffers, const uint* pStrides, const uint* pOffsets);
    void IASetIndexBuffer(ID3D11Buffer* pIndexBuffer, DXGI_FORMAT Format, uint Offset);
    void DrawIndexedInstanced(uint IndexCountPerInstance, uint InstanceCount, uint StartIndexLocation, int BaseVertexLocation, uint StartInstanceLocation);
    void DrawInstanced(uint VertexCountPerInstance, uint InstanceCount, uint StartVertexLocation, uint StartInstanceLocation);
    void GSSetConstantBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers);
    void GSSetShader(ID3D11GeometryShader* pShader, const ID3D11ClassInstance** ppClassInstances, uint NumClassInstances);
    void IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY Topology);
    void VSSetShaderResources(uint StartSlot, uint NumViews, const ID3D11ShaderResourceView** ppShaderResourceViews);
    void VSSetSamplers(uint StartSlot, uint NumSamplers, const ID3D11SamplerState** ppSamplers);
    void Begin(ID3D11Asynchronous* pAsync);
    void End(ID3D11Asynchronous* pAsync);
    HRESULT GetData(ID3D11Asynchronous* pAsync, void* pData, uint DataSize, uint GetDataFlags);
    void SetPredication(ID3D11Predicate* pPredicate, bool PredicateValue);
    void GSSetShaderResources(uint StartSlot, uint NumViews, const ID3D11ShaderResourceView** ppShaderResourceViews);
    void GSSetSamplers(uint StartSlot, uint NumSamplers, const ID3D11SamplerState** ppSamplers);
    void OMSetRenderTargets(uint NumViews, const ID3D11RenderTargetView** ppRenderTargetViews, ID3D11DepthStencilView* pDepthStencilView);
    void OMSetRenderTargetsAndUnorderedAccessViews(uint NumRTVs, const ID3D11RenderTargetView** ppRenderTargetViews, ID3D11DepthStencilView* pDepthStencilView, uint UAVStartSlot, uint NumUAVs, const ID3D11UnorderedAccessView** ppUnorderedAccessViews, const uint* pUAVInitialCounts);
    void OMSetBlendState(ID3D11BlendState* pBlendState, const float[4] BlendFactor, uint SampleMask);
    void OMSetDepthStencilState(ID3D11DepthStencilState* pDepthStencilState, uint StencilRef);
    void SOSetTargets(uint NumBuffers, const ID3D11Buffer** ppSOTargets, const uint* pOffsets);
    void DrawAuto();
    void DrawIndexedInstancedIndirect(ID3D11Buffer* pBufferForArgs, uint AlignedByteOffsetForArgs);
    void DrawInstancedIndirect(ID3D11Buffer* pBufferForArgs, uint AlignedByteOffsetForArgs);
    void Dispatch(uint ThreadGroupCountX, uint ThreadGroupCountY, uint ThreadGroupCountZ);
    void DispatchIndirect(ID3D11Buffer* pBufferForArgs, uint AlignedByteOffsetForArgs);
    void RSSetState(ID3D11RasterizerState* pRasterizerState);
    void RSSetViewports(uint NumViewports, const D3D11_VIEWPORT* pViewports);
    void RSSetScissorRects(uint NumRects, const D3D11_RECT* pRects);
    void CopySubresourceRegion(ID3D11Resource* pDstResource, uint DstSubresource, uint DstX, uint DstY, uint DstZ, ID3D11Resource* pSrcResource, uint SrcSubresource, const D3D11_BOX* pSrcBox);
    void CopyResource(ID3D11Resource* pDstResource, ID3D11Resource* pSrcResource);
    void UpdateSubresource(ID3D11Resource* pDstResource, uint DstSubresource, const D3D11_BOX* pDstBox, const void* pSrcData, uint SrcRowPitch, uint SrcDepthPitch);
    void CopyStructureCount(ID3D11Buffer* pDstBuffer, uint DstAlignedByteOffset, ID3D11UnorderedAccessView* pSrcView);
    void ClearRenderTargetView(ID3D11RenderTargetView* pRenderTargetView, const float[4] ColorRGBA);
    void ClearUnorderedAccessViewUint(ID3D11UnorderedAccessView* pUnorderedAccessView, const uint[4] Values);
    void ClearUnorderedAccessViewFloat(ID3D11UnorderedAccessView* pUnorderedAccessView, const float[4] Values);
    void ClearDepthStencilView(ID3D11DepthStencilView* pDepthStencilView, uint ClearFlags, float Depth, ubyte Stencil);
    void GenerateMips(ID3D11ShaderResourceView* pShaderResourceView);
    void SetResourceMinLOD(ID3D11Resource* pResource, float MinLOD);
    float GetResourceMinLOD(ID3D11Resource* pResource);
    void ResolveSubresource(ID3D11Resource* pDstResource, uint DstSubresource, ID3D11Resource* pSrcResource, uint SrcSubresource, DXGI_FORMAT Format);
    void ExecuteCommandList(ID3D11CommandList* pCommandList, bool RestoreContextState);
    void HSSetShaderResources(uint StartSlot, uint NumViews, const ID3D11ShaderResourceView** ppShaderResourceViews);
    void HSSetShader(ID3D11HullShader* pHullShader, const ID3D11ClassInstance** ppClassInstances, uint NumClassInstances);
    void HSSetSamplers(uint StartSlot, uint NumSamplers, const ID3D11SamplerState** ppSamplers);
    void HSSetConstantBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers);
    void DSSetShaderResources(uint StartSlot, uint NumViews, const ID3D11ShaderResourceView** ppShaderResourceViews);
    void DSSetShader(ID3D11DomainShader* pDomainShader, const ID3D11ClassInstance** ppClassInstances, uint NumClassInstances);
    void DSSetSamplers(uint StartSlot, uint NumSamplers, const ID3D11SamplerState** ppSamplers);
    void DSSetConstantBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers);
    void CSSetShaderResources(uint StartSlot, uint NumViews, const ID3D11ShaderResourceView** ppShaderResourceViews);
    void CSSetUnorderedAccessViews(uint StartSlot, uint NumUAVs, const ID3D11UnorderedAccessView** ppUnorderedAccessViews, const uint* pUAVInitialCounts);
    void CSSetShader(ID3D11ComputeShader* pComputeShader, const ID3D11ClassInstance** ppClassInstances, uint NumClassInstances);
    void CSSetSamplers(uint StartSlot, uint NumSamplers, const ID3D11SamplerState** ppSamplers);
    void CSSetConstantBuffers(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers);
    void VSGetConstantBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers);
    void PSGetShaderResources(uint StartSlot, uint NumViews, ID3D11ShaderResourceView** ppShaderResourceViews);
    void PSGetShader(ID3D11PixelShader** ppPixelShader, ID3D11ClassInstance** ppClassInstances, uint* pNumClassInstances);
    void PSGetSamplers(uint StartSlot, uint NumSamplers, ID3D11SamplerState** ppSamplers);
    void VSGetShader(ID3D11VertexShader** ppVertexShader, ID3D11ClassInstance** ppClassInstances, uint* pNumClassInstances);
    void PSGetConstantBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers);
    void IAGetInputLayout(ID3D11InputLayout** ppInputLayout);
    void IAGetVertexBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppVertexBuffers, uint* pStrides, uint* pOffsets);
    void IAGetIndexBuffer(ID3D11Buffer* pIndexBuffer, DXGI_FORMAT* Format, uint* Offset);
    void GSGetConstantBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers);
    void GSGetShader(ID3D11GeometryShader** ppGeometryShader, ID3D11ClassInstance** ppClassInstances, uint* pNumClassInstances);
    void IAGetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY* pTopology);
    void VSGetShaderResources(uint StartSlot, uint NumViews, ID3D11ShaderResourceView** ppShaderResourceViews);
    void VSGetSamplers(uint StartSlot, uint NumSamplers, ID3D11SamplerState** ppSamplers);
    void GetPredication(ID3D11Predicate** ppPredicate, bool* pPredicateValue);
    void GSGetShaderResources(uint StartSlot, uint NumViews, ID3D11ShaderResourceView** ppShaderResourceViews);
    void GSGetSamplers(uint StartSlot, uint NumSamplers, ID3D11SamplerState** ppSamplers);
    void OMGetRenderTargets(uint NumViews, ID3D11RenderTargetView** ppRenderTargetViews, ID3D11DepthStencilView** ppDepthStencilView);
    void OMGetRenderTargetsAndUnorderedAccessViews(uint NumRTVs, ID3D11RenderTargetView** ppRenderTargetViews, ID3D11DepthStencilView** ppDepthStencilView, uint UAVStartSlot, uint NumUAVs, ID3D11UnorderedAccessView** ppUnorderedAccessViews);
    void OMGetBlendState(ID3D11BlendState** ppBlendState, float[4] BlendFactor, uint* pSampleMask);
    void OMGetDepthStencilState(ID3D11DepthStencilState** ppDepthStencilState, uint* pStencilRef);
    void SOGetTargets(uint NumBuffers, ID3D11Buffer** ppSOTargets);
    void RSGetState(ID3D11RasterizerState** ppRasterizerState);
    void RSGetViewports(uint* pNumViewports, D3D11_VIEWPORT* pViewports);
    void RSGetScissorRects(uint* pNumRects, D3D11_RECT* pRects);
    void HSGetShaderResources(uint StartSlot, uint NumViews, ID3D11ShaderResourceView** ppShaderResourceViews);
    void HSGetShader(ID3D11HullShader** ppHullShader, ID3D11ClassInstance** ppClassInstances, uint* pNumClassInstances);
    void HSGetSamplers(uint StartSlot, uint NumSamplers, ID3D11SamplerState** ppSamplers);
    void HSGetConstantBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers);
    void DSGetShaderResources(uint StartSlot, uint NumViews, ID3D11ShaderResourceView** ppShaderResourceViews);
    void DSGetShader(ID3D11DomainShader** ppDomainShader, ID3D11ClassInstance** ppClassInstances, uint* pNumClassInstances);
    void DSGetSamplers(uint StartSlot, uint NumSamplers, ID3D11SamplerState** ppSamplers);
    void DSGetConstantBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers);
    void CSGetShaderResources(uint StartSlot, uint NumViews, ID3D11ShaderResourceView** ppShaderResourceViews);
    void CSGetUnorderedAccessViews(uint StartSlot, uint NumUAVs, ID3D11UnorderedAccessView** ppUnorderedAccessViews);
    void CSGetShader(ID3D11ComputeShader** ppComputeShader, ID3D11ClassInstance** ppClassInstances, uint* pNumClassInstances);
    void CSGetSamplers(uint StartSlot, uint NumSamplers, ID3D11SamplerState** ppSamplers);
    void CSGetConstantBuffers(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers);
    void ClearState();
    void Flush();
    D3D11_DEVICE_CONTEXT_TYPE GetType();
    uint GetContextFlags();
    HRESULT FinishCommandList(bool RestoreDeferredContextState, ID3D11CommandList** ppCommandList);
}

mixin(uuid!(ID3D11VideoDecoder, "3C9C5B51", "995D", "48d1", ["9B", "8D", "FA", "5C", "AE", "DE", "D6", "5C"]));
extern (C++) interface ID3D11VideoDecoder : ID3D11DeviceChild
{
    HRESULT GetCreationParameters(D3D11_VIDEO_DECODER_DESC* pVideoDesc, D3D11_VIDEO_DECODER_CONFIG* pConfig);
    HRESULT GetDriverHandle(HANDLE* pDriverHandle);
}

mixin(uuid!(ID3D11VideoProcessorEnumerator, "31627037", "53AB", "4200", ["90", "61", "05", "FA", "A9", "AB", "45", "F9"]));
extern (C++) interface ID3D11VideoProcessorEnumerator : ID3D11DeviceChild
{
    HRESULT GetVideoProcessorContentDesc(D3D11_VIDEO_PROCESSOR_CONTENT_DESC* pContentDesc);
    HRESULT CheckVideoProcessorFormat(DXGI_FORMAT Format, uint* pFlags);
    HRESULT GetVideoProcessorCaps(D3D11_VIDEO_PROCESSOR_CAPS* pCaps);
    HRESULT GetVideoProcessorRateConversionCaps(uint TypeIndex, D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS* pCaps);
    HRESULT GetVideoProcessorCustomRate(uint TypeIndex, uint CustomRateIndex, D3D11_VIDEO_PROCESSOR_CUSTOM_RATE* pRate);
    HRESULT GetVideoProcessorFilterRange(D3D11_VIDEO_PROCESSOR_FILTER Filter, D3D11_VIDEO_PROCESSOR_FILTER_RANGE* pRange);
}

mixin(uuid!(ID3D11VideoProcessor, "1D7B0652", "185F", "41c6", ["85", "CE", "0C", "5B", "E3", "D4", "AE", "6C"]));
extern (C++) interface ID3D11VideoProcessor : ID3D11DeviceChild
{
    void GetContentDesc(D3D11_VIDEO_PROCESSOR_CONTENT_DESC* pDesc);
    void GetRateConversionCaps(D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS* pCaps);
}

mixin(uuid!(ID3D11AuthenticatedChannel, "3015A308", "DCBD", "47aa", ["A7", "47", "19", "24", "86", "D1", "4D", "4A"]));
extern (C++) interface ID3D11AuthenticatedChannel : ID3D11DeviceChild
{
    HRESULT GetCertificateSize(uint* pCertificateSize);
    HRESULT GetCertificate(uint CertificateSize, byte* pCertificate);
    void GetChannelHandle(HANDLE* pChannelHandle);
}

mixin(uuid!(ID3D11CryptoSession, "9B32F9AD", "BDCC", "40a6", ["A3", "9D", "D5", "C8", "65", "84", "57", "20"]));
extern (C++) interface ID3D11CryptoSession : ID3D11DeviceChild
{
    void GetCryptoType(GUID* pCryptoType);
    void GetDecoderProfile(GUID* pDecoderProfile);
    HRESULT GetCertificateSize(uint* pCertificateSize);
    HRESULT GetCertificate(uint CertificateSize, byte* pCertificate);
    void GetCryptoSessionHandle(HANDLE* pCryptoSessionHandle);
}

mixin(uuid!(ID3D11VideoDecoderOutputView, "C2931AEA", "2A85", "4f20", ["86", "0F", "FB", "A1", "FD", "25", "6E", "18"]));
extern (C++) interface ID3D11VideoDecoderOutputView : ID3D11View
{
    void GetDesc(D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11VideoProcessorInputView, "11EC5A5F", "51DC", "4945", ["AB", "34", "6E", "8C", "21", "30", "0E", "A5"]));
extern (C++) interface ID3D11VideoProcessorInputView : ID3D11View
{
    void GetDesc(D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11VideoProcessorOutputView, "A048285E", "25A9", "4527", ["BD", "93", "D6", "8B", "68", "C4", "42", "54"]));
extern (C++) interface ID3D11VideoProcessorOutputView : ID3D11View
{
    void GetDesc(D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC* pDesc);
}

mixin(uuid!(ID3D11VideoContext, "61F21C45", "3C0E", "4a74", ["9C", "EA", "67", "10", "0D", "9A", "D5", "E4"]));
extern (C++) interface ID3D11VideoContext : ID3D11DeviceChild
{
    HRESULT GetDecoderBuffer(ID3D11VideoDecoder* pDecoder, D3D11_VIDEO_DECODER_BUFFER_TYPE Type, uint* pBufferSize, void** ppBuffer);
    HRESULT ReleaseDecoderBuffer(ID3D11VideoDecoder* pDecoder, D3D11_VIDEO_DECODER_BUFFER_TYPE Type);
    HRESULT DecoderBeginFrame(ID3D11VideoDecoder* pDecoder, ID3D11VideoDecoderOutputView* pView, uint ContentKeySize, const void* pContentKey);
    HRESULT DecoderEndFrame(ID3D11VideoDecoder* pDecoder);
    HRESULT SubmitDecoderBuffers(ID3D11VideoDecoder* pDecoder, uint NumBuffers, const D3D11_VIDEO_DECODER_BUFFER_DESC* pBufferDesc);
    APP_DEPRECATED_HRESULT DecoderExtension(ID3D11VideoDecoder* pDecoder, const D3D11_VIDEO_DECODER_EXTENSION* pExtensionData);
    void VideoProcessorSetOutputTargetRect(ID3D11VideoProcessor* pVideoProcessor, bool Enable, const RECT* pRect);
    void VideoProcessorSetOutputBackgroundColor(ID3D11VideoProcessor* pVideoProcessor, bool YCbCr, const D3D11_VIDEO_COLOR* pColor);
    void VideoProcessorSetOutputColorSpace(ID3D11VideoProcessor* pVideoProcessor, const D3D11_VIDEO_PROCESSOR_COLOR_SPACE* pColorSpace);
    void VideoProcessorSetOutputAlphaFillMode(ID3D11VideoProcessor* pVideoProcessor, D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE AlphaFillMode, uint StreamIndex);
    void VideoProcessorSetOutputConstriction(ID3D11VideoProcessor* pVideoProcessor, bool Enable, SIZE Size);
    void VideoProcessorSetOutputStereoMode(ID3D11VideoProcessor* pVideoProcessor, bool Enable);
    APP_DEPRECATED_HRESULT VideoProcessorSetOutputExtension(ID3D11VideoProcessor* pVideoProcessor, const GUID* pExtensionGuid, uint DataSize, void* pData);
    void VideoProcessorGetOutputTargetRect(ID3D11VideoProcessor* pVideoProcessor, bool* Enabled, RECT* pRect);
    void VideoProcessorGetOutputBackgroundColor(ID3D11VideoProcessor* pVideoProcessor, bool* pYCbCr, D3D11_VIDEO_COLOR* pColor);
    void VideoProcessorGetOutputColorSpace(ID3D11VideoProcessor* pVideoProcessor, D3D11_VIDEO_PROCESSOR_COLOR_SPACE* pColorSpace);
    void VideoProcessorGetOutputAlphaFillMode(ID3D11VideoProcessor* pVideoProcessor, D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE* pAlphaFillMode, uint* pStreamIndex);
    void VideoProcessorGetOutputConstriction(ID3D11VideoProcessor* pVideoProcessor, bool* pEnabled, SIZE* pSize);
    void VideoProcessorGetOutputStereoMode(ID3D11VideoProcessor* pVideoProcessor, bool* pEnabled);
    APP_DEPRECATED_HRESULT VideoProcessorGetOutputExtension(ID3D11VideoProcessor* pVideoProcessor, const GUID* pExtensionGuid, uint DataSize, void* pData);
    void VideoProcessorSetStreamFrameFormat(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_FRAME_FORMAT FrameFormat);
    void VideoProcessorSetStreamColorSpace(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, const D3D11_VIDEO_PROCESSOR_COLOR_SPACE* pColorSpace);
    void VideoProcessorSetStreamOutputRate(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_PROCESSOR_OUTPUT_RATE OutputRate, bool RepeatFrame, const DXGI_RATIONAL* pCustomRate);
    void VideoProcessorSetStreamSourceRect(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, const RECT* pRect);
    void VideoProcessorSetStreamDestRect(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, const RECT* pRect);
    void VideoProcessorSetStreamAlpha(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, float Alpha);
    void VideoProcessorSetStreamPalette(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, uint Count, const uint* pEntries);
    void VideoProcessorSetStreamPixelAspectRatio(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, const DXGI_RATIONAL* pSourceAspectRatio, const DXGI_RATIONAL* pDestinationAspectRatio);
    void VideoProcessorSetStreamLumaKey(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, float Lower, float Upper);
    void VideoProcessorSetStreamStereoFormat(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, D3D11_VIDEO_PROCESSOR_STEREO_FORMAT Format, bool LeftViewFrame0, bool BaseViewFrame0, D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE FlipMode, int MonoOffset);
    void VideoProcessorSetStreamAutoProcessingMode(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable);
    void VideoProcessorSetStreamFilter(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_PROCESSOR_FILTER Filter, bool Enable, int Level);
    APP_DEPRECATED_HRESULT VideoProcessorSetStreamExtension(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, const GUID* pExtensionGuid, uint DataSize, void* pData);
    void VideoProcessorGetStreamFrameFormat(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_FRAME_FORMAT* pFrameFormat);
    void VideoProcessorGetStreamColorSpace(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_PROCESSOR_COLOR_SPACE* pColorSpace);
    void VideoProcessorGetStreamOutputRate(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_PROCESSOR_OUTPUT_RATE* pOutputRate, bool* pRepeatFrame, DXGI_RATIONAL* pCustomRate);
    void VideoProcessorGetStreamSourceRect(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnabled, RECT* pRect);
    void VideoProcessorGetStreamDestRect(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnabled, RECT* pRect);
    void VideoProcessorGetStreamAlpha(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnabled, float* pAlpha);
    void VideoProcessorGetStreamPalette(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, uint Count, uint* pEntries);
    void VideoProcessorGetStreamPixelAspectRatio(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnabled, DXGI_RATIONAL* pSourceAspectRatio, DXGI_RATIONAL* pDestinationAspectRatio);
    void VideoProcessorGetStreamLumaKey(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnabled, float* pLower, float* pUpper);
    void VideoProcessorGetStreamStereoFormat(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnable, D3D11_VIDEO_PROCESSOR_STEREO_FORMAT* pFormat, bool* pLeftViewFrame0, bool* pBaseViewFrame0, D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE* pFlipMode, int* MonoOffset);
    void VideoProcessorGetStreamAutoProcessingMode(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnabled);
    void VideoProcessorGetStreamFilter(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, D3D11_VIDEO_PROCESSOR_FILTER Filter, bool* pEnabled, int* pLevel);
    APP_DEPRECATED_HRESULT VideoProcessorGetStreamExtension(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, const GUID* pExtensionGuid, uint DataSize, void* pData);
    HRESULT VideoProcessorBlt(ID3D11VideoProcessor* pVideoProcessor, ID3D11VideoProcessorOutputView* pView, uint OutputFrame, uint StreamCount, const D3D11_VIDEO_PROCESSOR_STREAM* pStreams);
    HRESULT NegotiateCryptoSessionKeyExchange(ID3D11CryptoSession* pCryptoSession, uint DataSize, void* pData);
    void EncryptionBlt(ID3D11CryptoSession* pCryptoSession, ID3D11Texture2D* pSrcSurface, ID3D11Texture2D* pDstSurface, uint IVSize, void* pIV);
    void DecryptionBlt(ID3D11CryptoSession* pCryptoSession, ID3D11Texture2D* pSrcSurface, ID3D11Texture2D* pDstSurface, D3D11_ENCRYPTED_BLOCK_INFO* pEncryptedBlockInfo, uint ContentKeySize, const void* pContentKey, uint IVSize, void* pIV);
    void StartSessionKeyRefresh(ID3D11CryptoSession* pCryptoSession, uint RandomNumberSize, void* pRandomNumber);
    void FinishSessionKeyRefresh(ID3D11CryptoSession* pCryptoSession);
    HRESULT GetEncryptionBltKey(ID3D11CryptoSession* pCryptoSession, uint KeySize, void* pReadbackKey);
    HRESULT NegotiateAuthenticatedChannelKeyExchange(ID3D11AuthenticatedChannel* pChannel, uint DataSize, void* pData);
    HRESULT QueryAuthenticatedChannel(ID3D11AuthenticatedChannel* pChannel, uint InputSize, const void* pInput, uint OutputSize, void* pOutput);
    HRESULT ConfigureAuthenticatedChannel(ID3D11AuthenticatedChannel* pChannel, uint InputSize, const void* pInput, D3D11_AUTHENTICATED_CONFIGURE_OUTPUT* pOutput);
    void VideoProcessorSetStreamRotation(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, D3D11_VIDEO_PROCESSOR_ROTATION Rotation);
    void VideoProcessorGetStreamRotation(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnable, D3D11_VIDEO_PROCESSOR_ROTATION* pRotation);
}

mixin(uuid!(ID3D11VideoDevice, "10EC4D5B", "975A", "4689", ["B9", "E4", "D0", "AA", "C3", "0F", "E3", "33"]));
extern (C++) interface ID3D11VideoDevice : IUnknown
{
    HRESULT QueryInterface(REFIID riid, void** ppvObject);
    ULONG AddRef();
    ULONG Release();
    HRESULT CreateVideoDecoder(const D3D11_VIDEO_DECODER_DESC* pVideoDesc, const D3D11_VIDEO_DECODER_CONFIG* pConfig, ID3D11VideoDecoder** ppDecoder);
    HRESULT CreateVideoProcessor(ID3D11VideoProcessorEnumerator* pEnum, uint RateConversionIndex, ID3D11VideoProcessor** ppVideoProcessor);
    HRESULT CreateAuthenticatedChannel(D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType, ID3D11AuthenticatedChannel** ppAuthenticatedChannel);
    HRESULT CreateCryptoSession(const GUID* pCryptoType, const GUID* pDecoderProfile, const GUID* pKeyExchangeType, ID3D11CryptoSession** ppCryptoSession);
    HRESULT CreateVideoDecoderOutputView(ID3D11Resource* pResource, const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC* pDesc, ID3D11VideoDecoderOutputView** ppVDOVView);
    HRESULT CreateVideoProcessorInputView(ID3D11Resource* pResource, ID3D11VideoProcessorEnumerator* pEnum, const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC* pDesc, ID3D11VideoProcessorInputView** ppVPIView);
    HRESULT CreateVideoProcessorOutputView(ID3D11Resource* pResource, ID3D11VideoProcessorEnumerator* pEnum, const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC* pDesc, ID3D11VideoProcessorOutputView** ppVPOView);
    HRESULT CreateVideoProcessorEnumerator(const D3D11_VIDEO_PROCESSOR_CONTENT_DESC* pDesc, ID3D11VideoProcessorEnumerator** ppEnum);
    uint GetVideoDecoderProfileCount();
    HRESULT GetVideoDecoderProfile(uint Index, GUID* pDecoderProfile);
    HRESULT CheckVideoDecoderFormat(const GUID* pDecoderProfile, DXGI_FORMAT Format, bool* pSupported);
    HRESULT GetVideoDecoderConfigCount(const D3D11_VIDEO_DECODER_DESC* pDesc, uint* pCount);
    HRESULT GetVideoDecoderConfig(const D3D11_VIDEO_DECODER_DESC* pDesc, uint Index, D3D11_VIDEO_DECODER_CONFIG* pConfig);
    HRESULT GetContentProtectionCaps(const GUID* pCryptoType, const GUID* pDecoderProfile, D3D11_VIDEO_CONTENT_PROTECTION_CAPS* pCaps);
    HRESULT CheckCryptoKeyExchange(const GUID* pCryptoType, const GUID* pDecoderProfile, uint Index, GUID* pKeyExchangeType);
    HRESULT SetPrivateData(REFGUID guid, uint DataSize, const void* pData);
    HRESULT SetPrivateDataInterface(REFGUID guid, const IUnknown* pData);
}

mixin(uuid!(ID3D11Device, "db6f6ddb", "ac77", "4e88", ["82", "53", "81", "9d", "f9", "bb", "f1", "40"]));
extern (C++) interface ID3D11Device : IUnknown
{
    HRESULT QueryInterface(REFIID riid, void** ppvObject);
    ULONG AddRef();
    ULONG Release();
    HRESULT CreateBuffer(const D3D11_BUFFER_DESC* pDesc, const D3D11_SUBRESOURCE_DATA* pInitialData, ID3D11Buffer** ppBuffer);
    HRESULT CreateTexture1D(const D3D11_TEXTURE1D_DESC* pDesc, const D3D11_SUBRESOURCE_DATA* pInitialData, ID3D11Texture1D** ppTexture1D);
    HRESULT CreateTexture2D(const D3D11_TEXTURE2D_DESC* pDesc, const D3D11_SUBRESOURCE_DATA* pInitialData, ID3D11Texture2D** ppTexture2D);
    HRESULT CreateTexture3D(const D3D11_TEXTURE3D_DESC* pDesc, const D3D11_SUBRESOURCE_DATA* pInitialData, ID3D11Texture3D** ppTexture3D);
    HRESULT CreateShaderResourceView(ID3D11Resource* pResource, const D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc, ID3D11ShaderResourceView** ppSRView);
    HRESULT CreateUnorderedAccessView(ID3D11Resource* pResource, const D3D11_UNORDERED_ACCESS_VIEW_DESC* pDesc, ID3D11UnorderedAccessView** ppUAView);
    HRESULT CreateRenderTargetView(ID3D11Resource* pResource, const D3D11_RENDER_TARGET_VIEW_DESC* pDesc, ID3D11RenderTargetView** ppRTView);
    HRESULT CreateDepthStencilView(ID3D11Resource* pResource, const D3D11_DEPTH_STENCIL_VIEW_DESC* pDesc, ID3D11DepthStencilView** ppDepthStencilView);
    HRESULT CreateInputLayout(const D3D11_INPUT_ELEMENT_DESC* pInputElementDescs, uint NumElements, const void* pShaderBytecodeWithInputSignature, size_t BytecodeLength, ID3D11InputLayout** ppInputLayout);
    HRESULT CreateVertexShader(const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, ID3D11VertexShader** ppVertexShader);
    HRESULT CreateGeometryShader(const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, ID3D11GeometryShader** ppGeometryShader);
    HRESULT CreateGeometryShaderWithStreamOutput(const void* pShaderBytecode, size_t BytecodeLength, const D3D11_SO_DECLARATION_ENTRY* pSODeclaration, uint NumEntries, const uint* pBufferStrides, uint NumStrides, uint RasterizedStream, ID3D11ClassLinkage* pClassLinkage, ID3D11GeometryShader** ppGeometryShader);
    HRESULT CreatePixelShader(const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, ID3D11PixelShader** ppPixelShader);
    HRESULT CreateHullShader(const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, ID3D11HullShader** ppHullShader);
    HRESULT CreateDomainShader(const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, ID3D11DomainShader** ppDomainShader);
    HRESULT CreateComputeShader(const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, ID3D11ComputeShader** ppComputeShader);
    HRESULT CreateClassLinkage(ID3D11ClassLinkage** ppLinkage);
    HRESULT CreateBlendState(const D3D11_BLEND_DESC* pBlendStateDesc, ID3D11BlendState** ppBlendState);
    HRESULT CreateDepthStencilState(const D3D11_DEPTH_STENCIL_DESC* pDepthStencilDesc, ID3D11DepthStencilState** ppDepthStencilState);
    HRESULT CreateRasterizerState(const D3D11_RASTERIZER_DESC* pRasterizerDesc, ID3D11RasterizerState** ppRasterizerState);
    HRESULT CreateSamplerState(const D3D11_SAMPLER_DESC* pSamplerDesc, ID3D11SamplerState** ppSamplerState);
    HRESULT CreateQuery(const D3D11_QUERY_DESC* pQueryDesc, ID3D11Query** ppQuery);
    HRESULT CreatePredicate(const D3D11_QUERY_DESC* pPredicateDesc, ID3D11Predicate** ppPredicate);
    HRESULT CreateCounter(const D3D11_COUNTER_DESC* pCounterDesc, ID3D11Counter** ppCounter);
    HRESULT CreateDeferredContext(uint ContextFlags, ID3D11DeviceContext** ppDeferredContext);
    HRESULT OpenSharedResource(HANDLE hResource, REFIID ReturnedInterface, void** ppResource);
    HRESULT CheckFormatSupport(DXGI_FORMAT Format, uint* pFormatSupport);
    HRESULT CheckMultisampleQualityLevels(DXGI_FORMAT Format, uint SampleCount, uint* pNumQualityLevels);
    void CheckCounterInfo(D3D11_COUNTER_INFO* pCounterInfo);
    HRESULT CheckCounter(const D3D11_COUNTER_DESC* pDesc, D3D11_COUNTER_TYPE* pType, uint* pActiveCounters, LPSTR szName, uint* pNameLength, LPSTR szUnits, uint* pUnitsLength, LPSTR szDescription, uint* pDescriptionLength);
    HRESULT CheckFeatureSupport(D3D11_FEATURE Feature, void* pFeatureSupportData, uint FeatureSupportDataSize);
    HRESULT GetPrivateData(REFGUID guid, uint* pDataSize, void* pData);
    HRESULT SetPrivateData(REFGUID guid, uint DataSize, const void* pData);
    HRESULT SetPrivateDataInterface(REFGUID guid, const IUnknown* pData);
    D3D_FEATURE_LEVEL GetFeatureLevel();
    uint GetCreationFlags();
    HRESULT GetDeviceRemovedReason();
    void GetImmediateContext(ID3D11DeviceContext** ppImmediateContext);
    HRESULT SetExceptionMode(uint RaiseFlags);
    uint GetExceptionMode();
}

enum D3D11_16BIT_INDEX_STRIP_CUT_VALUE = (0xffff);
enum D3D11_32BIT_INDEX_STRIP_CUT_VALUE = (0xffffffff);
enum D3D11_8BIT_INDEX_STRIP_CUT_VALUE = (0xff);
enum D3D11_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT = (9);
enum D3D11_CLIP_OR_CULL_DISTANCE_COUNT = (8);
enum D3D11_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT = (2);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = (14);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS = (4);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT = (32);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT = (15);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT = (16);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS = (4);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT = (15);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST = (1);
enum D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS = (1);
enum D3D11_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT = (64);
enum D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS = (4);
enum D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT = (1);
enum D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST = (1);
enum D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS = (1);
enum D3D11_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT = (32);
enum D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS = (1);
enum D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT = (128);
enum D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST = (1);
enum D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS = (1);
enum D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT = (128);
enum D3D11_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS = (1);
enum D3D11_COMMONSHADER_SAMPLER_REGISTER_COUNT = (16);
enum D3D11_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST = (1);
enum D3D11_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS = (1);
enum D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT = (16);
enum D3D11_COMMONSHADER_SUBROUTINE_NESTING_LIMIT = (32);
enum D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENTS = (4);
enum D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_COMMONSHADER_TEMP_REGISTER_COUNT = (4096);
enum D3D11_COMMONSHADER_TEMP_REGISTER_READS_PER_INST = (3);
enum D3D11_COMMONSHADER_TEMP_REGISTER_READ_PORTS = (3);
enum D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX = (10);
enum D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN = (-10);
enum D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE = (-8);
enum D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE = (7);
enum D3D11_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (256);
enum D3D11_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP = (64);
enum D3D11_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (240);
enum D3D11_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP = (68);
enum D3D11_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (224);
enum D3D11_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP = (72);
enum D3D11_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (208);
enum D3D11_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP = (76);
enum D3D11_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (192);
enum D3D11_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP = (84);
enum D3D11_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (176);
enum D3D11_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP = (92);
enum D3D11_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (160);
enum D3D11_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP = (100);
enum D3D11_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (144);
enum D3D11_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP = (112);
enum D3D11_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (128);
enum D3D11_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP = (128);
enum D3D11_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (112);
enum D3D11_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP = (144);
enum D3D11_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (96);
enum D3D11_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP = (168);
enum D3D11_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (80);
enum D3D11_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP = (204);
enum D3D11_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (64);
enum D3D11_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP = (256);
enum D3D11_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (48);
enum D3D11_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP = (340);
enum D3D11_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (32);
enum D3D11_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP = (512);
enum D3D11_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = (16);
enum D3D11_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP = (768);
enum D3D11_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION = (1);
enum D3D11_CS_4_X_RAW_UAV_BYTE_ALIGNMENT = (256);
enum D3D11_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP = (768);
enum D3D11_CS_4_X_THREAD_GROUP_MAX_X = (768);
enum D3D11_CS_4_X_THREAD_GROUP_MAX_Y = (768);
enum D3D11_CS_4_X_UAV_REGISTER_COUNT = (1);
enum D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION = (65535);
enum D3D11_CS_TGSM_REGISTER_COUNT = (8192);
enum D3D11_CS_TGSM_REGISTER_READS_PER_INST = (1);
enum D3D11_CS_TGSM_RESOURCE_REGISTER_COMPONENTS = (1);
enum D3D11_CS_TGSM_RESOURCE_REGISTER_READ_PORTS = (1);
enum D3D11_CS_THREADGROUPID_REGISTER_COMPONENTS = (3);
enum D3D11_CS_THREADGROUPID_REGISTER_COUNT = (1);
enum D3D11_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS = (1);
enum D3D11_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT = (1);
enum D3D11_CS_THREADIDINGROUP_REGISTER_COMPONENTS = (3);
enum D3D11_CS_THREADIDINGROUP_REGISTER_COUNT = (1);
enum D3D11_CS_THREADID_REGISTER_COMPONENTS = (3);
enum D3D11_CS_THREADID_REGISTER_COUNT = (1);
enum D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP = (1024);
enum D3D11_CS_THREAD_GROUP_MAX_X = (1024);
enum D3D11_CS_THREAD_GROUP_MAX_Y = (1024);
enum D3D11_CS_THREAD_GROUP_MAX_Z = (64);
enum D3D11_CS_THREAD_GROUP_MIN_X = (1);
enum D3D11_CS_THREAD_GROUP_MIN_Y = (1);
enum D3D11_CS_THREAD_GROUP_MIN_Z = (1);
enum D3D11_CS_THREAD_LOCAL_TEMP_REGISTER_POOL = (16384);
enum D3D11_DEFAULT_BLEND_FACTOR_ALPHA = (1.0f);
enum D3D11_DEFAULT_BLEND_FACTOR_BLUE = (1.0f);
enum D3D11_DEFAULT_BLEND_FACTOR_GREEN = (1.0f);
enum D3D11_DEFAULT_BLEND_FACTOR_RED = (1.0f);
enum D3D11_DEFAULT_BORDER_COLOR_COMPONENT = (0.0f);
enum D3D11_DEFAULT_DEPTH_BIAS = (0);
enum D3D11_DEFAULT_DEPTH_BIAS_CLAMP = (0.0f);
enum D3D11_DEFAULT_MAX_ANISOTROPY = (16);
enum D3D11_DEFAULT_MIP_LOD_BIAS = (0.0f);
enum D3D11_DEFAULT_RENDER_TARGET_ARRAY_INDEX = (0);
enum D3D11_DEFAULT_SAMPLE_MASK = (0xffffffff);
enum D3D11_DEFAULT_SCISSOR_ENDX = (0);
enum D3D11_DEFAULT_SCISSOR_ENDY = (0);
enum D3D11_DEFAULT_SCISSOR_STARTX = (0);
enum D3D11_DEFAULT_SCISSOR_STARTY = (0);
enum D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS = (0.0f);
enum D3D11_DEFAULT_STENCIL_READ_MASK = (0xff);
enum D3D11_DEFAULT_STENCIL_REFERENCE = (0);
enum D3D11_DEFAULT_STENCIL_WRITE_MASK = (0xff);
enum D3D11_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX = (0);
enum D3D11_DEFAULT_VIEWPORT_HEIGHT = (0);
enum D3D11_DEFAULT_VIEWPORT_MAX_DEPTH = (0.0f);
enum D3D11_DEFAULT_VIEWPORT_MIN_DEPTH = (0.0f);
enum D3D11_DEFAULT_VIEWPORT_TOPLEFTX = (0);
enum D3D11_DEFAULT_VIEWPORT_TOPLEFTY = (0);
enum D3D11_DEFAULT_VIEWPORT_WIDTH = (0);
enum D3D11_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS = (3968);
enum D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS = (4);
enum D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COUNT = (32);
enum D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST = (2);
enum D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS = (1);
enum D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS = (3);
enum D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT = (1);
enum D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST = (2);
enum D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS = (1);
enum D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS = (4);
enum D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT = (32);
enum D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST = (2);
enum D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS = (1);
enum D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS = (1);
enum D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT = (1);
enum D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST = (2);
enum D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS = (1);
enum D3D11_DS_OUTPUT_REGISTER_COMPONENTS = (4);
enum D3D11_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_DS_OUTPUT_REGISTER_COUNT = (32);
enum D3D11_FLOAT16_FUSED_TOLERANCE_IN_ULP = (0.6);
enum D3D11_FLOAT32_MAX = (3.402823466e+38f);
enum D3D11_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP = (0.6f);
enum D3D11_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR = (2.4f);
enum D3D11_FLOAT_TO_SRGB_EXPONENT_NUMERATOR = (1.0f);
enum D3D11_FLOAT_TO_SRGB_OFFSET = (0.055f);
enum D3D11_FLOAT_TO_SRGB_SCALE_1 = (12.92f);
enum D3D11_FLOAT_TO_SRGB_SCALE_2 = (1.055f);
enum D3D11_FLOAT_TO_SRGB_THRESHOLD = (0.0031308f);
enum D3D11_FTOI_INSTRUCTION_MAX_INPUT = (2147483647.999f);
enum D3D11_FTOI_INSTRUCTION_MIN_INPUT = (-2147483648.999f);
enum D3D11_FTOU_INSTRUCTION_MAX_INPUT = (4294967295.999f);
enum D3D11_FTOU_INSTRUCTION_MIN_INPUT = (0.0f);
enum D3D11_GS_INPUT_INSTANCE_ID_READS_PER_INST = (2);
enum D3D11_GS_INPUT_INSTANCE_ID_READ_PORTS = (1);
enum D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS = (1);
enum D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COUNT = (1);
enum D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS = (1);
enum D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_GS_INPUT_PRIM_CONST_REGISTER_COUNT = (1);
enum D3D11_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST = (2);
enum D3D11_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS = (1);
enum D3D11_GS_INPUT_REGISTER_COMPONENTS = (4);
enum D3D11_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_GS_INPUT_REGISTER_COUNT = (32);
enum D3D11_GS_INPUT_REGISTER_READS_PER_INST = (2);
enum D3D11_GS_INPUT_REGISTER_READ_PORTS = (1);
enum D3D11_GS_INPUT_REGISTER_VERTICES = (32);
enum D3D11_GS_MAX_INSTANCE_COUNT = (32);
enum D3D11_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES = (1024);
enum D3D11_GS_OUTPUT_ELEMENTS = (32);
enum D3D11_GS_OUTPUT_REGISTER_COMPONENTS = (4);
enum D3D11_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_GS_OUTPUT_REGISTER_COUNT = (32);
enum D3D11_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT = (32);
enum D3D11_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT = (32);
enum D3D11_HS_CONTROL_POINT_REGISTER_COMPONENTS = (4);
enum D3D11_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_HS_CONTROL_POINT_REGISTER_READS_PER_INST = (2);
enum D3D11_HS_CONTROL_POINT_REGISTER_READ_PORTS = (1);
enum D3D11_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND = (0xffffffff);
enum D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS = (1);
enum D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT = (1);
enum D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST = (2);
enum D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS = (1);
enum D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS = (1);
enum D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT = (1);
enum D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST = (2);
enum D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS = (1);
enum D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS = (1);
enum D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT = (1);
enum D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST = (2);
enum D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS = (1);
enum D3D11_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND = (0xffffffff);
enum D3D11_HS_MAXTESSFACTOR_LOWER_BOUND = (1.0f);
enum D3D11_HS_MAXTESSFACTOR_UPPER_BOUND = (64.0f);
enum D3D11_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS = (3968);
enum D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS = (1);
enum D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT = (1);
enum D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST = (2);
enum D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS = (1);
enum D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS = (4);
enum D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT = (32);
enum D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST = (2);
enum D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS = (1);
enum D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS = (128);
enum D3D11_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES = (0);
enum D3D11_IA_DEFAULT_PRIMITIVE_TOPOLOGY = (0);
enum D3D11_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES = (0);
enum D3D11_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT = (1);
enum D3D11_IA_INSTANCE_ID_BIT_COUNT = (32);
enum D3D11_IA_INTEGER_ARITHMETIC_BIT_COUNT = (32);
enum D3D11_IA_PATCH_MAX_CONTROL_POINT_COUNT = (32);
enum D3D11_IA_PRIMITIVE_ID_BIT_COUNT = (32);
enum D3D11_IA_VERTEX_ID_BIT_COUNT = (32);
enum D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = (32);
enum D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS = (128);
enum D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = (32);
enum D3D11_INTEGER_DIVIDE_BY_ZERO_QUOTIENT = (0xffffffff);
enum D3D11_INTEGER_DIVIDE_BY_ZERO_REMAINDER = (0xffffffff);
enum D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL = (0xffffffff);
enum D3D11_KEEP_UNORDERED_ACCESS_VIEWS = (0xffffffff);
enum D3D11_LINEAR_GAMMA = (1.0f);
enum D3D11_MAJOR_VERSION = (11);
enum D3D11_MAX_BORDER_COLOR_COMPONENT = (1.0f);
enum D3D11_MAX_DEPTH = (1.0f);
enum D3D11_MAX_MAXANISOTROPY = (16);
enum D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT = (32);
enum D3D11_MAX_POSITION_VALUE = (3.402823466e+34f);
enum D3D11_MAX_TEXTURE_DIMENSION_2_TO_EXP = (17);
enum D3D11_MINOR_VERSION = (0);
enum D3D11_MIN_BORDER_COLOR_COMPONENT = (0.0f);
enum D3D11_MIN_DEPTH = (0.0f);
enum D3D11_MIN_MAXANISOTROPY = (0);
enum D3D11_MIP_LOD_BIAS_MAX = (15.99f);
enum D3D11_MIP_LOD_BIAS_MIN = (-16.0f);
enum D3D11_MIP_LOD_FRACTIONAL_BIT_COUNT = (8);
enum D3D11_MIP_LOD_RANGE_BIT_COUNT = (8);
enum D3D11_MULTISAMPLE_ANTIALIAS_LINE_WIDTH = (1.4f);
enum D3D11_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT = (0);
enum D3D11_PIXEL_ADDRESS_RANGE_BIT_COUNT = (15);
enum D3D11_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT = (16);
enum D3D11_PS_CS_UAV_REGISTER_COMPONENTS = (1);
enum D3D11_PS_CS_UAV_REGISTER_COUNT = (8);
enum D3D11_PS_CS_UAV_REGISTER_READS_PER_INST = (1);
enum D3D11_PS_CS_UAV_REGISTER_READ_PORTS = (1);
enum D3D11_PS_FRONTFACING_DEFAULT_VALUE = (0xffffffff);
enum D3D11_PS_FRONTFACING_FALSE_VALUE = (0);
enum D3D11_PS_FRONTFACING_TRUE_VALUE = (0xffffffff);
enum D3D11_PS_INPUT_REGISTER_COMPONENTS = (4);
enum D3D11_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_PS_INPUT_REGISTER_COUNT = (32);
enum D3D11_PS_INPUT_REGISTER_READS_PER_INST = (2);
enum D3D11_PS_INPUT_REGISTER_READ_PORTS = (1);
enum D3D11_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT = (0.0f);
enum D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS = (1);
enum D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_PS_OUTPUT_DEPTH_REGISTER_COUNT = (1);
enum D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENTS = (1);
enum D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_PS_OUTPUT_MASK_REGISTER_COUNT = (1);
enum D3D11_PS_OUTPUT_REGISTER_COMPONENTS = (4);
enum D3D11_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_PS_OUTPUT_REGISTER_COUNT = (8);
enum D3D11_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT = (0.5f);
enum D3D11_RAW_UAV_SRV_BYTE_ALIGNMENT = (16);
enum D3D11_REQ_BLEND_OBJECT_COUNT_PER_DEVICE = (4096);
enum D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP = (27);
enum D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = (4096);
enum D3D11_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE = (4096);
enum D3D11_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = (32);
enum D3D11_REQ_DRAW_VERTEX_COUNT_2_TO_EXP = (32);
enum D3D11_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION = (16384);
enum D3D11_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT = (1024);
enum D3D11_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT = (4096);
enum D3D11_REQ_MAXANISOTROPY = (16);
enum D3D11_REQ_MIP_LEVELS = (15);
enum D3D11_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES = (2048);
enum D3D11_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE = (4096);
enum D3D11_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH = (16384);
enum D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM = (128);
enum D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM = (0.25f);
enum D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM = (2048);
enum D3D11_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP = (20);
enum D3D11_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE = (4096);
enum D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION = (2048);
enum D3D11_REQ_TEXTURE1D_U_DIMENSION = (16384);
enum D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION = (2048);
enum D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION = (16384);
enum D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = (2048);
enum D3D11_REQ_TEXTURECUBE_DIMENSION = (16384);
enum D3D11_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL = (0);
enum D3D11_SHADER_MAJOR_VERSION = (5);
enum D3D11_SHADER_MAX_INSTANCES = (65535);
enum D3D11_SHADER_MAX_INTERFACES = (253);
enum D3D11_SHADER_MAX_INTERFACE_CALL_SITES = (4096);
enum D3D11_SHADER_MAX_TYPES = (65535);
enum D3D11_SHADER_MINOR_VERSION = (0);
enum D3D11_SHIFT_INSTRUCTION_PAD_VALUE = (0);
enum D3D11_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT = (5);
enum D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT = (8);
enum D3D11_SO_BUFFER_MAX_STRIDE_IN_BYTES = (2048);
enum D3D11_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = (512);
enum D3D11_SO_BUFFER_SLOT_COUNT = (4);
enum D3D11_SO_DDI_REGISTER_INDEX_DENOTING_GAP = (0xffffffff);
enum D3D11_SO_NO_RASTERIZED_STREAM = (0xffffffff);
enum D3D11_SO_OUTPUT_COMPONENT_COUNT = (128);
enum D3D11_SO_STREAM_COUNT = (4);
enum D3D11_SPEC_DATE_DAY = (16);
enum D3D11_SPEC_DATE_MONTH = (05);
enum D3D11_SPEC_DATE_YEAR = (2011);
enum D3D11_SPEC_VERSION = (1.07);
enum D3D11_SRGB_GAMMA = (2.2f);
enum D3D11_SRGB_TO_FLOAT_DENOMINATOR_1 = (12.92f);
enum D3D11_SRGB_TO_FLOAT_DENOMINATOR_2 = (1.055f);
enum D3D11_SRGB_TO_FLOAT_EXPONENT = (2.4f);
enum D3D11_SRGB_TO_FLOAT_OFFSET = (0.055f);
enum D3D11_SRGB_TO_FLOAT_THRESHOLD = (0.04045f);
enum D3D11_SRGB_TO_FLOAT_TOLERANCE_IN_ULP = (0.5f);
enum D3D11_STANDARD_COMPONENT_BIT_COUNT = (32);
enum D3D11_STANDARD_COMPONENT_BIT_COUNT_DOUBLED = (64);
enum D3D11_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE = (4);
enum D3D11_STANDARD_PIXEL_COMPONENT_COUNT = (128);
enum D3D11_STANDARD_PIXEL_ELEMENT_COUNT = (32);
enum D3D11_STANDARD_VECTOR_SIZE = (4);
enum D3D11_STANDARD_VERTEX_ELEMENT_COUNT = (32);
enum D3D11_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT = (64);
enum D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT = (8);
enum D3D11_SUBTEXEL_FRACTIONAL_BIT_COUNT = (8);
enum D3D11_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR = (64);
enum D3D11_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR = (64);
enum D3D11_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR = (63);
enum D3D11_TESSELLATOR_MAX_TESSELLATION_FACTOR = (64);
enum D3D11_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR = (2);
enum D3D11_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR = (1);
enum D3D11_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR = (1);
enum D3D11_TEXEL_ADDRESS_RANGE_BIT_COUNT = (16);
enum D3D11_UNBOUND_MEMORY_ACCESS_RESULT = (0);
enum D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = (15);
enum D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = (16);
enum D3D11_VIEWPORT_BOUNDS_MAX = (32767);
enum D3D11_VIEWPORT_BOUNDS_MIN = (-32768);
enum D3D11_VS_INPUT_REGISTER_COMPONENTS = (4);
enum D3D11_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_VS_INPUT_REGISTER_COUNT = (32);
enum D3D11_VS_INPUT_REGISTER_READS_PER_INST = (2);
enum D3D11_VS_INPUT_REGISTER_READ_PORTS = (1);
enum D3D11_VS_OUTPUT_REGISTER_COMPONENTS = (4);
enum D3D11_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = (32);
enum D3D11_VS_OUTPUT_REGISTER_COUNT = (32);
enum D3D11_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT = (10);
enum D3D11_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = (25);
enum D3D11_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP = (25);
enum D3D11_1_UAV_SLOT_COUNT = (64);
enum D3D11_2_TILED_RESOURCE_TILE_SIZE_IN_BYTES = (65536);
enum D3D11_4_VIDEO_DECODER_MAX_HISTOGRAM_COMPONENTS = (4);
enum D3D11_4_VIDEO_DECODER_HISTOGRAM_OFFSET_ALIGNMENT = (256);
enum _FACD3D11 = (0x87c);
enum _FACD3D11DEBUG = (_FACD3D11 + 1);

HRESULT MAKE_D3D11_HRESULT(T)(T code)
{
    return MAKE_HRESULT(1, _FACD3D11, code);
}

HRESULT MAKE_D3D11_STATUS(T)(T code)
{
    return MAKE_HRESULT(0, _FACD3D11, code);
}

struct CD3D11_DEFAULT
{
}

alias D3D11_DEFAULT = CD3D11_DEFAULT;
alias D3D11_INPUT_CLASSIFICATION = uint;
enum : D3D11_INPUT_CLASSIFICATION
{
    D3D11_INPUT_PER_VERTEX_DATA = 0,
    D3D11_INPUT_PER_INSTANCE_DATA = 1
}
struct D3D11_INPUT_ELEMENT_DESC
{
    LPCSTR SemanticName;
    uint SemanticIndex;
    DXGI_FORMAT Format;
    uint InputSlot;
    uint AlignedByteOffset;
    D3D11_INPUT_CLASSIFICATION InputSlotClass;
    uint InstanceDataStepRate;
}

alias D3D11_FILL_MODE = uint;
enum : D3D11_FILL_MODE
{
    D3D11_FILL_WIREFRAME = 2,
    D3D11_FILL_SOLID = 3
}
alias D3D11_PRIMITIVE_TOPOLOGY = D3D_PRIMITIVE_TOPOLOGY;
alias D3D11_PRIMITIVE = D3D_PRIMITIVE;
alias D3D11_CULL_MODE = uint;
enum : D3D11_CULL_MODE
{
    D3D11_CULL_NONE = 1,
    D3D11_CULL_FRONT = 2,
    D3D11_CULL_BACK = 3
}
struct D3D11_SO_DECLARATION_ENTRY
{
    uint Stream;
    LPCSTR SemanticName;
    uint SemanticIndex;
    byte StartComponent;
    byte ComponentCount;
    byte OutputSlot;
}

struct D3D11_VIEWPORT
{
    float TopLeftX;
    float TopLeftY;
    float Width;
    float Height;
    float MinDepth;
    float MaxDepth;
}

bool opEquals(ref const D3D11_VIEWPORT l, ref const D3D11_VIEWPORT r)
{
    return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth;
}

struct D3D11_DRAW_INSTANCED_INDIRECT_ARGS
{
    uint VertexCountPerInstance;
    uint InstanceCount;
    uint StartVertexLocation;
    uint StartInstanceLocation;
}

struct D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS
{
    uint IndexCountPerInstance;
    uint InstanceCount;
    uint StartIndexLocation;
    int BaseVertexLocation;
    uint StartInstanceLocation;
}

alias D3D11_RESOURCE_DIMENSION = uint;
enum : D3D11_RESOURCE_DIMENSION
{
    D3D11_RESOURCE_DIMENSION_UNKNOWN = 0,
    D3D11_RESOURCE_DIMENSION_BUFFER = 1,
    D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2,
    D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3,
    D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4
}
alias D3D11_SRV_DIMENSION = D3D_SRV_DIMENSION;
alias D3D11_DSV_DIMENSION = uint;
enum : D3D11_DSV_DIMENSION
{
    D3D11_DSV_DIMENSION_UNKNOWN = 0,
    D3D11_DSV_DIMENSION_TEXTURE1D = 1,
    D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2,
    D3D11_DSV_DIMENSION_TEXTURE2D = 3,
    D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4,
    D3D11_DSV_DIMENSION_TEXTURE2DMS = 5,
    D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
}
alias D3D11_RTV_DIMENSION = uint;
enum : D3D11_RTV_DIMENSION
{
    D3D11_RTV_DIMENSION_UNKNOWN = 0,
    D3D11_RTV_DIMENSION_BUFFER = 1,
    D3D11_RTV_DIMENSION_TEXTURE1D = 2,
    D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3,
    D3D11_RTV_DIMENSION_TEXTURE2D = 4,
    D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5,
    D3D11_RTV_DIMENSION_TEXTURE2DMS = 6,
    D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
    D3D11_RTV_DIMENSION_TEXTURE3D = 8
}
alias D3D11_UAV_DIMENSION = uint;
enum : D3D11_UAV_DIMENSION
{
    D3D11_UAV_DIMENSION_UNKNOWN = 0,
    D3D11_UAV_DIMENSION_BUFFER = 1,
    D3D11_UAV_DIMENSION_TEXTURE1D = 2,
    D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3,
    D3D11_UAV_DIMENSION_TEXTURE2D = 4,
    D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5,
    D3D11_UAV_DIMENSION_TEXTURE3D = 8
}
alias D3D11_USAGE = uint;
enum : D3D11_USAGE
{
    D3D11_USAGE_DEFAULT = 0,
    D3D11_USAGE_IMMUTABLE = 1,
    D3D11_USAGE_DYNAMIC = 2,
    D3D11_USAGE_STAGING = 3
}
alias D3D11_BIND_FLAG = uint;
enum : D3D11_BIND_FLAG
{
    D3D11_BIND_VERTEX_BUFFER = 0x1L,
    D3D11_BIND_INDEX_BUFFER = 0x2L,
    D3D11_BIND_CONSTANT_BUFFER = 0x4L,
    D3D11_BIND_SHADER_RESOURCE = 0x8L,
    D3D11_BIND_STREAM_OUTPUT = 0x10L,
    D3D11_BIND_RENDER_TARGET = 0x20L,
    D3D11_BIND_DEPTH_STENCIL = 0x40L,
    D3D11_BIND_UNORDERED_ACCESS = 0x80L,
    D3D11_BIND_DECODER = 0x200L,
    D3D11_BIND_VIDEO_ENCODER = 0x400L
}
alias D3D11_CPU_ACCESS_FLAG = uint;
enum : D3D11_CPU_ACCESS_FLAG
{
    D3D11_CPU_ACCESS_WRITE = 0x10000L,
    D3D11_CPU_ACCESS_READ = 0x20000L
}
alias D3D11_RESOURCE_MISC_FLAG = uint;
enum : D3D11_RESOURCE_MISC_FLAG
{
    D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1L,
    D3D11_RESOURCE_MISC_SHARED = 0x2L,
    D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4L,
    D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L,
    D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L,
    D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L,
    D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80L,
    D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100L,
    D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200L,
    D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x800L,
    D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x1000L,
    D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x2000L,
    D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x4000L,
    D3D11_RESOURCE_MISC_GUARDED = 0x8000L,
    D3D11_RESOURCE_MISC_TILE_POOL = 0x20000L,
    D3D11_RESOURCE_MISC_TILED = 0x40000L,
    D3D11_RESOURCE_MISC_HW_PROTECTED = 0x80000L
}
alias D3D11_MAP = uint;
enum : D3D11_MAP
{
    D3D11_MAP_READ = 1,
    D3D11_MAP_WRITE = 2,
    D3D11_MAP_READ_WRITE = 3,
    D3D11_MAP_WRITE_DISCARD = 4,
    D3D11_MAP_WRITE_NO_OVERWRITE = 5
}
alias D3D11_MAP_FLAG = uint;
enum : D3D11_MAP_FLAG
{
    D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L
}
alias D3D11_RAISE_FLAG = uint;
enum : D3D11_RAISE_FLAG
{
    D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L
}
alias D3D11_CLEAR_FLAG = uint;
enum : D3D11_CLEAR_FLAG
{
    D3D11_CLEAR_DEPTH = 0x1L,
    D3D11_CLEAR_STENCIL = 0x2L
}
alias D3D11_RECT = RECT;
class CD3D11_RECT
{
    long left;
    long top;
    long right;
    long bottom;
    this(long Left, long Top, long Right, long Bottom)
    {
        this.left = Left;
        this.top = Top;
        this.right = Right;
        this.bottom = Bottom;
    }
}

bool opEquals(ref const D3D11_RECT l, ref const D3D11_RECT r)
{
    return l.left == r.left && l.top == r.top && l.right == r.right && l.bottom == r.bottom;
}

struct D3D11_BOX
{
    uint left;
    uint top;
    uint front;
    uint right;
    uint bottom;
    uint back;
}

class CD3D11_BOX
{
    uint left;
    uint top;
    uint front;
    uint right;
    uint bottom;
    uint back;
    this(uint Left, uint Top, uint Front, uint Right, uint Bottom, uint Back)
    {
        this.left = Left;
        this.top = Top;
        this.front = Front;
        this.right = Right;
        this.bottom = Bottom;
        this.back = Back;
    }
}

bool opEquals(ref const D3D11_BOX l, ref const D3D11_BOX r)
{
    return l.left == r.left && l.top == r.top && l.front == r.front && l.right == r.right && l.bottom == r.bottom && l.back == r.back;
}

alias D3D11_COMPARISON_FUNC = uint;
enum : D3D11_COMPARISON_FUNC
{
    D3D11_COMPARISON_NEVER = 1,
    D3D11_COMPARISON_LESS = 2,
    D3D11_COMPARISON_EQUAL = 3,
    D3D11_COMPARISON_LESS_EQUAL = 4,
    D3D11_COMPARISON_GREATER = 5,
    D3D11_COMPARISON_NOT_EQUAL = 6,
    D3D11_COMPARISON_GREATER_EQUAL = 7,
    D3D11_COMPARISON_ALWAYS = 8
}
alias D3D11_DEPTH_WRITE_MASK = uint;
enum : D3D11_DEPTH_WRITE_MASK
{
    D3D11_DEPTH_WRITE_MASK_ZERO = 0,
    D3D11_DEPTH_WRITE_MASK_ALL = 1
}
alias D3D11_STENCIL_OP = uint;
enum : D3D11_STENCIL_OP
{
    D3D11_STENCIL_OP_KEEP = 1,
    D3D11_STENCIL_OP_ZERO = 2,
    D3D11_STENCIL_OP_REPLACE = 3,
    D3D11_STENCIL_OP_INCR_SAT = 4,
    D3D11_STENCIL_OP_DECR_SAT = 5,
    D3D11_STENCIL_OP_INVERT = 6,
    D3D11_STENCIL_OP_INCR = 7,
    D3D11_STENCIL_OP_DECR = 8
}
struct D3D11_DEPTH_STENCILOP_DESC
{
    D3D11_STENCIL_OP StencilFailOp;
    D3D11_STENCIL_OP StencilDepthFailOp;
    D3D11_STENCIL_OP StencilPassOp;
    D3D11_COMPARISON_FUNC StencilFunc;
}

struct D3D11_DEPTH_STENCIL_DESC
{
    bool DepthEnable;
    D3D11_DEPTH_WRITE_MASK DepthWriteMask;
    D3D11_COMPARISON_FUNC DepthFunc;
    bool StencilEnable;
    ubyte StencilReadMask;
    ubyte StencilWriteMask;
    D3D11_DEPTH_STENCILOP_DESC FrontFace;
    D3D11_DEPTH_STENCILOP_DESC BackFace;
}

class CD3D11_DEPTH_STENCIL_DESC
{
    bool DepthEnable;
    D3D11_DEPTH_WRITE_MASK DepthWriteMask;
    D3D11_COMPARISON_FUNC DepthFunc;
    bool StencilEnable;
    ubyte StencilReadMask;
    ubyte StencilWriteMask;
    D3D11_DEPTH_STENCILOP_DESC FrontFace;
    D3D11_DEPTH_STENCILOP_DESC BackFace;
    this(CD3D11_DEFAULT)
    {
        this.DepthEnable = TRUE;
        this.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
        this.DepthFunc = D3D11_COMPARISON_LESS;
        this.StencilEnable = FALSE;
        this.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
        this.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
        const D3D11_DEPTH_STENCILOP_DESC defaultStencilOp = {D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS};
        this.FrontFace = defaultStencilOp;
        this.BackFace = defaultStencilOp;
    }

    this(bool depthEnable, D3D11_DEPTH_WRITE_MASK depthWriteMask, D3D11_COMPARISON_FUNC depthFunc, bool stencilEnable, ubyte stencilReadMask, ubyte stencilWriteMask, D3D11_STENCIL_OP frontStencilFailOp, D3D11_STENCIL_OP frontStencilDepthFailOp, D3D11_STENCIL_OP frontStencilPassOp, D3D11_COMPARISON_FUNC frontStencilFunc, D3D11_STENCIL_OP backStencilFailOp, D3D11_STENCIL_OP backStencilDepthFailOp,
            D3D11_STENCIL_OP backStencilPassOp, D3D11_COMPARISON_FUNC backStencilFunc)
    {
        this.DepthEnable = depthEnable;
        this.DepthWriteMask = depthWriteMask;
        this.DepthFunc = depthFunc;
        this.StencilEnable = stencilEnable;
        this.StencilReadMask = stencilReadMask;
        this.StencilWriteMask = stencilWriteMask;
        this.FrontFace.StencilFailOp = frontStencilFailOp;
        this.FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
        this.FrontFace.StencilPassOp = frontStencilPassOp;
        this.FrontFace.StencilFunc = frontStencilFunc;
        this.BackFace.StencilFailOp = backStencilFailOp;
        this.BackFace.StencilDepthFailOp = backStencilDepthFailOp;
        this.BackFace.StencilPassOp = backStencilPassOp;
        this.BackFace.StencilFunc = backStencilFunc;
    }
}

alias D3D11_BLEND = uint;
enum : D3D11_BLEND
{
    D3D11_BLEND_ZERO = 1,
    D3D11_BLEND_ONE = 2,
    D3D11_BLEND_SRC_COLOR = 3,
    D3D11_BLEND_INV_SRC_COLOR = 4,
    D3D11_BLEND_SRC_ALPHA = 5,
    D3D11_BLEND_INV_SRC_ALPHA = 6,
    D3D11_BLEND_DEST_ALPHA = 7,
    D3D11_BLEND_INV_DEST_ALPHA = 8,
    D3D11_BLEND_DEST_COLOR = 9,
    D3D11_BLEND_INV_DEST_COLOR = 10,
    D3D11_BLEND_SRC_ALPHA_SAT = 11,
    D3D11_BLEND_BLEND_FACTOR = 14,
    D3D11_BLEND_INV_BLEND_FACTOR = 15,
    D3D11_BLEND_SRC1_COLOR = 16,
    D3D11_BLEND_INV_SRC1_COLOR = 17,
    D3D11_BLEND_SRC1_ALPHA = 18,
    D3D11_BLEND_INV_SRC1_ALPHA = 19
}
alias D3D11_BLEND_OP = uint;
enum : D3D11_BLEND_OP
{
    D3D11_BLEND_OP_ADD = 1,
    D3D11_BLEND_OP_SUBTRACT = 2,
    D3D11_BLEND_OP_REV_SUBTRACT = 3,
    D3D11_BLEND_OP_MIN = 4,
    D3D11_BLEND_OP_MAX = 5
}
alias D3D11_COLOR_WRITE_ENABLE = uint;
enum : D3D11_COLOR_WRITE_ENABLE
{
    D3D11_COLOR_WRITE_ENABLE_RED = 1,
    D3D11_COLOR_WRITE_ENABLE_GREEN = 2,
    D3D11_COLOR_WRITE_ENABLE_BLUE = 4,
    D3D11_COLOR_WRITE_ENABLE_ALPHA = 8,
    D3D11_COLOR_WRITE_ENABLE_ALL = (((D3D11_COLOR_WRITE_ENABLE_RED | D3D11_COLOR_WRITE_ENABLE_GREEN) | D3D11_COLOR_WRITE_ENABLE_BLUE) | D3D11_COLOR_WRITE_ENABLE_ALPHA)
}
struct D3D11_RENDER_TARGET_BLEND_DESC
{
    bool BlendEnable;
    D3D11_BLEND SrcBlend;
    D3D11_BLEND DestBlend;
    D3D11_BLEND_OP BlendOp;
    D3D11_BLEND SrcBlendAlpha;
    D3D11_BLEND DestBlendAlpha;
    D3D11_BLEND_OP BlendOpAlpha;
    ubyte RenderTargetWriteMask;
}

struct D3D11_BLEND_DESC
{
    bool AlphaToCoverageEnable;
    bool IndependentBlendEnable;
    D3D11_RENDER_TARGET_BLEND_DESC[8] RenderTarget;
}

class CD3D11_BLEND_DESC
{
    bool AlphaToCoverageEnable;
    bool IndependentBlendEnable;
    D3D11_RENDER_TARGET_BLEND_DESC[8] RenderTarget;
    this(CD3D11_DEFAULT)
    {
        this.AlphaToCoverageEnable = FALSE;
        this.IndependentBlendEnable = FALSE;
        const D3D11_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = {FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL};
        for (uint i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
            this.RenderTarget[i] = defaultRenderTargetBlendDesc;
    }
}

struct D3D11_RASTERIZER_DESC
{
    D3D11_FILL_MODE FillMode;
    D3D11_CULL_MODE CullMode;
    bool FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    bool DepthClipEnable;
    bool ScissorEnable;
    bool MultisampleEnable;
    bool AntialiasedLineEnable;
}

class CD3D11_RASTERIZER_DESC
{
    D3D11_FILL_MODE FillMode;
    D3D11_CULL_MODE CullMode;
    bool FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    bool DepthClipEnable;
    bool ScissorEnable;
    bool MultisampleEnable;
    bool AntialiasedLineEnable;
    this(CD3D11_DEFAULT)
    {
        this.FillMode = D3D11_FILL_SOLID;
        this.CullMode = D3D11_CULL_BACK;
        this.FrontCounterClockwise = FALSE;
        this.DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
        this.DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
        this.SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
        this.DepthClipEnable = TRUE;
        this.ScissorEnable = FALSE;
        this.MultisampleEnable = FALSE;
        this.AntialiasedLineEnable = FALSE;
    }

    this(D3D11_FILL_MODE fillMode, D3D11_CULL_MODE cullMode, bool frontCounterClockwise, int depthBias, float depthBiasClamp, float slopeScaledDepthBias, bool depthClipEnable, bool scissorEnable, bool multisampleEnable, bool antialiasedLineEnable)
    {
        this.FillMode = fillMode;
        this.CullMode = cullMode;
        this.FrontCounterClockwise = frontCounterClockwise;
        this.DepthBias = depthBias;
        this.DepthBiasClamp = depthBiasClamp;
        this.SlopeScaledDepthBias = slopeScaledDepthBias;
        this.DepthClipEnable = depthClipEnable;
        this.ScissorEnable = scissorEnable;
        this.MultisampleEnable = multisampleEnable;
        this.AntialiasedLineEnable = antialiasedLineEnable;
    }
}

uint D3D11CalcSubresource(uint MipSlice, uint ArraySlice, uint MipLevels)
{
    return MipSlice + ArraySlice * MipLevels;
}

struct D3D11_SUBRESOURCE_DATA
{
    const void* pSysMem;
    uint SysMemPitch;
    uint SysMemSlicePitch;
}

struct D3D11_MAPPED_SUBRESOURCE
{
    void* pData;
    uint RowPitch;
    uint DepthPitch;
}

struct D3D11_BUFFER_DESC
{
    uint ByteWidth;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    uint StructureByteStride;
}

class CD3D11_BUFFER_DESC
{
    uint ByteWidth;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    uint StructureByteStride;
    this(uint byteWidth, uint bindFlags, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, uint cpuaccessFlags = 0, uint miscFlags = 0, uint structureByteStride = 0)
    {
        this.ByteWidth = byteWidth;
        this.Usage = usage;
        this.BindFlags = bindFlags;
        this.CPUAccessFlags = cpuaccessFlags;
        this.MiscFlags = miscFlags;
        this.StructureByteStride = structureByteStride;
    }
}

struct D3D11_TEXTURE1D_DESC
{
    uint Width;
    uint MipLevels;
    uint ArraySize;
    DXGI_FORMAT Format;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
}

class CD3D11_TEXTURE1D_DESC
{
    uint Width;
    uint MipLevels;
    uint ArraySize;
    DXGI_FORMAT Format;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    this(DXGI_FORMAT format, uint width, uint arraySize = 1, uint mipLevels = 0, uint bindFlags = D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, uint cpuaccessFlags = 0, uint miscFlags = 0)
    {
        this.Width = width;
        this.MipLevels = mipLevels;
        this.ArraySize = arraySize;
        this.Format = format;
        this.Usage = usage;
        this.BindFlags = bindFlags;
        this.CPUAccessFlags = cpuaccessFlags;
        this.MiscFlags = miscFlags;
    }
}

struct D3D11_TEXTURE2D_DESC
{
    uint Width;
    uint Height;
    uint MipLevels;
    uint ArraySize;
    DXGI_FORMAT Format;
    DXGI_SAMPLE_DESC SampleDesc;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
}

class CD3D11_TEXTURE2D_DESC
{
    uint Width;
    uint Height;
    uint MipLevels;
    uint ArraySize;
    DXGI_FORMAT Format;
    DXGI_SAMPLE_DESC SampleDesc;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    this(DXGI_FORMAT format, uint width, uint height, uint arraySize = 1, uint mipLevels = 0, uint bindFlags = D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, uint cpuaccessFlags = 0, uint sampleCount = 1, uint sampleQuality = 0, uint miscFlags = 0)
    {
        this.Width = width;
        this.Height = height;
        this.MipLevels = mipLevels;
        this.ArraySize = arraySize;
        this.Format = format;
        this.SampleDesc.Count = sampleCount;
        this.SampleDesc.Quality = sampleQuality;
        this.Usage = usage;
        this.BindFlags = bindFlags;
        this.CPUAccessFlags = cpuaccessFlags;
        this.MiscFlags = miscFlags;
    }
}

struct D3D11_TEXTURE3D_DESC
{
    uint Width;
    uint Height;
    uint Depth;
    uint MipLevels;
    DXGI_FORMAT Format;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
}

class CD3D11_TEXTURE3D_DESC
{
    uint Width;
    uint Height;
    uint Depth;
    uint MipLevels;
    DXGI_FORMAT Format;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    this(DXGI_FORMAT format, uint width, uint height, uint depth, uint mipLevels = 0, uint bindFlags = D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, uint cpuaccessFlags = 0, uint miscFlags = 0)
    {
        this.Width = width;
        this.Height = height;
        this.Depth = depth;
        this.MipLevels = mipLevels;
        this.Format = format;
        this.Usage = usage;
        this.BindFlags = bindFlags;
        this.CPUAccessFlags = cpuaccessFlags;
        this.MiscFlags = miscFlags;
    }
}

alias D3D11_TEXTURECUBE_FACE = uint;
enum : D3D11_TEXTURECUBE_FACE
{
    D3D11_TEXTURECUBE_FACE_POSITIVE_X = 0,
    D3D11_TEXTURECUBE_FACE_NEGATIVE_X = 1,
    D3D11_TEXTURECUBE_FACE_POSITIVE_Y = 2,
    D3D11_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
    D3D11_TEXTURECUBE_FACE_POSITIVE_Z = 4,
    D3D11_TEXTURECUBE_FACE_NEGATIVE_Z = 5
}
struct D3D11_BUFFER_SRV
{
    union
    {
        uint FirstElement;
        uint ElementOffset;
    }

    union
    {
        uint NumElements;
        uint ElementWidth;
    }
}

alias D3D11_BUFFEREX_SRV_FLAG = uint;
enum : D3D11_BUFFEREX_SRV_FLAG
{
    D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1
}
struct D3D11_BUFFEREX_SRV
{
    uint FirstElement;
    uint NumElements;
    uint Flags;
}

struct D3D11_TEX1D_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
}

struct D3D11_TEX1D_ARRAY_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX2D_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
}

struct D3D11_TEX2D_ARRAY_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX3D_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
}

struct D3D11_TEXCUBE_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
}

struct D3D11_TEXCUBE_ARRAY_SRV
{
    uint MostDetailedMip;
    uint MipLevels;
    uint First2DArrayFace;
    uint NumCubes;
}

struct D3D11_TEX2DMS_SRV
{
    uint UnusedField_NothingToDefine;
}

struct D3D11_TEX2DMS_ARRAY_SRV
{
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_SHADER_RESOURCE_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_SRV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_SRV Buffer;
        D3D11_TEX1D_SRV Texture1D;
        D3D11_TEX1D_ARRAY_SRV Texture1DArray;
        D3D11_TEX2D_SRV Texture2D;
        D3D11_TEX2D_ARRAY_SRV Texture2DArray;
        D3D11_TEX2DMS_SRV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
        D3D11_TEX3D_SRV Texture3D;
        D3D11_TEXCUBE_SRV TextureCube;
        D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
        D3D11_BUFFEREX_SRV BufferEx;
    }
}

class CD3D11_SHADER_RESOURCE_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_SRV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_SRV Buffer;
        D3D11_TEX1D_SRV Texture1D;
        D3D11_TEX1D_ARRAY_SRV Texture1DArray;
        D3D11_TEX2D_SRV Texture2D;
        D3D11_TEX2D_ARRAY_SRV Texture2DArray;
        D3D11_TEX2DMS_SRV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
        D3D11_TEX3D_SRV Texture3D;
        D3D11_TEXCUBE_SRV TextureCube;
        D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
        D3D11_BUFFEREX_SRV BufferEx;
    }

    this(D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_BUFFER:
            this.Buffer.FirstElement = mostDetailedMip;
            this.Buffer.NumElements = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1D:
            this.Texture1D.MostDetailedMip = mostDetailedMip;
            this.Texture1D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MostDetailedMip = mostDetailedMip;
            this.Texture1DArray.MipLevels = mipLevels;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2D:
            this.Texture2D.MostDetailedMip = mostDetailedMip;
            this.Texture2D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MostDetailedMip = mostDetailedMip;
            this.Texture2DArray.MipLevels = mipLevels;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE3D:
            this.Texture3D.MostDetailedMip = mostDetailedMip;
            this.Texture3D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBE:
            this.TextureCube.MostDetailedMip = mostDetailedMip;
            this.TextureCube.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
            this.TextureCubeArray.MostDetailedMip = mostDetailedMip;
            this.TextureCubeArray.MipLevels = mipLevels;
            this.TextureCubeArray.First2DArrayFace = firstArraySlice;
            this.TextureCubeArray.NumCubes = arraySize;
            break;
        case D3D11_SRV_DIMENSION_BUFFEREX:
            this.BufferEx.FirstElement = mostDetailedMip;
            this.BufferEx.NumElements = mipLevels;
            this.BufferEx.Flags = flags;
            break;
        default:
            break;
        }
    }

    this(DXGI_FORMAT format, uint firstElement, uint numElements, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
        this.BufferEx.FirstElement = firstElement;
        this.BufferEx.NumElements = numElements;
        this.BufferEx.Flags = flags;
    }

    this(ID3D11Texture1D* pTex1D, D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels || (-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == mipLevels)
                mipLevels = TexDesc.MipLevels - mostDetailedMip;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_TEXTURE1D:
            this.Texture1D.MostDetailedMip = mostDetailedMip;
            this.Texture1D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MostDetailedMip = mostDetailedMip;
            this.Texture1DArray.MipLevels = mipLevels;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == mipLevels && D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension && D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) || (-1 == arraySize && (D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension || D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension || D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == mipLevels)
                mipLevels = TexDesc.MipLevels - mostDetailedMip;
            if (-1 == arraySize)
            {
                arraySize = TexDesc.ArraySize - firstArraySlice;
                if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)
                    arraySize /= 6;
            }
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_TEXTURE2D:
            this.Texture2D.MostDetailedMip = mostDetailedMip;
            this.Texture2D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MostDetailedMip = mostDetailedMip;
            this.Texture2DArray.MipLevels = mipLevels;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBE:
            this.TextureCube.MostDetailedMip = mostDetailedMip;
            this.TextureCube.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
            this.TextureCubeArray.MostDetailedMip = mostDetailedMip;
            this.TextureCubeArray.MipLevels = mipLevels;
            this.TextureCubeArray.First2DArrayFace = firstArraySlice;
            this.TextureCubeArray.NumCubes = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture3D* pTex3D, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1)
    {
        this.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == mipLevels)
                mipLevels = TexDesc.MipLevels - mostDetailedMip;
        }
        this.Format = format;
        this.Texture3D.MostDetailedMip = mostDetailedMip;
        this.Texture3D.MipLevels = mipLevels;
    }
}

struct D3D11_BUFFER_RTV
{
    union
    {
        uint FirstElement;
        uint ElementOffset;
    }

    union
    {
        uint NumElements;
        uint ElementWidth;
    }
}

struct D3D11_TEX1D_RTV
{
    uint MipSlice;
}

struct D3D11_TEX1D_ARRAY_RTV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX2D_RTV
{
    uint MipSlice;
}

struct D3D11_TEX2DMS_RTV
{
    uint UnusedField_NothingToDefine;
}

struct D3D11_TEX2D_ARRAY_RTV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX2DMS_ARRAY_RTV
{
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX3D_RTV
{
    uint MipSlice;
    uint FirstWSlice;
    uint WSize;
}

struct D3D11_RENDER_TARGET_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_RTV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_RTV Buffer;
        D3D11_TEX1D_RTV Texture1D;
        D3D11_TEX1D_ARRAY_RTV Texture1DArray;
        D3D11_TEX2D_RTV Texture2D;
        D3D11_TEX2D_ARRAY_RTV Texture2DArray;
        D3D11_TEX2DMS_RTV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
        D3D11_TEX3D_RTV Texture3D;
    }
}

class CD3D11_RENDER_TARGET_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_RTV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_RTV Buffer;
        D3D11_TEX1D_RTV Texture1D;
        D3D11_TEX1D_ARRAY_RTV Texture1DArray;
        D3D11_TEX2D_RTV Texture2D;
        D3D11_TEX2D_ARRAY_RTV Texture2DArray;
        D3D11_TEX2DMS_RTV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
        D3D11_TEX3D_RTV Texture3D;
    }

    this(D3D11_RTV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_RTV_DIMENSION_BUFFER:
            this.Buffer.FirstElement = mipSlice;
            this.Buffer.NumElements = firstArraySlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE3D:
            this.Texture3D.MipSlice = mipSlice;
            this.Texture3D.FirstWSlice = firstArraySlice;
            this.Texture3D.WSize = arraySize;
            break;
        default:
            break;
        }
    }

    this(DXGI_FORMAT format, uint firstElement, uint numElements)
    {
        this.Format = format;
        this.ViewDimension = D3D11_RTV_DIMENSION_BUFFER;
        this.Buffer.FirstElement = firstElement;
        this.Buffer.NumElements = numElements;
    }

    this(ID3D11Texture1D* pTex1D, D3D11_RTV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_RTV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE1D:
            Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MipSlice = mipSlice;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_RTV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && (D3D11_RTV_DIMENSION_TEXTURE2DARRAY == viewDimension || D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture3D* pTex3D, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstWSlice = 0, uint wSize = -1)
    {
        this.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == wSize)
                wSize = TexDesc.Depth - firstWSlice;
        }
        this.Format = format;
        this.Texture3D.MipSlice = mipSlice;
        this.Texture3D.FirstWSlice = firstWSlice;
        this.Texture3D.WSize = wSize;
    }
}

class CD3D11_VIEWPORT
{
    float TopLeftX;
    float TopLeftY;
    float Width;
    float Height;
    float MinDepth;
    float MaxDepth;
    this(float topLeftX, float topLeftY, float width, float height, float minDepth = D3D11_MIN_DEPTH, float maxDepth = D3D11_MAX_DEPTH)
    {
        this.TopLeftX = topLeftX;
        this.TopLeftY = topLeftY;
        this.Width = width;
        this.Height = height;
        this.MinDepth = minDepth;
        this.MaxDepth = maxDepth;
    }

    this(ID3D11RenderTargetView* pRTView, float topLeftX = 0.0f, float minDepth = D3D11_MIN_DEPTH, float maxDepth = D3D11_MAX_DEPTH)
    {
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView.GetDesc(&RTVDesc);
        uint NumElements = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_BUFFER:
            NumElements = RTVDesc.Buffer.NumElements;
            break;
        default:
            break;
        }
        this.TopLeftX = topLeftX;
        this.TopLeftY = 0.0f;
        this.Width = NumElements - topLeftX;
        this.Height = 1.0f;
        this.MinDepth = minDepth;
        this.MaxDepth = maxDepth;
    }

    this(ID3D11Texture1D* pTex1D, ID3D11RenderTargetView* pRTView, float topLeftX = 0.0f, float minDepth = D3D11_MIN_DEPTH, float maxDepth = D3D11_MAX_DEPTH)
    {
        D3D11_TEXTURE1D_DESC TexDesc;
        pTex1D.GetDesc(&TexDesc);
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView.GetDesc(&RTVDesc);
        uint MipSlice = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE1D:
            MipSlice = RTVDesc.Texture1D.MipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
            MipSlice = RTVDesc.Texture1DArray.MipSlice;
            break;
        default:
            break;
        }
        const uint SubResourceWidth = TexDesc.Width / (uint(1) << MipSlice);
        this.TopLeftX = topLeftX;
        this.TopLeftY = 0.0f;
        this.Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX;
        this.Height = 1.0f;
        this.MinDepth = minDepth;
        this.MaxDepth = maxDepth;
    }

    this(ID3D11Texture2D* pTex2D, ID3D11RenderTargetView* pRTView, float topLeftX = 0.0f, float topLeftY = 0.0f, float minDepth = D3D11_MIN_DEPTH, float maxDepth = D3D11_MAX_DEPTH)
    {
        D3D11_TEXTURE2D_DESC TexDesc;
        pTex2D.GetDesc(&TexDesc);
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView.GetDesc(&RTVDesc);
        uint MipSlice = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE2D:
            MipSlice = RTVDesc.Texture2D.MipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
            MipSlice = RTVDesc.Texture2DArray.MipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMS:
        case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
            break;
        default:
            break;
        }
        const uint SubResourceWidth = TexDesc.Width / (uint(1) << MipSlice);
        const uint SubResourceHeight = TexDesc.Height / (uint(1) << MipSlice);
        this.TopLeftX = topLeftX;
        this.TopLeftY = topLeftY;
        this.Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX;
        this.Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY;
        this.MinDepth = minDepth;
        this.MaxDepth = maxDepth;
    }

    this(ID3D11Texture3D* pTex3D, ID3D11RenderTargetView* pRTView, float topLeftX = 0.0f, float topLeftY = 0.0f, float minDepth = D3D11_MIN_DEPTH, float maxDepth = D3D11_MAX_DEPTH)
    {
        D3D11_TEXTURE3D_DESC TexDesc;
        pTex3D.GetDesc(&TexDesc);
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView.GetDesc(&RTVDesc);
        uint MipSlice = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE3D:
            MipSlice = RTVDesc.Texture3D.MipSlice;
            break;
        default:
            break;
        }
        const uint SubResourceWidth = TexDesc.Width / (uint(1) << MipSlice);
        const uint SubResourceHeight = TexDesc.Height / (uint(1) << MipSlice);
        this.TopLeftX = topLeftX;
        this.TopLeftY = topLeftY;
        this.Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX;
        this.Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY;
        this.MinDepth = minDepth;
        this.MaxDepth = maxDepth;
    }
}

struct D3D11_TEX1D_DSV
{
    uint MipSlice;
}

struct D3D11_TEX1D_ARRAY_DSV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX2D_DSV
{
    uint MipSlice;
}

struct D3D11_TEX2D_ARRAY_DSV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX2DMS_DSV
{
    uint UnusedField_NothingToDefine;
}

struct D3D11_TEX2DMS_ARRAY_DSV
{
    uint FirstArraySlice;
    uint ArraySize;
}

alias D3D11_DSV_FLAG = uint;
enum : D3D11_DSV_FLAG
{
    D3D11_DSV_READ_ONLY_DEPTH = 0x1L,
    D3D11_DSV_READ_ONLY_STENCIL = 0x2L
}
struct D3D11_DEPTH_STENCIL_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_DSV_DIMENSION ViewDimension;
    uint Flags;
    union
    {
        D3D11_TEX1D_DSV Texture1D;
        D3D11_TEX1D_ARRAY_DSV Texture1DArray;
        D3D11_TEX2D_DSV Texture2D;
        D3D11_TEX2D_ARRAY_DSV Texture2DArray;
        D3D11_TEX2DMS_DSV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray;
    }
}

class CD3D11_DEPTH_STENCIL_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_DSV_DIMENSION ViewDimension;
    uint Flags;
    union
    {
        D3D11_TEX1D_DSV Texture1D;
        D3D11_TEX1D_ARRAY_DSV Texture1DArray;
        D3D11_TEX2D_DSV Texture2D;
        D3D11_TEX2D_ARRAY_DSV Texture2DArray;
        D3D11_TEX2DMS_DSV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray;
    }

    this(D3D11_DSV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        this.Flags = flags;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture1D* pTex1D, D3D11_DSV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0)
    {
        this.ViewDimension = viewDimension;
        this.Flags = flags;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_DSV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_DSV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0)
    {
        this.ViewDimension = viewDimension;
        this.Flags = flags;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && (D3D11_DSV_DIMENSION_TEXTURE2DARRAY == viewDimension || D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }
}

alias D3D11_BUFFER_UAV_FLAG = uint;
enum : D3D11_BUFFER_UAV_FLAG
{
    D3D11_BUFFER_UAV_FLAG_RAW = 0x1,
    D3D11_BUFFER_UAV_FLAG_APPEND = 0x2,
    D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4
}
struct D3D11_BUFFER_UAV
{
    uint FirstElement;
    uint NumElements;
    uint Flags;
}

struct D3D11_TEX1D_UAV
{
    uint MipSlice;
}

struct D3D11_TEX1D_ARRAY_UAV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX2D_UAV
{
    uint MipSlice;
}

struct D3D11_TEX2D_ARRAY_UAV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_TEX3D_UAV
{
    uint MipSlice;
    uint FirstWSlice;
    uint WSize;
}

struct D3D11_UNORDERED_ACCESS_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_UAV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_UAV Buffer;
        D3D11_TEX1D_UAV Texture1D;
        D3D11_TEX1D_ARRAY_UAV Texture1DArray;
        D3D11_TEX2D_UAV Texture2D;
        D3D11_TEX2D_ARRAY_UAV Texture2DArray;
        D3D11_TEX3D_UAV Texture3D;
    }
}

class CD3D11_UNORDERED_ACCESS_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D11_UAV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_UAV Buffer;
        D3D11_TEX1D_UAV Texture1D;
        D3D11_TEX1D_ARRAY_UAV Texture1DArray;
        D3D11_TEX2D_UAV Texture2D;
        D3D11_TEX2D_ARRAY_UAV Texture2DArray;
        D3D11_TEX3D_UAV Texture3D;
    }

    this(D3D11_UAV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_UAV_DIMENSION_BUFFER:
            this.Buffer.FirstElement = mipSlice;
            this.Buffer.NumElements = firstArraySlice;
            this.Buffer.Flags = flags;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE3D:
            this.Texture3D.MipSlice = mipSlice;
            this.Texture3D.FirstWSlice = firstArraySlice;
            this.Texture3D.WSize = arraySize;
            break;
        default:
            break;
        }
    }

    this(DXGI_FORMAT format, uint firstElement, uint numElements, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
        this.Buffer.FirstElement = firstElement;
        this.Buffer.NumElements = numElements;
        this.Buffer.Flags = flags;
    }

    this(ID3D11Texture1D* pTex1D, D3D11_UAV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_UAV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_UAV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE2DARRAY == viewDimension))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_UAV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture3D* pTex3D, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstWSlice = 0, uint wSize = -1)
    {
        this.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == wSize)
                wSize = TexDesc.Depth - firstWSlice;
        }
        this.Format = format;
        this.Texture3D.MipSlice = mipSlice;
        this.Texture3D.FirstWSlice = firstWSlice;
        this.Texture3D.WSize = wSize;
    }
}

alias D3D11_FILTER = uint;
enum : D3D11_FILTER
{
    D3D11_FILTER_MIN_MAG_MIP_POINT = 0,
    D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
    D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
    D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
    D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
    D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
    D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
    D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
    D3D11_FILTER_ANISOTROPIC = 0x55,
    D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
    D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
    D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
    D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
    D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
    D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
    D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
    D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
    D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
    D3D11_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100,
    D3D11_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101,
    D3D11_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104,
    D3D11_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105,
    D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110,
    D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111,
    D3D11_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114,
    D3D11_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115,
    D3D11_FILTER_MINIMUM_ANISOTROPIC = 0x155,
    D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180,
    D3D11_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181,
    D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184,
    D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185,
    D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190,
    D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191,
    D3D11_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194,
    D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195,
    D3D11_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5
}
alias D3D11_FILTER_TYPE = uint;
enum : D3D11_FILTER_TYPE
{
    D3D11_FILTER_TYPE_POINT = 0,
    D3D11_FILTER_TYPE_LINEAR = 1
}
alias D3D11_FILTER_REDUCTION_TYPE = uint;
enum : D3D11_FILTER_REDUCTION_TYPE
{
    D3D11_FILTER_REDUCTION_TYPE_STANDARD = 0,
    D3D11_FILTER_REDUCTION_TYPE_COMPARISON = 1,
    D3D11_FILTER_REDUCTION_TYPE_MINIMUM = 2,
    D3D11_FILTER_REDUCTION_TYPE_MAXIMUM = 3
}
enum D3D11_FILTER_REDUCTION_TYPE_MASK = (0x3);
enum D3D11_FILTER_REDUCTION_TYPE_SHIFT = (7);
enum D3D11_FILTER_TYPE_MASK = (0x3);
enum D3D11_MIN_FILTER_SHIFT = (4);
enum D3D11_MAG_FILTER_SHIFT = (2);
enum D3D11_MIP_FILTER_SHIFT = (0);
enum D3D11_COMPARISON_FILTERING_BIT = (0x80);
enum D3D11_ANISOTROPIC_FILTERING_BIT = (0x40);
D3D11_FILTER D3D11_ENCODE_BASIC_FILTER(T0, T1, T2, T3)(T0 minimum, T1 mag, T2 mip, T3 bComparison)
{
    return (cast(D3D11_FILTER)(((bComparison) ? D3D11_COMPARISON_FILTERING_BIT : 0) | (((minimum) & D3D11_FILTER_TYPE_MASK) << D3D11_MIN_FILTER_SHIFT) | (((mag) & D3D11_FILTER_TYPE_MASK) << D3D11_MAG_FILTER_SHIFT) | (((mip) & D3D11_FILTER_TYPE_MASK) << D3D11_MIP_FILTER_SHIFT)));
}

void D3D11_ENCODE_ANISOTROPIC_FILTER(ARG1)(ARG1 reduction)
{
    return (cast(D3D11_FILTER)(D3D11_ANISOTROPIC_FILTERING_BIT | D3D11_ENCODE_BASIC_FILTER(D3D11_FILTER_TYPE_LINEAR, D3D11_FILTER_TYPE_LINEAR, D3D11_FILTER_TYPE_LINEAR, reduction)));
}

D3D11_FILTER D3D11_ENCODE_ANISOTROPIC_FILTER(T)(T bComparison)
{
    return (cast(D3D11_FILTER)(D3D11_ANISOTROPIC_FILTERING_BIT | D3D11_ENCODE_BASIC_FILTER(D3D11_FILTER_TYPE_LINEAR, D3D11_FILTER_TYPE_LINEAR, D3D11_FILTER_TYPE_LINEAR, bComparison)));
}

D3D11_FILTER_TYPE D3D11_DECODE_MAG_FILTER(T)(d3d11Filter)
{
    return (cast(D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MAG_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK));
}

D3D11_FILTER_TYPE D3D11_DECODE_MIN_FILTER(T)(T d3d11Filter)
{
    return (cast(D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MIN_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK));
}

bool D3D11_DECODE_IS_COMPARISON_FILTER(T)(T d3d11Filter)
{
    return cast(bool)((d3d11Filter) & D3D11_COMPARISON_FILTERING_BIT);
}

bool D3D11_DECODE_IS_ANISOTROPIC_FILTER(T)(T d3d11Filter)
{
    return cast(bool)(((d3d11Filter) & D3D11_ANISOTROPIC_FILTERING_BIT) && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIN_FILTER(d3d11Filter)) && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MAG_FILTER(d3d11Filter)) && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIP_FILTER(d3d11Filter)));
}

alias D3D11_TEXTURE_ADDRESS_MODE = uint;
enum : D3D11_TEXTURE_ADDRESS_MODE
{
    D3D11_TEXTURE_ADDRESS_WRAP = 1,
    D3D11_TEXTURE_ADDRESS_MIRROR = 2,
    D3D11_TEXTURE_ADDRESS_CLAMP = 3,
    D3D11_TEXTURE_ADDRESS_BORDER = 4,
    D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5
}
struct D3D11_SAMPLER_DESC
{
    D3D11_FILTER Filter;
    D3D11_TEXTURE_ADDRESS_MODE AddressU;
    D3D11_TEXTURE_ADDRESS_MODE AddressV;
    D3D11_TEXTURE_ADDRESS_MODE AddressW;
    float MipLODBias;
    uint MaxAnisotropy;
    D3D11_COMPARISON_FUNC ComparisonFunc;
    float[4] BorderColor;
    float MinLOD;
    float MaxLOD;
}

class CD3D11_SAMPLER_DESC
{
    D3D11_FILTER Filter;
    D3D11_TEXTURE_ADDRESS_MODE AddressU;
    D3D11_TEXTURE_ADDRESS_MODE AddressV;
    D3D11_TEXTURE_ADDRESS_MODE AddressW;
    float MipLODBias;
    uint MaxAnisotropy;
    D3D11_COMPARISON_FUNC ComparisonFunc;
    float[4] BorderColor;
    float MinLOD;
    float MaxLOD;
    this(CD3D11_DEFAULT)
    {
        this.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
        this.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
        this.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
        this.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
        this.MipLODBias = 0;
        this.MaxAnisotropy = 1;
        this.ComparisonFunc = D3D11_COMPARISON_NEVER;
        this.BorderColor[0] = 1.0f;
        this.BorderColor[1] = 1.0f;
        this.BorderColor[2] = 1.0f;
        this.BorderColor[3] = 1.0f;
        this.MinLOD = -3.402823466e+38F; // -FLT_MAX
        this.MaxLOD = 3.402823466e+38F; // FLT_MAX
    }

    this(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressU, D3D11_TEXTURE_ADDRESS_MODE addressV, D3D11_TEXTURE_ADDRESS_MODE addressW, float mipLODBias, uint maxAnisotropy, D3D11_COMPARISON_FUNC comparisonFunc, float[4] borderColor, float minLOD, float maxLOD)
    {
        this.Filter = filter;
        this.AddressU = addressU;
        this.AddressV = addressV;
        this.AddressW = addressW;
        this.MipLODBias = mipLODBias;
        this.MaxAnisotropy = maxAnisotropy;
        this.ComparisonFunc = comparisonFunc;
        this.BorderColor[0] = borderColor[0];
        this.BorderColor[1] = borderColor[1];
        this.BorderColor[2] = borderColor[2];
        this.BorderColor[3] = borderColor[3];
        this.MinLOD = minLOD;
        this.MaxLOD = maxLOD;
    }
}

alias D3D11_FORMAT_SUPPORT = uint;
enum : D3D11_FORMAT_SUPPORT
{
    D3D11_FORMAT_SUPPORT_BUFFER = 0x1,
    D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2,
    D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4,
    D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x8,
    D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x10,
    D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x20,
    D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x40,
    D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x80,
    D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x100,
    D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200,
    D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400,
    D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800,
    D3D11_FORMAT_SUPPORT_MIP = 0x1000,
    D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000,
    D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000,
    D3D11_FORMAT_SUPPORT_BLENDABLE = 0x8000,
    D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000,
    D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000,
    D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000,
    D3D11_FORMAT_SUPPORT_DISPLAY = 0x80000,
    D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000,
    D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000,
    D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000,
    D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x800000,
    D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000,
    D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000,
    D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x4000000,
    D3D11_FORMAT_SUPPORT_DECODER_OUTPUT = 0x8000000,
    D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT = 0x10000000,
    D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT = 0x20000000,
    D3D11_FORMAT_SUPPORT_VIDEO_ENCODER = 0x40000000
}
alias D3D11_FORMAT_SUPPORT2 = uint;
enum : D3D11_FORMAT_SUPPORT2
{
    D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1,
    D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2,
    D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4,
    D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8,
    D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10,
    D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20,
    D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40,
    D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80,
    D3D11_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100,
    D3D11_FORMAT_SUPPORT2_TILED = 0x200,
    D3D11_FORMAT_SUPPORT2_SHAREABLE = 0x400,
    D3D11_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000
}
alias D3D11_ASYNC_GETDATA_FLAG = uint;
enum : D3D11_ASYNC_GETDATA_FLAG
{
    D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x1
}
alias D3D11_QUERY = uint;
enum : D3D11_QUERY
{
    D3D11_QUERY_EVENT = 0,
    D3D11_QUERY_OCCLUSION = (D3D11_QUERY_EVENT + 1),
    D3D11_QUERY_TIMESTAMP = (D3D11_QUERY_OCCLUSION + 1),
    D3D11_QUERY_TIMESTAMP_DISJOINT = (D3D11_QUERY_TIMESTAMP + 1),
    D3D11_QUERY_PIPELINE_STATISTICS = (D3D11_QUERY_TIMESTAMP_DISJOINT + 1),
    D3D11_QUERY_OCCLUSION_PREDICATE = (D3D11_QUERY_PIPELINE_STATISTICS + 1),
    D3D11_QUERY_SO_STATISTICS = (D3D11_QUERY_OCCLUSION_PREDICATE + 1),
    D3D11_QUERY_SO_OVERFLOW_PREDICATE = (D3D11_QUERY_SO_STATISTICS + 1),
    D3D11_QUERY_SO_STATISTICS_STREAM0 = (D3D11_QUERY_SO_OVERFLOW_PREDICATE + 1),
    D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = (D3D11_QUERY_SO_STATISTICS_STREAM0 + 1),
    D3D11_QUERY_SO_STATISTICS_STREAM1 = (D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + 1),
    D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = (D3D11_QUERY_SO_STATISTICS_STREAM1 + 1),
    D3D11_QUERY_SO_STATISTICS_STREAM2 = (D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + 1),
    D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = (D3D11_QUERY_SO_STATISTICS_STREAM2 + 1),
    D3D11_QUERY_SO_STATISTICS_STREAM3 = (D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + 1),
    D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = (D3D11_QUERY_SO_STATISTICS_STREAM3 + 1)
}
alias D3D11_QUERY_MISC_FLAG = uint;
enum : D3D11_QUERY_MISC_FLAG
{
    D3D11_QUERY_MISC_PREDICATEHINT = 0x1
}
struct D3D11_QUERY_DESC
{
    D3D11_QUERY Query;
    uint MiscFlags;
}

class CD3D11_QUERY_DESC
{
    D3D11_QUERY Query;
    uint MiscFlags;
    this(D3D11_QUERY query, uint miscFlags = 0)
    {
        this.Query = query;
        this.MiscFlags = miscFlags;
    }
}

struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT
{
    ulong Frequency;
    bool Disjoint;
}

struct D3D11_QUERY_DATA_PIPELINE_STATISTICS
{
    ulong IAVertices;
    ulong IAPrimitives;
    ulong VSInvocations;
    ulong GSInvocations;
    ulong GSPrimitives;
    ulong CInvocations;
    ulong CPrimitives;
    ulong PSInvocations;
    ulong HSInvocations;
    ulong DSInvocations;
    ulong CSInvocations;
}

struct D3D11_QUERY_DATA_SO_STATISTICS
{
    ulong NumPrimitivesWritten;
    ulong PrimitivesStorageNeeded;
}

alias D3D11_COUNTER = uint;
enum : D3D11_COUNTER
{
    D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
}
alias D3D11_COUNTER_TYPE = uint;
enum : D3D11_COUNTER_TYPE
{
    D3D11_COUNTER_TYPE_FLOAT32 = 0,
    D3D11_COUNTER_TYPE_UINT16 = (D3D11_COUNTER_TYPE_FLOAT32 + 1),
    D3D11_COUNTER_TYPE_UINT32 = (D3D11_COUNTER_TYPE_UINT16 + 1),
    D3D11_COUNTER_TYPE_UINT64 = (D3D11_COUNTER_TYPE_UINT32 + 1)
}
struct D3D11_COUNTER_DESC
{
    D3D11_COUNTER Counter;
    uint MiscFlags;
}

class CD3D11_COUNTER_DESC
{
    D3D11_COUNTER Counter;
    uint MiscFlags;
    this(D3D11_COUNTER counter, uint miscFlags = 0)
    {
        this.Counter = counter;
        this.MiscFlags = miscFlags;
    }
}

struct D3D11_COUNTER_INFO
{
    D3D11_COUNTER LastDeviceDependentCounter;
    uint NumSimultaneousCounters;
    ubyte NumDetectableParallelUnits;
}

alias D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS = uint;
enum : D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS
{
    D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff,
    D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe
}
alias D3D11_DEVICE_CONTEXT_TYPE = uint;
enum : D3D11_DEVICE_CONTEXT_TYPE
{
    D3D11_DEVICE_CONTEXT_IMMEDIATE = 0,
    D3D11_DEVICE_CONTEXT_DEFERRED = (D3D11_DEVICE_CONTEXT_IMMEDIATE + 1)
}
struct D3D11_CLASS_INSTANCE_DESC
{
    uint InstanceId;
    uint InstanceIndex;
    uint TypeId;
    uint ConstantBuffer;
    uint BaseConstantBufferOffset;
    uint BaseTexture;
    uint BaseSampler;
    bool Created;
}

alias D3D11_FEATURE = uint;
enum : D3D11_FEATURE
{
    D3D11_FEATURE_THREADING = 0,
    D3D11_FEATURE_DOUBLES = (D3D11_FEATURE_THREADING + 1),
    D3D11_FEATURE_FORMAT_SUPPORT = (D3D11_FEATURE_DOUBLES + 1),
    D3D11_FEATURE_FORMAT_SUPPORT2 = (D3D11_FEATURE_FORMAT_SUPPORT + 1),
    D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = (D3D11_FEATURE_FORMAT_SUPPORT2 + 1),
    D3D11_FEATURE_D3D11_OPTIONS = (D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS + 1),
    D3D11_FEATURE_ARCHITECTURE_INFO = (D3D11_FEATURE_D3D11_OPTIONS + 1),
    D3D11_FEATURE_D3D9_OPTIONS = (D3D11_FEATURE_ARCHITECTURE_INFO + 1),
    D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT = (D3D11_FEATURE_D3D9_OPTIONS + 1),
    D3D11_FEATURE_D3D9_SHADOW_SUPPORT = (D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT + 1),
    D3D11_FEATURE_D3D11_OPTIONS1 = (D3D11_FEATURE_D3D9_SHADOW_SUPPORT + 1),
    D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT = (D3D11_FEATURE_D3D11_OPTIONS1 + 1),
    D3D11_FEATURE_MARKER_SUPPORT = (D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT + 1),
    D3D11_FEATURE_D3D9_OPTIONS1 = (D3D11_FEATURE_MARKER_SUPPORT + 1),
    D3D11_FEATURE_D3D11_OPTIONS2 = (D3D11_FEATURE_D3D9_OPTIONS1 + 1),
    D3D11_FEATURE_D3D11_OPTIONS3 = (D3D11_FEATURE_D3D11_OPTIONS2 + 1),
    D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = (D3D11_FEATURE_D3D11_OPTIONS3 + 1),
    D3D11_FEATURE_D3D11_OPTIONS4 = (D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT + 1),
    D3D11_FEATURE_SHADER_CACHE = (D3D11_FEATURE_D3D11_OPTIONS4 + 1),
    D3D11_FEATURE_D3D11_OPTIONS5 = (D3D11_FEATURE_SHADER_CACHE + 1)
}
struct D3D11_FEATURE_DATA_THREADING
{
    bool DriverConcurrentCreates;
    bool DriverCommandLists;
}

struct D3D11_FEATURE_DATA_DOUBLES
{
    bool DoublePrecisionFloatShaderOps;
}

struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
{
    DXGI_FORMAT InFormat;
    uint OutFormatSupport;
}

struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2
{
    DXGI_FORMAT InFormat;
    uint OutFormatSupport2;
}

struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS
{
    bool ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x;
}

struct D3D11_FEATURE_DATA_D3D11_OPTIONS
{
    bool OutputMergerLogicOp;
    bool UAVOnlyRenderingForcedSampleCount;
    bool DiscardAPIsSeenByDriver;
    bool FlagsForUpdateAndCopySeenByDriver;
    bool ClearView;
    bool CopyWithOverlap;
    bool ConstantBufferPartialUpdate;
    bool ConstantBufferOffsetting;
    bool MapNoOverwriteOnDynamicConstantBuffer;
    bool MapNoOverwriteOnDynamicBufferSRV;
    bool MultisampleRTVWithForcedSampleCountOne;
    bool SAD4ShaderInstructions;
    bool ExtendedDoublesShaderInstructions;
    bool ExtendedResourceSharing;
}

struct D3D11_FEATURE_DATA_ARCHITECTURE_INFO
{
    bool TileBasedDeferredRenderer;
}

struct D3D11_FEATURE_DATA_D3D9_OPTIONS
{
    bool FullNonPow2TextureSupport;
}

struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT
{
    bool SupportsDepthAsTextureWithLessEqualComparisonFilter;
}

alias D3D11_SHADER_MIN_PRECISION_SUPPORT = uint;
enum : D3D11_SHADER_MIN_PRECISION_SUPPORT
{
    D3D11_SHADER_MIN_PRECISION_10_BIT = 0x1,
    D3D11_SHADER_MIN_PRECISION_16_BIT = 0x2
}
struct D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT
{
    uint PixelShaderMinPrecision;
    uint AllOtherShaderStagesMinPrecision;
}

alias D3D11_TILED_RESOURCES_TIER = uint;
enum : D3D11_TILED_RESOURCES_TIER
{
    D3D11_TILED_RESOURCES_NOT_SUPPORTED = 0,
    D3D11_TILED_RESOURCES_TIER_1 = 1,
    D3D11_TILED_RESOURCES_TIER_2 = 2,
    D3D11_TILED_RESOURCES_TIER_3 = 3
}
struct D3D11_FEATURE_DATA_D3D11_OPTIONS1
{
    D3D11_TILED_RESOURCES_TIER TiledResourcesTier;
    bool MinMaxFiltering;
    bool ClearViewAlsoSupportsDepthOnlyFormats;
    bool MapOnDefaultBuffers;
}

struct D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT
{
    bool SimpleInstancingSupported;
}

struct D3D11_FEATURE_DATA_MARKER_SUPPORT
{
    bool Profile;
}

struct D3D11_FEATURE_DATA_D3D9_OPTIONS1
{
    bool FullNonPow2TextureSupported;
    bool DepthAsTextureWithLessEqualComparisonFilterSupported;
    bool SimpleInstancingSupported;
    bool TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported;
}

alias D3D11_CONSERVATIVE_RASTERIZATION_TIER = uint;
enum : D3D11_CONSERVATIVE_RASTERIZATION_TIER
{
    D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED = 0,
    D3D11_CONSERVATIVE_RASTERIZATION_TIER_1 = 1,
    D3D11_CONSERVATIVE_RASTERIZATION_TIER_2 = 2,
    D3D11_CONSERVATIVE_RASTERIZATION_TIER_3 = 3
}
struct D3D11_FEATURE_DATA_D3D11_OPTIONS2
{
    bool PSSpecifiedStencilRefSupported;
    bool TypedUAVLoadAdditionalFormats;
    bool ROVsSupported;
    D3D11_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier;
    D3D11_TILED_RESOURCES_TIER TiledResourcesTier;
    bool MapOnDefaultTextures;
    bool StandardSwizzle;
    bool UnifiedMemoryArchitecture;
}

struct D3D11_FEATURE_DATA_D3D11_OPTIONS3
{
    bool VPAndRTArrayIndexFromAnyShaderFeedingRasterizer;
}

struct D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT
{
    uint MaxGPUVirtualAddressBitsPerResource;
    uint MaxGPUVirtualAddressBitsPerProcess;
}

alias D3D11_SHADER_CACHE_SUPPORT_FLAGS = uint;
enum : D3D11_SHADER_CACHE_SUPPORT_FLAGS
{
    D3D11_SHADER_CACHE_SUPPORT_NONE = 0,
    D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x1,
    D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x2
}
struct D3D11_FEATURE_DATA_SHADER_CACHE
{
    uint SupportFlags;
}

alias D3D11_SHARED_RESOURCE_TIER = uint;
enum : D3D11_SHARED_RESOURCE_TIER
{
    D3D11_SHARED_RESOURCE_TIER_0 = 0,
    D3D11_SHARED_RESOURCE_TIER_1 = (D3D11_SHARED_RESOURCE_TIER_0 + 1),
    D3D11_SHARED_RESOURCE_TIER_2 = (D3D11_SHARED_RESOURCE_TIER_1 + 1)
}
struct D3D11_FEATURE_DATA_D3D11_OPTIONS5
{
    D3D11_SHARED_RESOURCE_TIER SharedResourceTier;
}

struct CD3D11_VIDEO_DEFAULT
{
}

alias D3D11_VIDEO_DEFAULT = CD3D11_VIDEO_DEFAULT;
alias APP_DEPRECATED_HRESULT = HRESULT;
mixin(uuid!(D3D11_DECODER_PROFILE_MPEG2_MOCOMP, "e6a9f44b-61b0-4563-9ea4-63d2a3c6fe66"));
interface D3D11_DECODER_PROFILE_MPEG2_MOCOMP
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG2_IDCT, "bf22ad00-03ea-4690-8077-473346209b7e"));
interface D3D11_DECODER_PROFILE_MPEG2_IDCT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG2_VLD, "ee27417f-5e28-4e65-beea-1d26b508adc9"));
interface D3D11_DECODER_PROFILE_MPEG2_VLD
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG1_VLD, "6f3ec719-3735-42cc-8063-65cc3cb36616"));
interface D3D11_DECODER_PROFILE_MPEG1_VLD
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG2and1_VLD, "86695f12-340e-4f04-9fd3-9253dd327460"));
interface D3D11_DECODER_PROFILE_MPEG2and1_VLD
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_MOCOMP_NOFGT, "1b81be64-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_H264_MOCOMP_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_MOCOMP_FGT, "1b81be65-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_H264_MOCOMP_FGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_IDCT_NOFGT, "1b81be66-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_H264_IDCT_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_IDCT_FGT, "1b81be67-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_H264_IDCT_FGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_VLD_NOFGT, "1b81be68-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_H264_VLD_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_VLD_FGT, "1b81be69-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_H264_VLD_FGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_VLD_WITHFMOASO_NOFGT, "d5f04ff9-3418-45d8-9561-32a76aae2ddd"));
interface D3D11_DECODER_PROFILE_H264_VLD_WITHFMOASO_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_VLD_STEREO_PROGRESSIVE_NOFGT, "d79be8da-0cf1-4c81-b82a-69a4e236f43d"));
interface D3D11_DECODER_PROFILE_H264_VLD_STEREO_PROGRESSIVE_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_VLD_STEREO_NOFGT, "f9aaccbb-c2b6-4cfc-8779-5707b1760552"));
interface D3D11_DECODER_PROFILE_H264_VLD_STEREO_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_H264_VLD_MULTIVIEW_NOFGT, "705b9d82-76cf-49d6-b7e6-ac8872db013c"));
interface D3D11_DECODER_PROFILE_H264_VLD_MULTIVIEW_NOFGT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_WMV8_POSTPROC, "1b81be80-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_WMV8_POSTPROC
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_WMV8_MOCOMP, "1b81be81-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_WMV8_MOCOMP
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_WMV9_POSTPROC, "1b81be90-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_WMV9_POSTPROC
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_WMV9_MOCOMP, "1b81be91-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_WMV9_MOCOMP
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_WMV9_IDCT, "1b81be94-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_WMV9_IDCT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VC1_POSTPROC, "1b81beA0-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_VC1_POSTPROC
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VC1_MOCOMP, "1b81beA1-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_VC1_MOCOMP
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VC1_IDCT, "1b81beA2-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_VC1_IDCT
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VC1_VLD, "1b81beA3-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_VC1_VLD
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VC1_D2010, "1b81beA4-a0c7-11d3-b984-00c04f2e73c5"));
interface D3D11_DECODER_PROFILE_VC1_D2010
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_SIMPLE, "efd64d74-c9e8-41d7-a5e9-e9b0e39fa319"));
interface D3D11_DECODER_PROFILE_MPEG4PT2_VLD_SIMPLE
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_NOGMC, "ed418a9f-010d-4eda-9ae3-9a65358d8d2e"));
interface D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_NOGMC
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_GMC, "ab998b5b-4258-44a9-9feb-94e597a6baae"));
interface D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_GMC
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_HEVC_VLD_MAIN, "5b11d51b-2f4c-4452-bcc3-09f2a1160cc0"));
interface D3D11_DECODER_PROFILE_HEVC_VLD_MAIN
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_HEVC_VLD_MAIN10, "107af0e0-ef1a-4d19-aba8-67a163073d13"));
interface D3D11_DECODER_PROFILE_HEVC_VLD_MAIN10
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VP9_VLD_PROFILE0, "463707f8-a1d0-4585-876d-83aa6d60b89e"));
interface D3D11_DECODER_PROFILE_VP9_VLD_PROFILE0
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VP9_VLD_10BIT_PROFILE2, "a4c749ef-6ecf-48aa-8448-50a7a1165ff7"));
interface D3D11_DECODER_PROFILE_VP9_VLD_10BIT_PROFILE2
{
}

mixin(uuid!(D3D11_DECODER_PROFILE_VP8_VLD, "90b899ea-3a62-4705-88b3-8df04b2744e7"));
interface D3D11_DECODER_PROFILE_VP8_VLD
{
}

struct D3D11_VIDEO_DECODER_DESC
{
    GUID Guid;
    uint SampleWidth;
    uint SampleHeight;
    DXGI_FORMAT OutputFormat;
}

struct D3D11_VIDEO_DECODER_CONFIG
{
    GUID guidConfigBitstreamEncryption;
    GUID guidConfigMBcontrolEncryption;
    GUID guidConfigResidDiffEncryption;
    uint ConfigBitstreamRaw;
    uint ConfigMBcontrolRasterOrder;
    uint ConfigResidDiffHost;
    uint ConfigSpatialResid8;
    uint ConfigResid8Subtraction;
    uint ConfigSpatialHost8or9Clipping;
    uint ConfigSpatialResidInterleaved;
    uint ConfigIntraResidUnsigned;
    uint ConfigResidDiffAccelerator;
    uint ConfigHostInverseScan;
    uint ConfigSpecificIDCT;
    uint Config4GroupedCoefs;
    USHORT ConfigMinRenderTargetBuffCount;
    USHORT ConfigDecoderSpecific;
}

alias D3D11_VIDEO_DECODER_BUFFER_TYPE = uint;
enum : D3D11_VIDEO_DECODER_BUFFER_TYPE
{
    D3D11_VIDEO_DECODER_BUFFER_PICTURE_PARAMETERS = 0,
    D3D11_VIDEO_DECODER_BUFFER_MACROBLOCK_CONTROL = 1,
    D3D11_VIDEO_DECODER_BUFFER_RESIDUAL_DIFFERENCE = 2,
    D3D11_VIDEO_DECODER_BUFFER_DEBLOCKING_CONTROL = 3,
    D3D11_VIDEO_DECODER_BUFFER_INVERSE_QUANTIZATION_MATRIX = 4,
    D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL = 5,
    D3D11_VIDEO_DECODER_BUFFER_BITSTREAM = 6,
    D3D11_VIDEO_DECODER_BUFFER_MOTION_VECTOR = 7,
    D3D11_VIDEO_DECODER_BUFFER_FILM_GRAIN = 8
}
struct _D3D11_AES_CTR_IV
{
    ulong IV;
    ulong Count;
}

struct D3D11_ENCRYPTED_BLOCK_INFO
{
    uint NumEncryptedBytesAtBeginning;
    uint NumBytesInSkipPattern;
    uint NumBytesInEncryptPattern;
}

struct D3D11_VIDEO_DECODER_BUFFER_DESC
{
    D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
    uint BufferIndex;
    uint DataOffset;
    uint DataSize;
    uint FirstMBaddress;
    uint NumMBsInBuffer;
    uint Width;
    uint Height;
    uint Stride;
    uint ReservedBits;
    void* pIV;
    uint IVSize;
    bool PartialEncryption;
    D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
}

struct D3D11_VIDEO_DECODER_EXTENSION
{
    uint Function;
    void* pPrivateInputData;
    uint PrivateInputDataSize;
    void* pPrivateOutputData;
    uint PrivateOutputDataSize;
    uint ResourceCount;
    ID3D11Resource** ppResourceList;
}

alias D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT = uint;
enum : D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT
{
    D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT = 0x1,
    D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT = 0x2
}
alias D3D11_VIDEO_PROCESSOR_DEVICE_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_DEVICE_CAPS
{
    D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_LINEAR_SPACE = 0x1,
    D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_xvYCC = 0x2,
    D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_RGB_RANGE_CONVERSION = 0x4,
    D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION = 0x8,
    D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_NOMINAL_RANGE = 0x10
}
alias D3D11_VIDEO_PROCESSOR_FEATURE_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_FEATURE_CAPS
{
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_FILL = 0x1,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_CONSTRICTION = 0x2,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LUMA_KEY = 0x4,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_PALETTE = 0x8,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LEGACY = 0x10,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_STEREO = 0x20,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ROTATION = 0x40,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_STREAM = 0x80,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_PIXEL_ASPECT_RATIO = 0x100,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_MIRROR = 0x200,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_SHADER_USAGE = 0x400,
    D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_METADATA_HDR10 = 0x800
}
alias D3D11_VIDEO_PROCESSOR_FILTER_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_FILTER_CAPS
{
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_BRIGHTNESS = 0x1,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_CONTRAST = 0x2,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_HUE = 0x4,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_SATURATION = 0x8,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_NOISE_REDUCTION = 0x10,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_EDGE_ENHANCEMENT = 0x20,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_ANAMORPHIC_SCALING = 0x40,
    D3D11_VIDEO_PROCESSOR_FILTER_CAPS_STEREO_ADJUSTMENT = 0x80
}
alias D3D11_VIDEO_PROCESSOR_FORMAT_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_FORMAT_CAPS
{
    D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_INTERLACED = 0x1,
    D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_PROCAMP = 0x2,
    D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_LUMA_KEY = 0x4,
    D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_PALETTE_INTERLACED = 0x8
}
alias D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS
{
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DENOISE = 0x1,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DERINGING = 0x2,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_EDGE_ENHANCEMENT = 0x4,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_COLOR_CORRECTION = 0x8,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_FLESH_TONE_MAPPING = 0x10,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_IMAGE_STABILIZATION = 0x20,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_SUPER_RESOLUTION = 0x40,
    D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_ANAMORPHIC_SCALING = 0x80
}
alias D3D11_VIDEO_PROCESSOR_STEREO_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_STEREO_CAPS
{
    D3D11_VIDEO_PROCESSOR_STEREO_CAPS_MONO_OFFSET = 0x1,
    D3D11_VIDEO_PROCESSOR_STEREO_CAPS_ROW_INTERLEAVED = 0x2,
    D3D11_VIDEO_PROCESSOR_STEREO_CAPS_COLUMN_INTERLEAVED = 0x4,
    D3D11_VIDEO_PROCESSOR_STEREO_CAPS_CHECKERBOARD = 0x8,
    D3D11_VIDEO_PROCESSOR_STEREO_CAPS_FLIP_MODE = 0x10
}
struct D3D11_VIDEO_PROCESSOR_CAPS
{
    uint DeviceCaps;
    uint FeatureCaps;
    uint FilterCaps;
    uint InputFormatCaps;
    uint AutoStreamCaps;
    uint StereoCaps;
    uint RateConversionCapsCount;
    uint MaxInputStreams;
    uint MaxStreamStates;
}

alias D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS
{
    D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND = 0x1,
    D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB = 0x2,
    D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE = 0x4,
    D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION = 0x8,
    D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_INVERSE_TELECINE = 0x10,
    D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION = 0x20
}
alias D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS = uint;
enum : D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS
{
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32 = 0x1,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_22 = 0x2,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2224 = 0x4,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2332 = 0x8,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32322 = 0x10,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_55 = 0x20,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_64 = 0x40,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_87 = 0x80,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_222222222223 = 0x100,
    D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_OTHER = 0x80000000
}
struct D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS
{
    uint PastFrames;
    uint FutureFrames;
    uint ProcessorCaps;
    uint ITelecineCaps;
    uint CustomRateCount;
}

alias D3D11_CONTENT_PROTECTION_CAPS = uint;
enum : D3D11_CONTENT_PROTECTION_CAPS
{
    D3D11_CONTENT_PROTECTION_CAPS_SOFTWARE = 0x1,
    D3D11_CONTENT_PROTECTION_CAPS_HARDWARE = 0x2,
    D3D11_CONTENT_PROTECTION_CAPS_PROTECTION_ALWAYS_ON = 0x4,
    D3D11_CONTENT_PROTECTION_CAPS_PARTIAL_DECRYPTION = 0x8,
    D3D11_CONTENT_PROTECTION_CAPS_CONTENT_KEY = 0x10,
    D3D11_CONTENT_PROTECTION_CAPS_FRESHEN_SESSION_KEY = 0x20,
    D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK = 0x40,
    D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK_KEY = 0x80,
    D3D11_CONTENT_PROTECTION_CAPS_SEQUENTIAL_CTR_IV = 0x100,
    D3D11_CONTENT_PROTECTION_CAPS_ENCRYPT_SLICEDATA_ONLY = 0x200,
    D3D11_CONTENT_PROTECTION_CAPS_DECRYPTION_BLT = 0x400,
    D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECT_UNCOMPRESSED = 0x800,
    D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECTED_MEMORY_PAGEABLE = 0x1000,
    D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_TEARDOWN = 0x2000,
    D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_DRM_COMMUNICATION = 0x4000,
    D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_DRM_COMMUNICATION_MULTI_THREADED = 0x8000
}
mixin(uuid!(D3D11_DECODER_BITSTREAM_ENCRYPTION_TYPE_CENC, "b0405235-c13d-44f2-9ae5-dd48e08e5b67"));
interface D3D11_DECODER_BITSTREAM_ENCRYPTION_TYPE_CENC
{
}

mixin(uuid!(D3D11_DECODER_BITSTREAM_ENCRYPTION_TYPE_CBCS, "422d9319-9d21-4bb7-9371-faf5a82c3e04"));
interface D3D11_DECODER_BITSTREAM_ENCRYPTION_TYPE_CBCS
{
}

mixin(uuid!(D3D11_KEY_EXCHANGE_HW_PROTECTION, "b1170d8a-628d-4da3-ad3b-82ddb08b4970"));
interface D3D11_KEY_EXCHANGE_HW_PROTECTION
{
}

struct D3D11_VIDEO_CONTENT_PROTECTION_CAPS
{
    uint Caps;
    uint KeyExchangeTypeCount;
    uint BlockAlignmentSize;
    ULONGLONG ProtectedMemorySize;
}

struct D3D11_VIDEO_PROCESSOR_CUSTOM_RATE
{
    DXGI_RATIONAL CustomRate;
    uint OutputFrames;
    bool InputInterlaced;
    uint InputFramesOrFields;
}

alias D3D11_VIDEO_PROCESSOR_FILTER = uint;
enum : D3D11_VIDEO_PROCESSOR_FILTER
{
    D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS = 0,
    D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST = 1,
    D3D11_VIDEO_PROCESSOR_FILTER_HUE = 2,
    D3D11_VIDEO_PROCESSOR_FILTER_SATURATION = 3,
    D3D11_VIDEO_PROCESSOR_FILTER_NOISE_REDUCTION = 4,
    D3D11_VIDEO_PROCESSOR_FILTER_EDGE_ENHANCEMENT = 5,
    D3D11_VIDEO_PROCESSOR_FILTER_ANAMORPHIC_SCALING = 6,
    D3D11_VIDEO_PROCESSOR_FILTER_STEREO_ADJUSTMENT = 7
}
struct D3D11_VIDEO_PROCESSOR_FILTER_RANGE
{
    int Minimum;
    int Maximum;
    int Default;
    float Multiplier;
}

alias D3D11_VIDEO_FRAME_FORMAT = uint;
enum : D3D11_VIDEO_FRAME_FORMAT
{
    D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE = 0,
    D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1,
    D3D11_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2
}
alias D3D11_VIDEO_USAGE = uint;
enum : D3D11_VIDEO_USAGE
{
    D3D11_VIDEO_USAGE_PLAYBACK_NORMAL = 0,
    D3D11_VIDEO_USAGE_OPTIMAL_SPEED = 1,
    D3D11_VIDEO_USAGE_OPTIMAL_QUALITY = 2
}
struct D3D11_VIDEO_PROCESSOR_CONTENT_DESC
{
    D3D11_VIDEO_FRAME_FORMAT InputFrameFormat;
    DXGI_RATIONAL InputFrameRate;
    uint InputWidth;
    uint InputHeight;
    DXGI_RATIONAL OutputFrameRate;
    uint OutputWidth;
    uint OutputHeight;
    D3D11_VIDEO_USAGE Usage;
}

struct D3D11_VIDEO_COLOR_RGBA
{
    float R;
    float G;
    float B;
    float A;
}

struct D3D11_VIDEO_COLOR_YCbCrA
{
    float Y;
    float Cb;
    float Cr;
    float A;
}

struct D3D11_VIDEO_COLOR
{
    union
    {
        D3D11_VIDEO_COLOR_YCbCrA YCbCr;
        D3D11_VIDEO_COLOR_RGBA RGBA;
    }
}

alias D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE = uint;
enum : D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE
{
    D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_UNDEFINED = 0,
    D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 = 1,
    D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255 = 2
}
struct D3D11_VIDEO_PROCESSOR_COLOR_SPACE
{
    mixin(bitfields!(uint, "Usage", 1, uint, "RGB_Range", 1, uint, "YCbCr_Matrix", 1, uint, "YCbCr_xvYCC", 1, uint, "Nominal_Range", 2, uint, "Reserved", 26));
}

alias D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE = uint;
enum : D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE
{
    D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_OPAQUE = 0,
    D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_BACKGROUND = 1,
    D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_DESTINATION = 2,
    D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_SOURCE_STREAM = 3
}
alias D3D11_VIDEO_PROCESSOR_OUTPUT_RATE = uint;
enum : D3D11_VIDEO_PROCESSOR_OUTPUT_RATE
{
    D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_NORMAL = 0,
    D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_HALF = 1,
    D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_CUSTOM = 2
}
alias D3D11_VIDEO_PROCESSOR_STEREO_FORMAT = uint;
enum : D3D11_VIDEO_PROCESSOR_STEREO_FORMAT
{
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO = 0,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_HORIZONTAL = 1,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_VERTICAL = 2,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_SEPARATE = 3,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO_OFFSET = 4,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_ROW_INTERLEAVED = 5,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_COLUMN_INTERLEAVED = 6,
    D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_CHECKERBOARD = 7
}
alias D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE = uint;
enum : D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE
{
    D3D11_VIDEO_PROCESSOR_STEREO_FLIP_NONE = 0,
    D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME0 = 1,
    D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME1 = 2
}
alias D3D11_VIDEO_PROCESSOR_ROTATION = uint;
enum : D3D11_VIDEO_PROCESSOR_ROTATION
{
    D3D11_VIDEO_PROCESSOR_ROTATION_IDENTITY = 0,
    D3D11_VIDEO_PROCESSOR_ROTATION_90 = 1,
    D3D11_VIDEO_PROCESSOR_ROTATION_180 = 2,
    D3D11_VIDEO_PROCESSOR_ROTATION_270 = 3
}
struct D3D11_VIDEO_PROCESSOR_STREAM
{
    bool Enable;
    uint OutputIndex;
    uint InputFrameOrField;
    uint PastFrames;
    uint FutureFrames;
    ID3D11VideoProcessorInputView** ppPastSurfaces;
    ID3D11VideoProcessorInputView* pInputSurface;
    ID3D11VideoProcessorInputView** ppFutureSurfaces;
    ID3D11VideoProcessorInputView** ppPastSurfacesRight;
    ID3D11VideoProcessorInputView* pInputSurfaceRight;
    ID3D11VideoProcessorInputView** ppFutureSurfacesRight;
}

struct D3D11_OMAC
{
    byte[16] Omac;
}

alias D3D11_AUTHENTICATED_CHANNEL_TYPE = uint;
enum : D3D11_AUTHENTICATED_CHANNEL_TYPE
{
    D3D11_AUTHENTICATED_CHANNEL_D3D11 = 1,
    D3D11_AUTHENTICATED_CHANNEL_DRIVER_SOFTWARE = 2,
    D3D11_AUTHENTICATED_CHANNEL_DRIVER_HARDWARE = 3
}
const IID IID_D3D11_AUTHENTICATED_QUERY_PROTECTION = {0xa84eb584, 0xc495, 0x48aa, [0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x5]};
template uuidof(T : D3D11_AUTHENTICATED_QUERY_PROTECTION)
{
    const IID uuidof = {0xa84eb584, 0xc495, 0x48aa, [0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x5]};
}

interface D3D11_AUTHENTICATED_QUERY_PROTECTION
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE, "bc1b18a5-b1fb-42ab-bd94-b5828b4bf7be"));
interface D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE, "ec1c539d-8cff-4e2a-bcc4-f5692f99f480"));
interface D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION, "2634499e-d018-4d74-ac17-7f724059528d"));
interface D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION
{
}

const IID IID_D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT = {0xdb207b3, 0x9450, 0x46a6, [0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2]};
template uuidof(T : D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT)
{
    const IID uuidof = {0xdb207b3, 0x9450, 0x46a6, [0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2]};
}

interface D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS, "649bbadb-f0f4-4639-a15b-24393fc3abac"));
interface D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS
{
}

const IID IID_D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT = {0x12f0bd6, 0xe662, 0x4474, [0xbe, 0xde, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d]};
template uuidof(T : D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT)
{
    const IID uuidof = {0x12f0bd6, 0xe662, 0x4474, [0xbe, 0xde, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d]};
}

interface D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT, "2c042b5e-8c07-46d5-aabe-8f75cbad4c31"));
interface D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_OUTPUT_ID, "839ddca3-9b4e-41e4-b053-892bd2a11ee7"));
interface D3D11_AUTHENTICATED_QUERY_OUTPUT_ID
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ATTRIBUTES, "6214d9d2-432c-4abb-9fce-216eea269e3b"));
interface D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ATTRIBUTES
{
}

const IID IID_D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID = {0xf83a5958, 0xe986, 0x4bda, [0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x1, 0xb7]};
template uuidof(T : D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID)
{
    const IID uuidof = {0xf83a5958, 0xe986, 0x4bda, [0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x1, 0xb7]};
}

interface D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID_COUNT, "b30f7066-203c-4b07-93fc-ceaafd61241e"));
interface D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID_COUNT
{
}

const IID IID_D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE = {0x6114bdb, 0x3523, 0x470a, [0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0]};
template uuidof(T : D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE)
{
    const IID uuidof = {0x6114bdb, 0x3523, 0x470a, [0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0]};
}

interface D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE
{
}

mixin(uuid!(D3D11_AUTHENTICATED_QUERY_CURRENT_ENCRYPTION_WHEN_ACCESSIBLE, "ec1791c7-dad3-4f15-9ec3-faa93d60d4f0"));
interface D3D11_AUTHENTICATED_QUERY_CURRENT_ENCRYPTION_WHEN_ACCESSIBLE
{
}

const IID IID_D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION = {0x6346cc54, 0x2cfc, 0x4ad4, [0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x0]};
template uuidof(T : D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION)
{
    const IID uuidof = {0x6346cc54, 0x2cfc, 0x4ad4, [0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x0]};
}

interface D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION
{
}

const IID IID_D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE = {0x772d047, 0x1b40, 0x48e8, [0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x1]};
template uuidof(T : D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE)
{
    const IID uuidof = {0x772d047, 0x1b40, 0x48e8, [0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x1]};
}

interface D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE
{
}

mixin(uuid!(D3D11_AUTHENTICATED_CONFIGURE_PROTECTION, "50455658-3f47-4362-bf99-bfdfcde9ed29"));
interface D3D11_AUTHENTICATED_CONFIGURE_PROTECTION
{
}

mixin(uuid!(D3D11_AUTHENTICATED_CONFIGURE_ENCRYPTION_WHEN_ACCESSIBLE, "41fff286-6ae0-4d43-9d55-a46e9efd158a"));
interface D3D11_AUTHENTICATED_CONFIGURE_ENCRYPTION_WHEN_ACCESSIBLE
{
}

struct D3D11_AUTHENTICATED_QUERY_INPUT
{
    GUID QueryType;
    HANDLE hChannel;
    uint SequenceNumber;
}

struct D3D11_AUTHENTICATED_QUERY_OUTPUT
{
    D3D11_OMAC omac;
    GUID QueryType;
    HANDLE hChannel;
    uint SequenceNumber;
    HRESULT ReturnCode;
}

union D3D11_AUTHENTICATED_PROTECTION_FLAGS
{
    struct Flags
    {
        mixin(bitfields!(uint, "ProtectionEnabled", 1, uint, "OverlayOrFullscreenRequired", 1, uint, "Reserved", 30));
    }

    uint Value;
}

struct D3D11_AUTHENTICATED_QUERY_PROTECTION_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    D3D11_AUTHENTICATED_PROTECTION_FLAGS ProtectionFlags;
}

struct D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType;
}

struct D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    HANDLE DeviceHandle;
}

struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_INPUT
{
    D3D11_AUTHENTICATED_QUERY_INPUT Input;
    HANDLE DecoderHandle;
}

struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    HANDLE DecoderHandle;
    HANDLE CryptoSessionHandle;
    HANDLE DeviceHandle;
}

struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    uint RestrictedSharedResourceProcessCount;
}

struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_INPUT
{
    D3D11_AUTHENTICATED_QUERY_INPUT Input;
    uint ProcessIndex;
}

alias D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE = uint;
enum : D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE
{
    D3D11_PROCESSIDTYPE_UNKNOWN = 0,
    D3D11_PROCESSIDTYPE_DWM = 1,
    D3D11_PROCESSIDTYPE_HANDLE = 2
}
struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    uint ProcessIndex;
    D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE ProcessIdentifier;
    HANDLE ProcessHandle;
}

struct D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    uint UnrestrictedProtectedSharedResourceCount;
}

struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_INPUT
{
    D3D11_AUTHENTICATED_QUERY_INPUT Input;
    HANDLE DeviceHandle;
    HANDLE CryptoSessionHandle;
}

struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    HANDLE DeviceHandle;
    HANDLE CryptoSessionHandle;
    uint OutputIDCount;
}

struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_INPUT
{
    D3D11_AUTHENTICATED_QUERY_INPUT Input;
    HANDLE DeviceHandle;
    HANDLE CryptoSessionHandle;
    uint OutputIDIndex;
}

struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    HANDLE DeviceHandle;
    HANDLE CryptoSessionHandle;
    uint OutputIDIndex;
    ulong OutputID;
}

alias D3D11_BUS_TYPE = uint;
enum : D3D11_BUS_TYPE
{
    D3D11_BUS_TYPE_OTHER = 0,
    D3D11_BUS_TYPE_PCI = 0x1,
    D3D11_BUS_TYPE_PCIX = 0x2,
    D3D11_BUS_TYPE_PCIEXPRESS = 0x3,
    D3D11_BUS_TYPE_AGP = 0x4,
    D3D11_BUS_IMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x10000,
    D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x20000,
    D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x30000,
    D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x40000,
    D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x50000,
    D3D11_BUS_IMPL_MODIFIER_NON_STANDARD = 0x80000000
}
struct D3D11_AUTHENTICATED_QUERY_ACESSIBILITY_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    D3D11_BUS_TYPE BusType;
    bool AccessibleInContiguousBlocks;
    bool AccessibleInNonContiguousBlocks;
}

struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_COUNT_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    uint EncryptionGuidCount;
}

struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_INPUT
{
    D3D11_AUTHENTICATED_QUERY_INPUT Input;
    uint EncryptionGuidIndex;
}

struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    uint EncryptionGuidIndex;
    GUID EncryptionGuid;
}

struct D3D11_AUTHENTICATED_QUERY_CURRENT_ACCESSIBILITY_ENCRYPTION_OUTPUT
{
    D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
    GUID EncryptionGuid;
}

struct D3D11_AUTHENTICATED_CONFIGURE_INPUT
{
    D3D11_OMAC omac;
    GUID ConfigureType;
    HANDLE hChannel;
    uint SequenceNumber;
}

struct D3D11_AUTHENTICATED_CONFIGURE_OUTPUT
{
    D3D11_OMAC omac;
    GUID ConfigureType;
    HANDLE hChannel;
    uint SequenceNumber;
    HRESULT ReturnCode;
}

struct D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE_INPUT
{
    D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
    uint StartSequenceQuery;
    uint StartSequenceConfigure;
}

struct D3D11_AUTHENTICATED_CONFIGURE_PROTECTION_INPUT
{
    D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
    D3D11_AUTHENTICATED_PROTECTION_FLAGS Protections;
}

struct D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION_INPUT
{
    D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
    HANDLE DecoderHandle;
    HANDLE CryptoSessionHandle;
    HANDLE DeviceHandle;
}

struct D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE_INPUT
{
    D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
    D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE ProcessType;
    HANDLE ProcessHandle;
    bool AllowAccess;
}

struct D3D11_AUTHENTICATED_CONFIGURE_ACCESSIBLE_ENCRYPTION_INPUT
{
    D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
    GUID EncryptionGuid;
}

mixin(uuid!(D3D11_KEY_EXCHANGE_RSAES_OAEP, "c1949895-d72a-4a1d-8e5d-ed857d171520"));
interface D3D11_KEY_EXCHANGE_RSAES_OAEP
{
}

alias D3D11_VDOV_DIMENSION = uint;
enum : D3D11_VDOV_DIMENSION
{
    D3D11_VDOV_DIMENSION_UNKNOWN = 0,
    D3D11_VDOV_DIMENSION_TEXTURE2D = 1
}
struct D3D11_TEX2D_VDOV
{
    uint ArraySlice;
}

struct D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC
{
    GUID DecodeProfile;
    D3D11_VDOV_DIMENSION ViewDimension;
    union
    {
        D3D11_TEX2D_VDOV Texture2D;
    }
}

alias D3D11_VPIV_DIMENSION = uint;
enum : D3D11_VPIV_DIMENSION
{
    D3D11_VPIV_DIMENSION_UNKNOWN = 0,
    D3D11_VPIV_DIMENSION_TEXTURE2D = 1
}
struct D3D11_TEX2D_VPIV
{
    uint MipSlice;
    uint ArraySlice;
}

struct D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC
{
    uint FourCC;
    D3D11_VPIV_DIMENSION ViewDimension;
    union
    {
        D3D11_TEX2D_VPIV Texture2D;
    }
}

alias D3D11_VPOV_DIMENSION = uint;
enum : D3D11_VPOV_DIMENSION
{
    D3D11_VPOV_DIMENSION_UNKNOWN = 0,
    D3D11_VPOV_DIMENSION_TEXTURE2D = 1,
    D3D11_VPOV_DIMENSION_TEXTURE2DARRAY = 2
}
struct D3D11_TEX2D_VPOV
{
    uint MipSlice;
}

struct D3D11_TEX2D_ARRAY_VPOV
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
}

struct D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC
{
    D3D11_VPOV_DIMENSION ViewDimension;
    union
    {
        D3D11_TEX2D_VPOV Texture2D;
        D3D11_TEX2D_ARRAY_VPOV Texture2DArray;
    }
}

alias D3D11_CREATE_DEVICE_FLAG = uint;
enum : D3D11_CREATE_DEVICE_FLAG
{
    D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1,
    D3D11_CREATE_DEVICE_DEBUG = 0x2,
    D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4,
    D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8,
    D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20,
    D3D11_CREATE_DEVICE_DEBUGGABLE = 0x40,
    D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80,
    D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT = 0x100,
    D3D11_CREATE_DEVICE_VIDEO_SUPPORT = 0x800
}

enum D3D11_SDK_VERSION = (7);

alias PFN_D3D11_CREATE_DEVICE = extern (Windows) nothrow HRESULT function(IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, uint Flags, const(D3D_FEATURE_LEVEL)* pFeatureLevels, uint FeatureLevels, uint SDKVersion, ID3D11Device** ppDevice, D3D_FEATURE_LEVEL* pFeatureLevel, ID3D11DeviceContext** ppImmediateContext);
extern (Windows) nothrow HRESULT D3D11CreateDevice(IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, uint Flags, const(D3D_FEATURE_LEVEL)* pFeatureLevels, uint FeatureLevels, uint SDKVersion, ID3D11Device** ppDevice, D3D_FEATURE_LEVEL* pFeatureLevel, ID3D11DeviceContext** ppImmediateContext);
alias PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN = extern (Windows) nothrow HRESULT function(IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, uint Flags, const(D3D_FEATURE_LEVEL)* pFeatureLevels, uint FeatureLevels, uint SDKVersion, const(DXGI_SWAP_CHAIN_DESC)* pSwapChainDesc, IDXGISwapChain** ppSwapChain, ID3D11Device** ppDevice, D3D_FEATURE_LEVEL* pFeatureLevel, ID3D11DeviceContext** ppImmediateContext);
extern (Windows) nothrow HRESULT D3D11CreateDeviceAndSwapChain(IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, uint Flags, const(D3D_FEATURE_LEVEL)* pFeatureLevels, uint FeatureLevels, uint SDKVersion, const(DXGI_SWAP_CHAIN_DESC)* pSwapChainDesc, IDXGISwapChain** ppSwapChain, ID3D11Device** ppDevice, D3D_FEATURE_LEVEL* pFeatureLevel, ID3D11DeviceContext** ppImmediateContext);

/*-------------------------------------------------------------------------------------
 *
 * Copyright (c) Microsoft Corporation
 *
 *-------------------------------------------------------------------------------------*/
// DirectX 11.1 Main Header translation from d3d11_1.h
// Latest update: Windows 10, version 1809

mixin(uuid!(ID3D11BlendState1, "cc86fabe", "da55", "401d", ["85", "e7", "e3", "c9", "de", "28", "77", "e9"]));
extern (C++) interface ID3D11BlendState1 : ID3D11BlendState
{
    void GetDesc1(D3D11_BLEND_DESC1* pDesc);
}

mixin(uuid!(ID3D11RasterizerState1, "1217d7a6", "5039", "418c", ["b0", "42", "9c", "be", "25", "6a", "fd", "6e"]));
extern (C++) interface ID3D11RasterizerState1 : ID3D11RasterizerState
{
    void GetDesc1(D3D11_RASTERIZER_DESC1* pDesc);
}

mixin(uuid!(ID3DDeviceContextState, "5c1e0d8a", "7c23", "48f9", ["8c", "59", "a9", "29", "58", "ce", "ff", "11"]));
extern (C++) interface ID3DDeviceContextState : ID3D11DeviceChild
{
}

mixin(uuid!(ID3D11DeviceContext1, "bb2c6faa", "b5fb", "4082", ["8e", "6b", "38", "8b", "8c", "fa", "90", "e1"]));
extern (C++) interface ID3D11DeviceContext1 : ID3D11DeviceContext
{
    void CopySubresourceRegion1(ID3D11Resource* pDstResource, uint DstSubresource, uint DstX, uint DstY, uint DstZ, ID3D11Resource* pSrcResource, uint SrcSubresource, const D3D11_BOX* pSrcBox, uint CopyFlags);
    void UpdateSubresource1(ID3D11Resource* pDstResource, uint DstSubresource, const D3D11_BOX* pDstBox, const void* pSrcData, uint SrcRowPitch, uint SrcDepthPitch, uint CopyFlags);
    void DiscardResource(ID3D11Resource* pResource);
    void DiscardView(ID3D11View* pResourceView);
    void VSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers, const uint* pFirstConstant, const uint* pNumConstants);
    void HSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers, const uint* pFirstConstant, const uint* pNumConstants);
    void DSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers, const uint* pFirstConstant, const uint* pNumConstants);
    void GSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers, const uint* pFirstConstant, const uint* pNumConstants);
    void PSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers, const uint* pFirstConstant, const uint* pNumConstants);
    void CSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const ID3D11Buffer** ppConstantBuffers, const uint* pFirstConstant, const uint* pNumConstants);
    void VSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
    void HSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
    void DSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
    void GSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
    void PSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
    void CSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer** ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
    void SwapDeviceContextState(ID3DDeviceContextState* pState, ID3DDeviceContextState** ppPreviousState);
    void ClearView(ID3D11View* pView, const float[4] Color, const D3D11_RECT* pRect, uint NumRects);
    void DiscardView1(ID3D11View* pResourceView, const D3D11_RECT* pRects, uint NumRects);
}

mixin(uuid!(ID3D11VideoContext1, "A7F026DA", "A5F8", "4487", ["A5", "64", "15", "E3", "43", "57", "65", "1E"]));
extern (C++) interface ID3D11VideoContext1 : ID3D11VideoContext
{
    HRESULT SubmitDecoderBuffers1(ID3D11VideoDecoder* pDecoder, uint NumBuffers, const D3D11_VIDEO_DECODER_BUFFER_DESC1* pBufferDesc);
    HRESULT GetDataForNewHardwareKey(ID3D11CryptoSession* pCryptoSession, uint PrivateInputSize, const void* pPrivatInputData, ulong* pPrivateOutputData);
    HRESULT CheckCryptoSessionStatus(ID3D11CryptoSession* pCryptoSession, D3D11_CRYPTO_SESSION_STATUS* pStatus);
    HRESULT DecoderEnableDownsampling(ID3D11VideoDecoder* pDecoder, DXGI_COLOR_SPACE_TYPE InputColorSpace, const D3D11_VIDEO_SAMPLE_DESC* pOutputDesc, uint ReferenceFrameCount);
    HRESULT DecoderUpdateDownsampling(ID3D11VideoDecoder* pDecoder, const D3D11_VIDEO_SAMPLE_DESC* pOutputDesc);
    void VideoProcessorSetOutputColorSpace1(ID3D11VideoProcessor* pVideoProcessor, DXGI_COLOR_SPACE_TYPE ColorSpace);
    void VideoProcessorSetOutputShaderUsage(ID3D11VideoProcessor* pVideoProcessor, bool ShaderUsage);
    void VideoProcessorGetOutputColorSpace1(ID3D11VideoProcessor* pVideoProcessor, DXGI_COLOR_SPACE_TYPE* pColorSpace);
    void VideoProcessorGetOutputShaderUsage(ID3D11VideoProcessor* pVideoProcessor, bool* pShaderUsage);
    void VideoProcessorSetStreamColorSpace1(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, DXGI_COLOR_SPACE_TYPE ColorSpace);
    void VideoProcessorSetStreamMirror(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool Enable, bool FlipHorizontal, bool FlipVertical);
    void VideoProcessorGetStreamColorSpace1(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, DXGI_COLOR_SPACE_TYPE* pColorSpace);
    void VideoProcessorGetStreamMirror(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, bool* pEnable, bool* pFlipHorizontal, bool* pFlipVertical);
    HRESULT VideoProcessorGetBehaviorHints(ID3D11VideoProcessor* pVideoProcessor, uint OutputWidth, uint OutputHeight, DXGI_FORMAT OutputFormat, uint StreamCount, const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT* pStreams, uint* pBehaviorHints);
}

mixin(uuid!(ID3D11VideoDevice1, "29DA1D51", "1321", "4454", ["80", "4B", "F5", "FC", "9F", "86", "1F", "0F"]));
extern (C++) interface ID3D11VideoDevice1 : ID3D11VideoDevice
{
    HRESULT GetCryptoSessionPrivateDataSize(const GUID* pCryptoType, const GUID* pDecoderProfile, const GUID* pKeyExchangeType, uint* pPrivateInputSize, uint* pPrivateOutputSize);
    HRESULT GetVideoDecoderCaps(const GUID* pDecoderProfile, uint SampleWidth, uint SampleHeight, const DXGI_RATIONAL* pFrameRate, uint BitRate, const GUID* pCryptoType, uint* pDecoderCaps);
    HRESULT CheckVideoDecoderDownsampling(const D3D11_VIDEO_DECODER_DESC* pInputDesc, DXGI_COLOR_SPACE_TYPE InputColorSpace, const D3D11_VIDEO_DECODER_CONFIG* pInputConfig, const DXGI_RATIONAL* pFrameRate, const D3D11_VIDEO_SAMPLE_DESC* pOutputDesc, bool* pSupported, bool* pRealTimeHint);
    HRESULT RecommendVideoDecoderDownsampleParameters(const D3D11_VIDEO_DECODER_DESC* pInputDesc, DXGI_COLOR_SPACE_TYPE InputColorSpace, const D3D11_VIDEO_DECODER_CONFIG* pInputConfig, const DXGI_RATIONAL* pFrameRate, D3D11_VIDEO_SAMPLE_DESC* pRecommendedOutputDesc);
}

mixin(uuid!(ID3D11VideoProcessorEnumerator1, "465217F2", "5568", "43CF", ["B5", "B9", "F6", "1D", "54", "53", "1C", "A1"]));
extern (C++) interface ID3D11VideoProcessorEnumerator1 : ID3D11VideoProcessorEnumerator
{
    HRESULT CheckVideoProcessorFormatConversion(DXGI_FORMAT InputFormat, DXGI_COLOR_SPACE_TYPE InputColorSpace, DXGI_FORMAT OutputFormat, DXGI_COLOR_SPACE_TYPE OutputColorSpace, bool* pSupported);
}

mixin(uuid!(ID3D11Device1, "a04bfb29", "08ef", "43d6", ["a4", "9c", "a9", "bd", "bd", "cb", "e6", "86"]));
extern (C++) interface ID3D11Device1 : ID3D11Device
{
    void GetImmediateContext1(ID3D11DeviceContext1** ppImmediateContext);
    HRESULT CreateDeferredContext1(uint ContextFlags, ID3D11DeviceContext1** ppDeferredContext);
    HRESULT CreateBlendState1(const D3D11_BLEND_DESC1* pBlendStateDesc, ID3D11BlendState1** ppBlendState);
    HRESULT CreateRasterizerState1(const D3D11_RASTERIZER_DESC1* pRasterizerDesc, ID3D11RasterizerState1** ppRasterizerState);
    HRESULT CreateDeviceContextState(uint Flags, const D3D_FEATURE_LEVEL* pFeatureLevels, uint FeatureLevels, uint SDKVersion, REFIID EmulatedInterface, D3D_FEATURE_LEVEL* pChosenFeatureLevel, ID3DDeviceContextState** ppContextState);
    HRESULT OpenSharedResource1(HANDLE hResource, REFIID returnedInterface, void** ppResource);
    HRESULT OpenSharedResourceByName(LPCWSTR lpName, DWORD dwDesiredAccess, REFIID returnedInterface, void** ppResource);
}

mixin(uuid!(ID3DUserDefinedAnnotation, "b2daad8b", "03d4", "4dbf", ["95", "eb", "32", "ab", "4b", "63", "d0", "ab"]));
extern (C++) interface ID3DUserDefinedAnnotation : IUnknown
{
    HRESULT QueryInterface(REFIID riid, void** ppvObject);
    ULONG AddRef();
    ULONG Release();
    int BeginEvent(LPCWSTR Name);
    int EndEvent();
    void SetMarker(LPCWSTR Name);
    bool GetStatus();
}

alias D3D11_COPY_FLAGS = uint;
enum : D3D11_COPY_FLAGS
{
    D3D11_COPY_NO_OVERWRITE = 0x1,
    D3D11_COPY_DISCARD = 0x2
}
alias D3D11_LOGIC_OP = uint;
enum : D3D11_LOGIC_OP
{
    D3D11_LOGIC_OP_CLEAR = 0,
    D3D11_LOGIC_OP_SET = (D3D11_LOGIC_OP_CLEAR + 1),
    D3D11_LOGIC_OP_COPY = (D3D11_LOGIC_OP_SET + 1),
    D3D11_LOGIC_OP_COPY_INVERTED = (D3D11_LOGIC_OP_COPY + 1),
    D3D11_LOGIC_OP_NOOP = (D3D11_LOGIC_OP_COPY_INVERTED + 1),
    D3D11_LOGIC_OP_INVERT = (D3D11_LOGIC_OP_NOOP + 1),
    D3D11_LOGIC_OP_AND = (D3D11_LOGIC_OP_INVERT + 1),
    D3D11_LOGIC_OP_NAND = (D3D11_LOGIC_OP_AND + 1),
    D3D11_LOGIC_OP_OR = (D3D11_LOGIC_OP_NAND + 1),
    D3D11_LOGIC_OP_NOR = (D3D11_LOGIC_OP_OR + 1),
    D3D11_LOGIC_OP_XOR = (D3D11_LOGIC_OP_NOR + 1),
    D3D11_LOGIC_OP_EQUIV = (D3D11_LOGIC_OP_XOR + 1),
    D3D11_LOGIC_OP_AND_REVERSE = (D3D11_LOGIC_OP_EQUIV + 1),
    D3D11_LOGIC_OP_AND_INVERTED = (D3D11_LOGIC_OP_AND_REVERSE + 1),
    D3D11_LOGIC_OP_OR_REVERSE = (D3D11_LOGIC_OP_AND_INVERTED + 1),
    D3D11_LOGIC_OP_OR_INVERTED = (D3D11_LOGIC_OP_OR_REVERSE + 1)
}
struct D3D11_RENDER_TARGET_BLEND_DESC1
{
    bool BlendEnable;
    bool LogicOpEnable;
    D3D11_BLEND SrcBlend;
    D3D11_BLEND DestBlend;
    D3D11_BLEND_OP BlendOp;
    D3D11_BLEND SrcBlendAlpha;
    D3D11_BLEND DestBlendAlpha;
    D3D11_BLEND_OP BlendOpAlpha;
    D3D11_LOGIC_OP LogicOp;
    ubyte RenderTargetWriteMask;
}

struct D3D11_BLEND_DESC1
{
    bool AlphaToCoverageEnable;
    bool IndependentBlendEnable;
    D3D11_RENDER_TARGET_BLEND_DESC1[8] RenderTarget;
}

struct CD3D11_BLEND_DESC1
{
    bool AlphaToCoverageEnable;
    bool IndependentBlendEnable;
    D3D11_RENDER_TARGET_BLEND_DESC1[8] RenderTarget;
    this(CD3D11_DEFAULT)
    {
        this.AlphaToCoverageEnable = FALSE;
        this.IndependentBlendEnable = FALSE;
        const D3D11_RENDER_TARGET_BLEND_DESC1 defaultRenderTargetBlendDesc = {FALSE, FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_LOGIC_OP_NOOP, D3D11_COLOR_WRITE_ENABLE_ALL,};
        for (uint i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
        {
            this.RenderTarget[i] = defaultRenderTargetBlendDesc;
        }
    }
}

struct D3D11_RASTERIZER_DESC1
{
    D3D11_FILL_MODE FillMode;
    D3D11_CULL_MODE CullMode;
    bool FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    bool DepthClipEnable;
    bool ScissorEnable;
    bool MultisampleEnable;
    bool AntialiasedLineEnable;
    uint ForcedSampleCount;
}

struct CD3D11_RASTERIZER_DESC1
{
    D3D11_FILL_MODE FillMode;
    D3D11_CULL_MODE CullMode;
    bool FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    bool DepthClipEnable;
    bool ScissorEnable;
    bool MultisampleEnable;
    bool AntialiasedLineEnable;
    uint ForcedSampleCount;
    this(CD3D11_DEFAULT)
    {
        this.FillMode = D3D11_FILL_SOLID;
        this.CullMode = D3D11_CULL_BACK;
        this.FrontCounterClockwise = FALSE;
        this.DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
        this.DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
        this.SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
        this.DepthClipEnable = TRUE;
        this.ScissorEnable = FALSE;
        this.MultisampleEnable = FALSE;
        this.AntialiasedLineEnable = FALSE;
        this.ForcedSampleCount = 0;
    }

    this(D3D11_FILL_MODE fillMode, D3D11_CULL_MODE cullMode, bool frontCounterClockwise, int depthBias, float depthBiasClamp, float slopeScaledDepthBias, bool depthClipEnable, bool scissorEnable, bool multisampleEnable, bool antialiasedLineEnable, uint forcedSampleCount)
    {
        this.FillMode = fillMode;
        this.CullMode = cullMode;
        this.FrontCounterClockwise = frontCounterClockwise;
        this.DepthBias = depthBias;
        this.DepthBiasClamp = depthBiasClamp;
        this.SlopeScaledDepthBias = slopeScaledDepthBias;
        this.DepthClipEnable = depthClipEnable;
        this.ScissorEnable = scissorEnable;
        this.MultisampleEnable = multisampleEnable;
        this.AntialiasedLineEnable = antialiasedLineEnable;
        this.ForcedSampleCount = forcedSampleCount;
    }
}

alias D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG = uint;
enum : D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG
{
    D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED = 0x1
}
struct D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK
{
    uint ClearSize;
    uint EncryptedSize;
}

struct D3D11_VIDEO_DECODER_BUFFER_DESC1
{
    D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
    uint DataOffset;
    uint DataSize;
    void* pIV;
    uint IVSize;
    D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK* pSubSampleMappingBlock;
    uint SubSampleMappingCount;
}

struct D3D11_VIDEO_DECODER_BEGIN_FRAME_CRYPTO_SESSION
{
    ID3D11CryptoSession* pCryptoSession;
    uint BlobSize;
    void* pBlob;
    GUID* pKeyInfoId;
    uint PrivateDataSize;
    void* pPrivateData;
}

alias D3D11_VIDEO_DECODER_CAPS = uint;
enum : D3D11_VIDEO_DECODER_CAPS
{
    D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE = 0x1,
    D3D11_VIDEO_DECODER_CAPS_NON_REAL_TIME = 0x2,
    D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE_DYNAMIC = 0x4,
    D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE_REQUIRED = 0x8,
    D3D11_VIDEO_DECODER_CAPS_UNSUPPORTED = 0x10
}
alias D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINTS = uint;
enum : D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINTS
{
    D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_ROTATION = 0x1,
    D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_RESIZE = 0x2,
    D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_COLOR_SPACE_CONVERSION = 0x4,
    D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_TRIPLE_BUFFER_OUTPUT = 0x8
}
struct D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT
{
    bool Enable;
    uint Width;
    uint Height;
    DXGI_FORMAT Format;
}

alias D3D11_CRYPTO_SESSION_STATUS = uint;
enum : D3D11_CRYPTO_SESSION_STATUS
{
    D3D11_CRYPTO_SESSION_STATUS_OK = 0,
    D3D11_CRYPTO_SESSION_STATUS_KEY_LOST = 1,
    D3D11_CRYPTO_SESSION_STATUS_KEY_AND_CONTENT_LOST = 2
}
struct D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA
{
    uint PrivateDataSize;
    uint HWProtectionDataSize;
    byte[4] pbInput;
}

struct D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA
{
    uint PrivateDataSize;
    uint MaxHWProtectionDataSize;
    uint HWProtectionDataSize;
    ulong TransportTime;
    ulong ExecutionTime;
    byte[4] pbOutput;
}

struct D3D11_KEY_EXCHANGE_HW_PROTECTION_DATA
{
    uint HWProtectionFunctionID;
    D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA* pInputData;
    D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA* pOutputData;
    HRESULT Status;
}

struct D3D11_VIDEO_SAMPLE_DESC
{
    uint Width;
    uint Height;
    DXGI_FORMAT Format;
    DXGI_COLOR_SPACE_TYPE ColorSpace;
}

/*-------------------------------------------------------------------------------------
 *
 * Copyright (c) Microsoft Corporation
 *
 *-------------------------------------------------------------------------------------*/
// DirectX 11.2 Main Header translation from d3d11_2.h
// Latest update: Windows 10, version 1809

mixin(uuid!(ID3D11DeviceContext2, "420d5b32", "b90c", "4da4", ["be", "f0", "35", "9f", "6a", "24", "a8", "3a"]));
extern (C++) interface ID3D11DeviceContext2 : ID3D11DeviceContext1
{
    HRESULT UpdateTileMappings(ID3D11Resource* pTiledResource, uint NumTiledResourceRegions, const D3D11_TILED_RESOURCE_COORDINATE* pTiledResourceRegionStartCoordinates, const D3D11_TILE_REGION_SIZE* pTiledResourceRegionSizes, ID3D11Buffer* pTilePool, uint NumRanges, const uint* pRangeFlags, const uint* pTilePoolStartOffsets, const uint* pRangeTileCounts, uint Flags);
    HRESULT CopyTileMappings(ID3D11Resource* pDestTiledResource, const D3D11_TILED_RESOURCE_COORDINATE* pDestRegionStartCoordinate, ID3D11Resource* pSourceTiledResource, const D3D11_TILED_RESOURCE_COORDINATE* pSourceRegionStartCoordinate, const D3D11_TILE_REGION_SIZE* pTileRegionSize, uint Flags);
    void CopyTiles(ID3D11Resource* pTiledResource, const D3D11_TILED_RESOURCE_COORDINATE* pTileRegionStartCoordinate, const D3D11_TILE_REGION_SIZE* pTileRegionSize, ID3D11Buffer* pBuffer, ulong BufferStartOffsetInBytes, uint Flags);
    void UpdateTiles(ID3D11Resource* pDestTiledResource, const D3D11_TILED_RESOURCE_COORDINATE* pDestTileRegionStartCoordinate, const D3D11_TILE_REGION_SIZE* pDestTileRegionSize, const void* pSourceTileData, uint Flags);
    HRESULT ResizeTilePool(ID3D11Buffer* pTilePool, ulong NewSizeInBytes);
    void TiledResourceBarrier(ID3D11DeviceChild* pTiledResourceOrViewAccessBeforeBarrier, ID3D11DeviceChild* pTiledResourceOrViewAccessAfterBarrier);
    bool IsAnnotationEnabled();
    void SetMarkerInt(LPCWSTR pLabel, int Data);
    void BeginEventInt(LPCWSTR pLabel, int Data);
    void EndEvent();
}

mixin(uuid!(ID3D11Device2, "9d06dffa", "d1e5", "4d07", ["83", "a8", "1b", "b1", "23", "f2", "f8", "41"]));
extern (C++) interface ID3D11Device2 : ID3D11Device1
{
    void GetImmediateContext2(ID3D11DeviceContext2** ppImmediateContext);
    HRESULT CreateDeferredContext2(uint ContextFlags, ID3D11DeviceContext2** ppDeferredContext);
    void GetResourceTiling(ID3D11Resource* pTiledResource, uint* pNumTilesForEntireResource, D3D11_PACKED_MIP_DESC* pPackedMipDesc, D3D11_TILE_SHAPE* pStandardTileShapeForNonPackedMips, uint* pNumSubresourceTilings, uint FirstSubresourceTilingToGet, D3D11_SUBRESOURCE_TILING* pSubresourceTilingsForNonPackedMips);
    HRESULT CheckMultisampleQualityLevels1(DXGI_FORMAT Format, uint SampleCount, uint Flags, uint* pNumQualityLevels);
}

struct D3D11_TILED_RESOURCE_COORDINATE
{
    uint X;
    uint Y;
    uint Z;
    uint Subresource;
}

struct D3D11_TILE_REGION_SIZE
{
    uint NumTiles;
    bool bUseBox;
    uint Width;
    ushort Height;
    ushort Depth;
}

alias D3D11_TILE_MAPPING_FLAG = uint;
enum : D3D11_TILE_MAPPING_FLAG
{
    D3D11_TILE_MAPPING_NO_OVERWRITE = 0x1
}
alias D3D11_TILE_RANGE_FLAG = uint;
enum : D3D11_TILE_RANGE_FLAG
{
    D3D11_TILE_RANGE_NULL = 0x1,
    D3D11_TILE_RANGE_SKIP = 0x2,
    D3D11_TILE_RANGE_REUSE_SINGLE_TILE = 0x4
}
struct D3D11_SUBRESOURCE_TILING
{
    uint WidthInTiles;
    ushort HeightInTiles;
    ushort DepthInTiles;
    uint StartTileIndexInOverallResource;
}

enum D3D11_PACKED_TILE = (0xffffffff);

struct D3D11_TILE_SHAPE
{
    uint WidthInTexels;
    uint HeightInTexels;
    uint DepthInTexels;
}

struct D3D11_PACKED_MIP_DESC
{
    ubyte NumStandardMips;
    ubyte NumPackedMips;
    uint NumTilesForPackedMips;
    uint StartTileIndexInOverallResource;
}

alias D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAG = uint;
enum : D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAG
{
    D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_TILED_RESOURCE = 0x1
}

alias D3D11_TILE_COPY_FLAG = uint;
enum : D3D11_TILE_COPY_FLAG
{
    D3D11_TILE_COPY_NO_OVERWRITE = 0x1,
    D3D11_TILE_COPY_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2,
    D3D11_TILE_COPY_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4
}

/*-------------------------------------------------------------------------------------
 *
 * Copyright (c) Microsoft Corporation
 *
 *-------------------------------------------------------------------------------------*/
// DirectX 11.3 Main Header translation from d3d11_3.h
// Latest update: Windows 10, version 1809

mixin(uuid!(ID3D11Texture2D1, "51218251", "1E33", "4617", ["9C", "CB", "4D", "3A", "43", "67", "E7", "BB"]));
extern (C++) interface ID3D11Texture2D1 : ID3D11Texture2D
{
    void GetDesc1(D3D11_TEXTURE2D_DESC1* pDesc);
}

mixin(uuid!(ID3D11Texture3D1, "0C711683", "2853", "4846", ["9B", "B0", "F3", "E6", "06", "39", "E4", "6A"]));
extern (C++) interface ID3D11Texture3D1 : ID3D11Texture3D
{
    void GetDesc1(D3D11_TEXTURE3D_DESC1* pDesc);
}

mixin(uuid!(ID3D11RasterizerState2, "6fbd02fb", "209f", "46c4", ["b0", "59", "2e", "d1", "55", "86", "a6", "ac"]));
extern (C++) interface ID3D11RasterizerState2 : ID3D11RasterizerState1
{
    void GetDesc2(D3D11_RASTERIZER_DESC2* pDesc);
}

mixin(uuid!(ID3D11ShaderResourceView1, "91308b87", "9040", "411d", ["8c", "67", "c3", "92", "53", "ce", "38", "02"]));
extern (C++) interface ID3D11ShaderResourceView1 : ID3D11ShaderResourceView
{
    void GetDesc1(D3D11_SHADER_RESOURCE_VIEW_DESC1* pDesc1);
}

mixin(uuid!(ID3D11RenderTargetView1, "ffbe2e23", "f011", "418a", ["ac", "56", "5c", "ee", "d7", "c5", "b9", "4b"]));
extern (C++) interface ID3D11RenderTargetView1 : ID3D11RenderTargetView
{
    void GetDesc1(D3D11_RENDER_TARGET_VIEW_DESC1* pDesc1);
}

mixin(uuid!(ID3D11UnorderedAccessView1, "7b3b6153", "a886", "4544", ["ab", "37", "65", "37", "c8", "50", "04", "03"]));
extern (C++) interface ID3D11UnorderedAccessView1 : ID3D11UnorderedAccessView
{
    void GetDesc1(D3D11_UNORDERED_ACCESS_VIEW_DESC1* pDesc1);
}

mixin(uuid!(ID3D11Query1, "631b4766", "36dc", "461d", ["8d", "b6", "c4", "7e", "13", "e6", "09", "16"]));
extern (C++) interface ID3D11Query1 : ID3D11Query
{
    void GetDesc1(D3D11_QUERY_DESC1* pDesc1);
}

mixin(uuid!(ID3D11DeviceContext3, "b4e3c01d", "e79e", "4637", ["91", "b2", "51", "0e", "9f", "4c", "9b", "8f"]));
extern (C++) interface ID3D11DeviceContext3 : ID3D11DeviceContext2
{
    void Flush1(D3D11_CONTEXT_TYPE ContextType, HANDLE hEvent);
    void SetHardwareProtectionState(bool HwProtectionEnable);
    void GetHardwareProtectionState(bool* pHwProtectionEnable);
}

mixin(uuid!(ID3D11Fence, "affde9d1", "1df7", "4bb7", ["8a", "34", "0f", "46", "25", "1d", "ab", "80"]));
extern (C++) interface ID3D11Fence : ID3D11DeviceChild
{
    HRESULT CreateSharedHandle(const SECURITY_ATTRIBUTES* pAttributes, DWORD dwAccess, LPCWSTR lpName, HANDLE* pHandle);
    ulong GetCompletedValue();
    HRESULT SetEventOnCompletion(ulong Value, HANDLE hEvent);
}

mixin(uuid!(ID3D11DeviceContext4, "917600da", "f58c", "4c33", ["98", "d8", "3e", "15", "b3", "90", "fa", "24"]));
extern (C++) interface ID3D11DeviceContext4 : ID3D11DeviceContext3
{
    HRESULT Signal(ID3D11Fence* pFence, ulong Value);
    HRESULT Wait(ID3D11Fence* pFence, ulong Value);
}

mixin(uuid!(ID3D11Device3, "A05C8C37", "D2C6", "4732", ["B3", "A0", "9C", "E0", "B0", "DC", "9A", "E6"]));
extern (C++) interface ID3D11Device3 : ID3D11Device2
{
    HRESULT CreateTexture2D1(const D3D11_TEXTURE2D_DESC1* pDesc1, const D3D11_SUBRESOURCE_DATA* pInitialData, ID3D11Texture2D1** ppTexture2D);
    HRESULT CreateTexture3D1(const D3D11_TEXTURE3D_DESC1* pDesc1, const D3D11_SUBRESOURCE_DATA* pInitialData, ID3D11Texture3D1** ppTexture3D);
    HRESULT CreateRasterizerState2(const D3D11_RASTERIZER_DESC2* pRasterizerDesc, ID3D11RasterizerState2** ppRasterizerState);
    HRESULT CreateShaderResourceView1(ID3D11Resource* pResource, const D3D11_SHADER_RESOURCE_VIEW_DESC1* pDesc1, ID3D11ShaderResourceView1** ppSRView1);
    HRESULT CreateUnorderedAccessView1(ID3D11Resource* pResource, const D3D11_UNORDERED_ACCESS_VIEW_DESC1* pDesc1, ID3D11UnorderedAccessView1** ppUAView1);
    HRESULT CreateRenderTargetView1(ID3D11Resource* pResource, const D3D11_RENDER_TARGET_VIEW_DESC1* pDesc1, ID3D11RenderTargetView1** ppRTView1);
    HRESULT CreateQuery1(const D3D11_QUERY_DESC1* pQueryDesc1, ID3D11Query1** ppQuery1);
    void GetImmediateContext3(ID3D11DeviceContext3** ppImmediateContext);
    HRESULT CreateDeferredContext3(uint ContextFlags, ID3D11DeviceContext3** ppDeferredContext);
    void WriteToSubresource(ID3D11Resource* pDstResource, uint DstSubresource, const D3D11_BOX* pDstBox, const void* pSrcData, uint SrcRowPitch, uint SrcDepthPitch);
    void ReadFromSubresource(void* pDstData, uint DstRowPitch, uint DstDepthPitch, ID3D11Resource* pSrcResource, uint SrcSubresource, const D3D11_BOX* pSrcBox);
}

alias D3D11_CONTEXT_TYPE = uint;
enum : D3D11_CONTEXT_TYPE
{
    D3D11_CONTEXT_TYPE_ALL = 0,
    D3D11_CONTEXT_TYPE_3D = 1,
    D3D11_CONTEXT_TYPE_COMPUTE = 2,
    D3D11_CONTEXT_TYPE_COPY = 3,
    D3D11_CONTEXT_TYPE_VIDEO = 4
}
alias D3D11_TEXTURE_LAYOUT = uint;
enum : D3D11_TEXTURE_LAYOUT
{
    D3D11_TEXTURE_LAYOUT_UNDEFINED = 0,
    D3D11_TEXTURE_LAYOUT_ROW_MAJOR = 1,
    D3D11_TEXTURE_LAYOUT_64K_STANDARD_SWIZZLE = 2
}
struct D3D11_TEXTURE2D_DESC1
{
    uint Width;
    uint Height;
    uint MipLevels;
    uint ArraySize;
    DXGI_FORMAT Format;
    DXGI_SAMPLE_DESC SampleDesc;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    D3D11_TEXTURE_LAYOUT TextureLayout;
}

struct CD3D11_TEXTURE2D_DESC1
{
    uint Width;
    uint Height;
    uint MipLevels;
    uint ArraySize;
    DXGI_FORMAT Format;
    DXGI_SAMPLE_DESC SampleDesc;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    D3D11_TEXTURE_LAYOUT TextureLayout;
    this(DXGI_FORMAT format, uint width, uint height, uint arraySize = 1, uint mipLevels = 0, uint bindFlags = D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, uint cpuaccessFlags = 0, uint sampleCount = 1, uint sampleQuality = 0, uint miscFlags = 0, D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
    {
        this.Width = width;
        this.Height = height;
        this.MipLevels = mipLevels;
        this.ArraySize = arraySize;
        this.Format = format;
        this.SampleDesc.Count = sampleCount;
        this.SampleDesc.Quality = sampleQuality;
        this.Usage = usage;
        this.BindFlags = bindFlags;
        this.CPUAccessFlags = cpuaccessFlags;
        this.MiscFlags = miscFlags;
        this.TextureLayout = textureLayout;
    }

    this(const ref D3D11_TEXTURE2D_DESC desc, D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
    {
        this.Width = desc.Width;
        this.Height = desc.Height;
        this.MipLevels = desc.MipLevels;
        this.ArraySize = desc.ArraySize;
        this.Format = desc.Format;
        this.SampleDesc.Count = desc.SampleDesc.Count;
        this.SampleDesc.Quality = desc.SampleDesc.Quality;
        this.Usage = desc.Usage;
        this.BindFlags = desc.BindFlags;
        this.CPUAccessFlags = desc.CPUAccessFlags;
        this.MiscFlags = desc.MiscFlags;
        this.TextureLayout = textureLayout;
    }
}

struct D3D11_TEXTURE3D_DESC1
{
    uint Width;
    uint Height;
    uint Depth;
    uint MipLevels;
    DXGI_FORMAT Format;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    D3D11_TEXTURE_LAYOUT TextureLayout;
}

struct CD3D11_TEXTURE3D_DESC1
{
    uint Width;
    uint Height;
    uint Depth;
    uint MipLevels;
    DXGI_FORMAT Format;
    D3D11_USAGE Usage;
    uint BindFlags;
    uint CPUAccessFlags;
    uint MiscFlags;
    D3D11_TEXTURE_LAYOUT TextureLayout;
    this(DXGI_FORMAT format, uint width, uint height, uint depth, uint mipLevels = 0, uint bindFlags = D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, uint cpuaccessFlags = 0, uint miscFlags = 0, D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
    {
        this.Width = width;
        this.Height = height;
        this.Depth = depth;
        this.MipLevels = mipLevels;
        this.Format = format;
        this.Usage = usage;
        this.BindFlags = bindFlags;
        this.CPUAccessFlags = cpuaccessFlags;
        this.MiscFlags = miscFlags;
        this.TextureLayout = textureLayout;
    }

    this(const ref D3D11_TEXTURE3D_DESC desc, D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
    {
        this.Width = desc.Width;
        this.Height = desc.Height;
        this.Depth = desc.Depth;
        this.MipLevels = desc.MipLevels;
        this.Format = desc.Format;
        this.Usage = desc.Usage;
        this.BindFlags = desc.BindFlags;
        this.CPUAccessFlags = desc.CPUAccessFlags;
        this.MiscFlags = desc.MiscFlags;
        this.TextureLayout = textureLayout;
    }
}

alias D3D11_CONSERVATIVE_RASTERIZATION_MODE = uint;
enum : D3D11_CONSERVATIVE_RASTERIZATION_MODE
{
    D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0,
    D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON = 1
}
struct D3D11_RASTERIZER_DESC2
{
    D3D11_FILL_MODE FillMode;
    D3D11_CULL_MODE CullMode;
    bool FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    bool DepthClipEnable;
    bool ScissorEnable;
    bool MultisampleEnable;
    bool AntialiasedLineEnable;
    uint ForcedSampleCount;
    D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
}

struct CD3D11_RASTERIZER_DESC2
{
    D3D11_FILL_MODE FillMode;
    D3D11_CULL_MODE CullMode;
    bool FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    bool DepthClipEnable;
    bool ScissorEnable;
    bool MultisampleEnable;
    bool AntialiasedLineEnable;
    uint ForcedSampleCount;
    D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
    this(CD3D11_DEFAULT)
    {
        this.FillMode = D3D11_FILL_SOLID;
        this.CullMode = D3D11_CULL_BACK;
        this.FrontCounterClockwise = FALSE;
        this.DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
        this.DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
        this.SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
        this.DepthClipEnable = TRUE;
        this.ScissorEnable = FALSE;
        this.MultisampleEnable = FALSE;
        this.AntialiasedLineEnable = FALSE;
        this.ForcedSampleCount = 0;
        this.ConservativeRaster = D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF;
    }

    this(D3D11_FILL_MODE fillMode, D3D11_CULL_MODE cullMode, bool frontCounterClockwise, int depthBias, float depthBiasClamp, float slopeScaledDepthBias, bool depthClipEnable, bool scissorEnable, bool multisampleEnable, bool antialiasedLineEnable, uint forcedSampleCount, D3D11_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster)
    {
        this.FillMode = fillMode;
        this.CullMode = cullMode;
        this.FrontCounterClockwise = frontCounterClockwise;
        this.DepthBias = depthBias;
        this.DepthBiasClamp = depthBiasClamp;
        this.SlopeScaledDepthBias = slopeScaledDepthBias;
        this.DepthClipEnable = depthClipEnable;
        this.ScissorEnable = scissorEnable;
        this.MultisampleEnable = multisampleEnable;
        this.AntialiasedLineEnable = antialiasedLineEnable;
        this.ForcedSampleCount = forcedSampleCount;
        this.ConservativeRaster = conservativeRaster;
    }
}

struct D3D11_TEX2D_SRV1
{
    uint MostDetailedMip;
    uint MipLevels;
    uint PlaneSlice;
}

struct D3D11_TEX2D_ARRAY_SRV1
{
    uint MostDetailedMip;
    uint MipLevels;
    uint FirstArraySlice;
    uint ArraySize;
    uint PlaneSlice;
}

struct D3D11_SHADER_RESOURCE_VIEW_DESC1
{
    DXGI_FORMAT Format;
    D3D11_SRV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_SRV Buffer;
        D3D11_TEX1D_SRV Texture1D;
        D3D11_TEX1D_ARRAY_SRV Texture1DArray;
        D3D11_TEX2D_SRV1 Texture2D;
        D3D11_TEX2D_ARRAY_SRV1 Texture2DArray;
        D3D11_TEX2DMS_SRV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
        D3D11_TEX3D_SRV Texture3D;
        D3D11_TEXCUBE_SRV TextureCube;
        D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
        D3D11_BUFFEREX_SRV BufferEx;
    }
}

struct CD3D11_SHADER_RESOURCE_VIEW_DESC1
{
    DXGI_FORMAT Format;
    D3D11_SRV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_SRV Buffer;
        D3D11_TEX1D_SRV Texture1D;
        D3D11_TEX1D_ARRAY_SRV Texture1DArray;
        D3D11_TEX2D_SRV1 Texture2D;
        D3D11_TEX2D_ARRAY_SRV1 Texture2DArray;
        D3D11_TEX2DMS_SRV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
        D3D11_TEX3D_SRV Texture3D;
        D3D11_TEXCUBE_SRV TextureCube;
        D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
        D3D11_BUFFEREX_SRV BufferEx;
    }

    this(D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0, uint planeSlice = 0)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_BUFFER:
            this.Buffer.FirstElement = mostDetailedMip;
            this.Buffer.NumElements = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1D:
            this.Texture1D.MostDetailedMip = mostDetailedMip;
            this.Texture1D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MostDetailedMip = mostDetailedMip;
            this.Texture1DArray.MipLevels = mipLevels;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2D:
            this.Texture2D.MostDetailedMip = mostDetailedMip;
            this.Texture2D.MipLevels = mipLevels;
            this.Texture2D.PlaneSlice = planeSlice;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MostDetailedMip = mostDetailedMip;
            this.Texture2DArray.MipLevels = mipLevels;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            this.Texture2DArray.PlaneSlice = planeSlice;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE3D:
            this.Texture3D.MostDetailedMip = mostDetailedMip;
            this.Texture3D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBE:
            this.TextureCube.MostDetailedMip = mostDetailedMip;
            this.TextureCube.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
            this.TextureCubeArray.MostDetailedMip = mostDetailedMip;
            this.TextureCubeArray.MipLevels = mipLevels;
            this.TextureCubeArray.First2DArrayFace = firstArraySlice;
            this.TextureCubeArray.NumCubes = arraySize;
            break;
        case D3D11_SRV_DIMENSION_BUFFEREX:
            this.BufferEx.FirstElement = mostDetailedMip;
            this.BufferEx.NumElements = mipLevels;
            this.BufferEx.Flags = flags;
            break;
        default:
            break;
        }
    }

    this(DXGI_FORMAT format, uint firstElement, uint numElements, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
        this.BufferEx.FirstElement = firstElement;
        this.BufferEx.NumElements = numElements;
        this.BufferEx.Flags = flags;
    }

    this(ID3D11Texture1D* pTex1D, D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels || (-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == mipLevels)
                mipLevels = TexDesc.MipLevels - mostDetailedMip;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_TEXTURE1D:
            this.Texture1D.MostDetailedMip = mostDetailedMip;
            this.Texture1D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MostDetailedMip = mostDetailedMip;
            this.Texture1DArray.MipLevels = mipLevels;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1, uint firstArraySlice = 0, uint arraySize = -1, uint planeSlice = 0)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == mipLevels && D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension && D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) || (-1 == arraySize && (D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension || D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension || D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == mipLevels)
                mipLevels = TexDesc.MipLevels - mostDetailedMip;
            if (-1 == arraySize)
            {
                arraySize = TexDesc.ArraySize - firstArraySlice;
                if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)
                    arraySize /= 6;
            }
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_TEXTURE2D:
            this.Texture2D.MostDetailedMip = mostDetailedMip;
            this.Texture2D.MipLevels = mipLevels;
            this.Texture2D.PlaneSlice = planeSlice;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MostDetailedMip = mostDetailedMip;
            this.Texture2DArray.MipLevels = mipLevels;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            this.Texture2DArray.PlaneSlice = planeSlice;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBE:
            this.TextureCube.MostDetailedMip = mostDetailedMip;
            this.TextureCube.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
            this.TextureCubeArray.MostDetailedMip = mostDetailedMip;
            this.TextureCubeArray.MipLevels = mipLevels;
            this.TextureCubeArray.First2DArrayFace = firstArraySlice;
            this.TextureCubeArray.NumCubes = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture3D* pTex3D, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mostDetailedMip = 0, uint mipLevels = -1)
    {
        this.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == mipLevels)
                mipLevels = TexDesc.MipLevels - mostDetailedMip;
        }
        this.Format = format;
        this.Texture3D.MostDetailedMip = mostDetailedMip;
        this.Texture3D.MipLevels = mipLevels;
    }
}

struct D3D11_TEX2D_RTV1
{
    uint MipSlice;
    uint PlaneSlice;
}

struct D3D11_TEX2D_ARRAY_RTV1
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
    uint PlaneSlice;
}

struct D3D11_RENDER_TARGET_VIEW_DESC1
{
    DXGI_FORMAT Format;
    D3D11_RTV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_RTV Buffer;
        D3D11_TEX1D_RTV Texture1D;
        D3D11_TEX1D_ARRAY_RTV Texture1DArray;
        D3D11_TEX2D_RTV1 Texture2D;
        D3D11_TEX2D_ARRAY_RTV1 Texture2DArray;
        D3D11_TEX2DMS_RTV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
        D3D11_TEX3D_RTV Texture3D;
    }
}

struct CD3D11_RENDER_TARGET_VIEW_DESC1
{
    DXGI_FORMAT Format;
    D3D11_RTV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_RTV Buffer;
        D3D11_TEX1D_RTV Texture1D;
        D3D11_TEX1D_ARRAY_RTV Texture1DArray;
        D3D11_TEX2D_RTV1 Texture2D;
        D3D11_TEX2D_ARRAY_RTV1 Texture2DArray;
        D3D11_TEX2DMS_RTV Texture2DMS;
        D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
        D3D11_TEX3D_RTV Texture3D;
    }

    this(D3D11_RTV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint planeSlice = 0)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_RTV_DIMENSION_BUFFER:
            this.Buffer.FirstElement = mipSlice;
            this.Buffer.NumElements = firstArraySlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            this.Texture2D.PlaneSlice = planeSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            this.Texture2DArray.PlaneSlice = planeSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE3D:
            this.Texture3D.MipSlice = mipSlice;
            this.Texture3D.FirstWSlice = firstArraySlice;
            this.Texture3D.WSize = arraySize;
            break;
        default:
            break;
        }
    }

    this(DXGI_FORMAT format, uint firstElement, uint numElements)
    {
        this.Format = format;
        this.ViewDimension = D3D11_RTV_DIMENSION_BUFFER;
        this.Buffer.FirstElement = firstElement;
        this.Buffer.NumElements = numElements;
    }

    this(ID3D11Texture1D* pTex1D, D3D11_RTV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_RTV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_RTV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint planeSlice = 0)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && (D3D11_RTV_DIMENSION_TEXTURE2DARRAY == viewDimension || D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            this.Texture2D.PlaneSlice = planeSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            this.Texture2DArray.PlaneSlice = planeSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
            this.Texture2DMSArray.FirstArraySlice = firstArraySlice;
            this.Texture2DMSArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture3D* pTex3D, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstWSlice = 0, uint wSize = -1)
    {
        this.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == wSize)
                wSize = TexDesc.Depth - firstWSlice;
        }
        this.Format = format;
        this.Texture3D.MipSlice = mipSlice;
        this.Texture3D.FirstWSlice = firstWSlice;
        this.Texture3D.WSize = wSize;
    }
}

struct D3D11_TEX2D_UAV1
{
    uint MipSlice;
    uint PlaneSlice;
}

struct D3D11_TEX2D_ARRAY_UAV1
{
    uint MipSlice;
    uint FirstArraySlice;
    uint ArraySize;
    uint PlaneSlice;
}

struct D3D11_UNORDERED_ACCESS_VIEW_DESC1
{
    DXGI_FORMAT Format;
    D3D11_UAV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_UAV Buffer;
        D3D11_TEX1D_UAV Texture1D;
        D3D11_TEX1D_ARRAY_UAV Texture1DArray;
        D3D11_TEX2D_UAV1 Texture2D;
        D3D11_TEX2D_ARRAY_UAV1 Texture2DArray;
        D3D11_TEX3D_UAV Texture3D;
    }
}

struct CD3D11_UNORDERED_ACCESS_VIEW_DESC1
{
    DXGI_FORMAT Format;
    D3D11_UAV_DIMENSION ViewDimension;
    union
    {
        D3D11_BUFFER_UAV Buffer;
        D3D11_TEX1D_UAV Texture1D;
        D3D11_TEX1D_ARRAY_UAV Texture1DArray;
        D3D11_TEX2D_UAV1 Texture2D;
        D3D11_TEX2D_ARRAY_UAV1 Texture2DArray;
        D3D11_TEX3D_UAV Texture3D;
    }

    this(D3D11_UAV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint flags = 0, uint planeSlice = 0)
    {
        this.Format = format;
        this.ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_UAV_DIMENSION_BUFFER:
            this.Buffer.FirstElement = mipSlice;
            this.Buffer.NumElements = firstArraySlice;
            this.Buffer.Flags = flags;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            this.Texture2D.PlaneSlice = planeSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            this.Texture2DArray.PlaneSlice = planeSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE3D:
            this.Texture3D.MipSlice = mipSlice;
            this.Texture3D.FirstWSlice = firstArraySlice;
            this.Texture3D.WSize = arraySize;
            break;
        default:
            break;
        }
    }

    this(DXGI_FORMAT format, uint firstElement, uint numElements, uint flags = 0)
    {
        this.Format = format;
        this.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
        this.Buffer.FirstElement = firstElement;
        this.Buffer.NumElements = numElements;
        this.Buffer.Flags = flags;
    }

    this(ID3D11Texture1D* pTex1D, D3D11_UAV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_UAV_DIMENSION_TEXTURE1D:
            this.Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
            this.Texture1DArray.MipSlice = mipSlice;
            this.Texture1DArray.FirstArraySlice = firstArraySlice;
            this.Texture1DArray.ArraySize = arraySize;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture2D* pTex2D, D3D11_UAV_DIMENSION viewDimension, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstArraySlice = 0, uint arraySize = -1, uint planeSlice = 0)
    {
        this.ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE2DARRAY == viewDimension))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == arraySize)
                arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        this.Format = format;
        switch (viewDimension)
        {
        case D3D11_UAV_DIMENSION_TEXTURE2D:
            this.Texture2D.MipSlice = mipSlice;
            this.Texture2D.PlaneSlice = planeSlice;
            break;
        case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
            this.Texture2DArray.MipSlice = mipSlice;
            this.Texture2DArray.FirstArraySlice = firstArraySlice;
            this.Texture2DArray.ArraySize = arraySize;
            this.Texture2DArray.PlaneSlice = planeSlice;
            break;
        default:
            break;
        }
    }

    this(ID3D11Texture3D* pTex3D, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, uint mipSlice = 0, uint firstWSlice = 0, uint wSize = -1)
    {
        this.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D.GetDesc(&TexDesc);
            if (DXGI_FORMAT_UNKNOWN == format)
                format = TexDesc.Format;
            if (-1 == wSize)
                wSize = TexDesc.Depth - firstWSlice;
        }
        this.Format = format;
        this.Texture3D.MipSlice = mipSlice;
        this.Texture3D.FirstWSlice = firstWSlice;
        this.Texture3D.WSize = wSize;
    }
}

struct D3D11_QUERY_DESC1
{
    D3D11_QUERY Query;
    uint MiscFlags;
    D3D11_CONTEXT_TYPE ContextType;
}

struct CD3D11_QUERY_DESC1
{
    D3D11_QUERY Query;
    uint MiscFlags;
    D3D11_CONTEXT_TYPE ContextType;
    this(D3D11_QUERY query, uint miscFlags = 0, D3D11_CONTEXT_TYPE contextType = D3D11_CONTEXT_TYPE_ALL)
    {
        this.Query = query;
        this.MiscFlags = miscFlags;
        this.ContextType = contextType;
    }
}

alias D3D11_FENCE_FLAG = uint;
enum : D3D11_FENCE_FLAG
{
    D3D11_FENCE_FLAG_NONE = 0,
    D3D11_FENCE_FLAG_SHARED = 0x2,
    D3D11_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x4,
    D3D11_FENCE_FLAG_NON_MONITORED = 0x8
}


/*-------------------------------------------------------------------------------------
 *
 * Copyright (c) Microsoft Corporation
 *
 *-------------------------------------------------------------------------------------*/
// DirectX 11.3 Main Header translation from d3d11_3.h
// Latest update: Windows 10, version 1809

mixin(uuid!(ID3D11Device4, "8992ab71", "02e6", "4b8d", ["ba", "48", "b0", "56", "dc", "da", "42", "c4"]));
extern (C++) interface ID3D11Device4 : ID3D11Device3
{
    HRESULT RegisterDeviceRemovedEvent(HANDLE hEvent, DWORD* pdwCookie);
    void UnregisterDeviceRemoved(DWORD dwCookie);
}

mixin(uuid!(ID3D11Device5, "8ffde202", "a0e7", "45df", ["9e", "01", "e8", "37", "80", "1b", "5e", "a0"]));
extern (C++) interface ID3D11Device5 : ID3D11Device4
{
    HRESULT OpenSharedFence(HANDLE hFence, REFIID ReturnedInterface, void** ppFence);
    HRESULT CreateFence(ulong InitialValue, D3D11_FENCE_FLAG Flags, REFIID ReturnedInterface, void** ppFence);
}

mixin(uuid!(ID3D11Multithread, "9B7E4E00", "342C", "4106", ["A1", "9F", "4F", "27", "04", "F6", "89", "F0"]));
extern (C++) interface ID3D11Multithread : IUnknown
{
    HRESULT QueryInterface(REFIID riid, void** ppvObject);
    ULONG AddRef();
    ULONG Release();
    void Enter();
    void Leave();
    bool SetMultithreadProtected(bool bMTProtect);
    bool GetMultithreadProtected();
}

mixin(uuid!(ID3D11VideoContext2, "9B7E4E00", "342C", "4106", ["A1", "9F", "4F", "27", "04", "F6", "89", "F0"]));
extern (C++) interface ID3D11VideoContext2 : ID3D11VideoContext1
{
    void VideoProcessorSetOutputHDRMetaData(ID3D11VideoProcessor* pVideoProcessor, DXGI_HDR_METADATA_TYPE Type, uint Size, const void* pHDRMetaData);
    void VideoProcessorGetOutputHDRMetaData(ID3D11VideoProcessor* pVideoProcessor, DXGI_HDR_METADATA_TYPE* pType, uint Size, void* pMetaData);
    void VideoProcessorSetStreamHDRMetaData(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, DXGI_HDR_METADATA_TYPE Type, uint Size, const void* pHDRMetaData);
    void VideoProcessorGetStreamHDRMetaData(ID3D11VideoProcessor* pVideoProcessor, uint StreamIndex, DXGI_HDR_METADATA_TYPE* pType, uint Size, void* pMetaData);
}

mixin(uuid!(ID3D11VideoContext3, "A9E2FAA0", "CB39", "418F", ["A0", "B7", "D8", "AA", "D4", "DE", "67", "2E"]));
extern (C++) interface ID3D11VideoContext3 : ID3D11VideoContext2
{
    HRESULT DecoderBeginFrame1(ID3D11VideoDecoder* pDecoder, ID3D11VideoDecoderOutputView* pView, uint ContentKeySize, const void* pContentKey, uint NumComponentHistograms, const uint* pHistogramOffsets, const ID3D11Buffer** ppHistogramBuffers);
    HRESULT SubmitDecoderBuffers2(ID3D11VideoDecoder* pDecoder, uint NumBuffers, const D3D11_VIDEO_DECODER_BUFFER_DESC2* pBufferDesc);
}

alias D3D11_FEATURE_VIDEO = uint;
enum : D3D11_FEATURE_VIDEO
{
    D3D11_FEATURE_VIDEO_DECODER_HISTOGRAM = 0
}
alias D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT = uint;
enum : D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT
{
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_Y = 0,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_U = 1,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_V = 2,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_R = 0,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_G = 1,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_B = 2,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_A = 3
}
alias D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGS = uint;
enum : D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGS
{
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_NONE = 0,
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_Y = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_Y),
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_U = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_U),
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_V = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_V),
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_R = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_R),
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_G = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_G),
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_B = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_B),
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAG_A = (1 << D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_A)
}
struct D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM
{
    D3D11_VIDEO_DECODER_DESC DecoderDesc;
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGS Components;
    uint BinCount;
    uint CounterBitDepth;
}

alias D3D11_CRYPTO_SESSION_KEY_EXCHANGE_FLAGS = uint;
enum : D3D11_CRYPTO_SESSION_KEY_EXCHANGE_FLAGS
{
    D3D11_CRYPTO_SESSION_KEY_EXCHANGE_FLAG_NONE = 0
}

struct D3D11_VIDEO_DECODER_BUFFER_DESC2
{
    D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
    uint DataOffset;
    uint DataSize;
    void* pIV;
    uint IVSize;
    D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK* pSubSampleMappingBlock;
    uint SubSampleMappingCount;
    uint cBlocksStripeEncrypted;
    uint cBlocksStripeClear;
}
