unit DX12.D3D10;

{ **************************************************************************
  Copyright 2016-2017 Norbert Sonnleitner

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   SOFTWARE.
  ************************************************************************** }

{ **************************************************************************
  Additional Copyright (C) for this modul:

  Copyright (c) Microsoft Corporation.  All rights reserved

  This unit consists of the following header files
  File name: D3D10.h
  File name: D3D10Shader.h
  Header version: 10.0.16299.0

  ************************************************************************** }

{$mode delphi}{$H+}

interface

{$Z4}

uses
    Windows, Classes, SysUtils, DX12.DXGI, DX12.D3DCommon;

const
    D3D10_SDK_VERSION = 29;
    DLL_D3D10 = 'd3d10.dll';

const
    IID_ID3D10DeviceChild: TGUID = '{9B7E4C00-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10DepthStencilState: TGUID = '{2B4B1CC8-A4AD-41f8-8322-CA86FC3EC675}';
    IID_ID3D10BlendState: TGUID = '{EDAD8D19-8A35-4d6d-8566-2EA276CDE161}';
    IID_ID3D10RasterizerState: TGUID = '{A2A07292-89AF-4345-BE2E-C53D9FBB6E9F}';
    IID_ID3D10Resource: TGUID = '{9B7E4C01-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Buffer: TGUID = '{9B7E4C02-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Texture1D: TGUID = '{9B7E4C03-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Texture2D: TGUID = '{9B7E4C04-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Texture3D: TGUID = '{9B7E4C05-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10View: TGUID = '{C902B03F-60A7-49BA-9936-2A3AB37A7E33}';
    IID_ID3D10ShaderResourceView: TGUID = '{9B7E4C07-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10RenderTargetView: TGUID = '{9B7E4C08-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10DepthStencilView: TGUID = '{9B7E4C09-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10VertexShader: TGUID = '{9B7E4C0A-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10GeometryShader: TGUID = '{6316BE88-54CD-4040-AB44-20461BC81F68}';
    IID_ID3D10PixelShader: TGUID = '{4968B601-9D00-4cde-8346-8E7F675819B6}';
    IID_ID3D10InputLayout: TGUID = '{9B7E4C0B-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10SamplerState: TGUID = '{9B7E4C0C-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Asynchronous: TGUID = '{9B7E4C0D-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Query: TGUID = '{9B7E4C0E-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Predicate: TGUID = '{9B7E4C10-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Counter: TGUID = '{9B7E4C11-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Device: TGUID = '{9B7E4C0F-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10Multithread: TGUID = '{9B7E4E00-342C-4106-A19F-4F2704F689F0}';
    GUID_DeviceType: TGUID = '{d722fb4d-7a68-437a-b20c-5804ee2494a6}';
    IID_ID3D10ShaderReflection: TGUID = '{D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA}';
    IID_ID3D10ShaderReflectionConstantBuffer: TGUID = '{66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0}';
    IID_ID3D10ShaderReflectionType: TGUID = '{C530AD7D-9B16-4395-A979-BA2ECFF83ADD}';
    IID_ID3D10ShaderReflectionVariable: TGUID = '{1BF63C95-2650-405d-99C1-3636BD1DA0A1}';

    IID_ID3D10StateBlock: TGUID = '{0803425A-57F5-4dd6-9465-A87570834A08}';
    IID_ID3D10EffectType: TGUID = '{4E9E1DDC-CD9D-4772-A837-00180B9B88FD}';
    IID_ID3D10EffectVariable: TGUID = '{AE897105-00E6-45bf-BB8E-281DD6DB8E1B}';


    IID_ID3D10EffectScalarVariable: TGUID = '{00E48F7B-D2C8-49e8-A86C-022DEE53431F}';
    IID_ID3D10EffectVectorVariable: TGUID = '{62B98C44-1F82-4c67-BCD0-72CF8F217E81}';
    IID_ID3D10EffectMatrixVariable: TGUID = '{50666C24-B82F-4eed-A172-5B6E7E8522E0}';
    IID_ID3D10EffectStringVariable: TGUID = '{71417501-8DF9-4e0a-A78A-255F9756BAFF}';
    IID_ID3D10EffectShaderResourceVariable: TGUID = '{C0A7157B-D872-4b1d-8073-EFC2ACD4B1FC}';
    IID_ID3D10EffectRenderTargetViewVariable: TGUID = '{28CA0CC3-C2C9-40bb-B57F-67B737122B17}';
    IID_ID3D10EffectDepthStencilViewVariable: TGUID = '{3E02C918-CC79-4985-B622-2D92AD701623}';
    IID_ID3D10EffectConstantBuffer: TGUID = '{56648F4D-CC8B-4444-A5AD-B5A3D76E91B3}';
    IID_ID3D10EffectShaderVariable: TGUID = '{80849279-C799-4797-8C33-0407A07D9E06}';
    IID_ID3D10EffectBlendVariable: TGUID = '{1FCD2294-DF6D-4eae-86B3-0E9160CFB07B}';
    IID_ID3D10EffectDepthStencilVariable: TGUID = '{AF482368-330A-46a5-9A5C-01C71AF24C8D}';
    IID_ID3D10EffectRasterizerVariable: TGUID = '{21AF9F0E-4D94-4ea9-9785-2CB76B8C0B34}';
    IID_ID3D10EffectSamplerVariable: TGUID = '{6530D5C7-07E9-4271-A418-E7CE4BD1E480}';
    IID_ID3D10EffectPass: TGUID = '{5CFBEB89-1A06-46e0-B282-E3F9BFA36A54}';
    IID_ID3D10EffectTechnique: TGUID = '{DB122CE8-D1C9-4292-B237-24ED3DE8B175}';
    IID_ID3D10Effect: TGUID = '{DB122CE8-D1C9-4292-B237-24ED3DE8B175}';
    IID_ID3D10EffectPool: TGUID = '{9537AB04-3250-412e-8213-FCD2F8677933}';

    IID_ID3D10Debug: TGUID = '{9B7E4E01-342C-4106-A19F-4F2704F689F0}';
    IID_ID3D10SwitchToRef: TGUID = '{9B7E4E02-342C-4106-A19F-4F2704F689F0}';
    DXGI_DEBUG_D3D10: TGUID = '{243b4c52-3606-4d3a-99d7-a7e7b33ed706}';
    IID_ID3D10InfoQueue: TGUID = '{1b940b17-2642-4d1f-ab1f-b99bad0c395f}';

const
    D3D10_16BIT_INDEX_STRIP_CUT_VALUE = $ffff;
    D3D10_32BIT_INDEX_STRIP_CUT_VALUE = $ffffffff;
    D3D10_8BIT_INDEX_STRIP_CUT_VALUE = $ff;
    D3D10_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT = 9;
    D3D10_CLIP_OR_CULL_DISTANCE_COUNT = 8;
    D3D10_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT = 2;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = 14;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS = 4;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT = 32;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT = 15;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT = 15;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1;
    D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1;
    D3D10_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT = 64;
    D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4;
    D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT = 1;
    D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1;
    D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1;
    D3D10_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT = 32;
    D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS = 1;
    D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT = 128;
    D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST = 1;
    D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS = 1;
    D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT = 128;
    D3D10_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS = 1;
    D3D10_COMMONSHADER_SAMPLER_REGISTER_COUNT = 16;
    D3D10_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST = 1;
    D3D10_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS = 1;
    D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT = 16;
    D3D10_COMMONSHADER_SUBROUTINE_NESTING_LIMIT = 32;
    D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENTS = 4;
    D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_COMMONSHADER_TEMP_REGISTER_COUNT = 4096;
    D3D10_COMMONSHADER_TEMP_REGISTER_READS_PER_INST = 3;
    D3D10_COMMONSHADER_TEMP_REGISTER_READ_PORTS = 3;
    D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX = 10;
    D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN = -10;
    D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE = -8;
    D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE = 7;
    D3D10_DEFAULT_BLEND_FACTOR_ALPHA = 1.0;
    D3D10_DEFAULT_BLEND_FACTOR_BLUE = 1.0;
    D3D10_DEFAULT_BLEND_FACTOR_GREEN = 1.0;
    D3D10_DEFAULT_BLEND_FACTOR_RED = 1.0;
    D3D10_DEFAULT_BORDER_COLOR_COMPONENT = 0.0;
    D3D10_DEFAULT_DEPTH_BIAS = 0;
    D3D10_DEFAULT_DEPTH_BIAS_CLAMP = 0.0;
    D3D10_DEFAULT_MAX_ANISOTROPY = 16.0;
    D3D10_DEFAULT_MIP_LOD_BIAS = 0.0;
    D3D10_DEFAULT_RENDER_TARGET_ARRAY_INDEX = 0;
    D3D10_DEFAULT_SAMPLE_MASK = $ffffffff;
    D3D10_DEFAULT_SCISSOR_ENDX = 0;
    D3D10_DEFAULT_SCISSOR_ENDY = 0;
    D3D10_DEFAULT_SCISSOR_STARTX = 0;
    D3D10_DEFAULT_SCISSOR_STARTY = 0;
    D3D10_DEFAULT_SLOPE_SCALED_DEPTH_BIAS = 0.0;
    D3D10_DEFAULT_STENCIL_READ_MASK = $ff;
    D3D10_DEFAULT_STENCIL_REFERENCE = 0;
    D3D10_DEFAULT_STENCIL_WRITE_MASK = $ff;
    D3D10_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX = 0;
    D3D10_DEFAULT_VIEWPORT_HEIGHT = 0;
    D3D10_DEFAULT_VIEWPORT_MAX_DEPTH = 0.0;
    D3D10_DEFAULT_VIEWPORT_MIN_DEPTH = 0.0;
    D3D10_DEFAULT_VIEWPORT_TOPLEFTX = 0;
    D3D10_DEFAULT_VIEWPORT_TOPLEFTY = 0;
    D3D10_DEFAULT_VIEWPORT_WIDTH = 0;
    D3D10_FLOAT16_FUSED_TOLERANCE_IN_ULP = 0.6;
    D3D10_FLOAT32_MAX = 3.402823466e+38;
    D3D10_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP = 0.6;
    D3D10_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR = 2.4;
    D3D10_FLOAT_TO_SRGB_EXPONENT_NUMERATOR = 1.0;
    D3D10_FLOAT_TO_SRGB_OFFSET = 0.055;
    D3D10_FLOAT_TO_SRGB_SCALE_1 = 12.92;
    D3D10_FLOAT_TO_SRGB_SCALE_2 = 1.055;
    D3D10_FLOAT_TO_SRGB_THRESHOLD = 0.0031308;
    D3D10_FTOI_INSTRUCTION_MAX_INPUT = 2147483647.999;
    D3D10_FTOI_INSTRUCTION_MIN_INPUT = -2147483648.999;
    D3D10_FTOU_INSTRUCTION_MAX_INPUT = 4294967295.999;
    D3D10_FTOU_INSTRUCTION_MIN_INPUT = 0.0;
    D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS = 1;
    D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_GS_INPUT_PRIM_CONST_REGISTER_COUNT = 1;
    D3D10_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST = 2;
    D3D10_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS = 1;
    D3D10_GS_INPUT_REGISTER_COMPONENTS = 4;
    D3D10_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_GS_INPUT_REGISTER_COUNT = 16;
    D3D10_GS_INPUT_REGISTER_READS_PER_INST = 2;
    D3D10_GS_INPUT_REGISTER_READ_PORTS = 1;
    D3D10_GS_INPUT_REGISTER_VERTICES = 6;
    D3D10_GS_OUTPUT_ELEMENTS = 32;
    D3D10_GS_OUTPUT_REGISTER_COMPONENTS = 4;
    D3D10_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_GS_OUTPUT_REGISTER_COUNT = 32;
    D3D10_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES = 0;
    D3D10_IA_DEFAULT_PRIMITIVE_TOPOLOGY = 0;
    D3D10_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES = 0;
    D3D10_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT = 1;
    D3D10_IA_INSTANCE_ID_BIT_COUNT = 32;
    D3D10_IA_INTEGER_ARITHMETIC_BIT_COUNT = 32;
    D3D10_IA_PRIMITIVE_ID_BIT_COUNT = 32;
    D3D10_IA_VERTEX_ID_BIT_COUNT = 32;
    D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 16;
    D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS = 64;
    D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = 16;
    D3D10_INTEGER_DIVIDE_BY_ZERO_QUOTIENT = $ffffffff;
    D3D10_INTEGER_DIVIDE_BY_ZERO_REMAINDER = $ffffffff;
    D3D10_LINEAR_GAMMA = 1.0;
    D3D10_MAX_BORDER_COLOR_COMPONENT = 1.0;
    D3D10_MAX_DEPTH = 1.0;
    D3D10_MAX_MAXANISOTROPY = 16;
    D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT = 32;
    D3D10_MAX_POSITION_VALUE = 3.402823466e+34;
    D3D10_MAX_TEXTURE_DIMENSION_2_TO_EXP = 17;
    D3D10_MIN_BORDER_COLOR_COMPONENT = 0.0;
    D3D10_MIN_DEPTH = 0.0;
    D3D10_MIN_MAXANISOTROPY = 0;
    D3D10_MIP_LOD_BIAS_MAX = 15.99;
    D3D10_MIP_LOD_BIAS_MIN = -16.0;
    D3D10_MIP_LOD_FRACTIONAL_BIT_COUNT = 6;
    D3D10_MIP_LOD_RANGE_BIT_COUNT = 8;
    D3D10_MULTISAMPLE_ANTIALIAS_LINE_WIDTH = 1.4;
    D3D10_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT = 0;
    D3D10_PIXEL_ADDRESS_RANGE_BIT_COUNT = 13;
    D3D10_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT = 15;
    D3D10_PS_FRONTFACING_DEFAULT_VALUE = $ffffffff;
    D3D10_PS_FRONTFACING_FALSE_VALUE = 0;
    D3D10_PS_FRONTFACING_TRUE_VALUE = $ffffffff;
    D3D10_PS_INPUT_REGISTER_COMPONENTS = 4;
    D3D10_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_PS_INPUT_REGISTER_COUNT = 32;
    D3D10_PS_INPUT_REGISTER_READS_PER_INST = 2;
    D3D10_PS_INPUT_REGISTER_READ_PORTS = 1;
    D3D10_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT = 0.0;
    D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS = 1;
    D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_PS_OUTPUT_DEPTH_REGISTER_COUNT = 1;
    D3D10_PS_OUTPUT_REGISTER_COMPONENTS = 4;
    D3D10_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_PS_OUTPUT_REGISTER_COUNT = 8;
    D3D10_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT = 0.5;
    D3D10_REQ_BLEND_OBJECT_COUNT_PER_CONTEXT = 4096;
    D3D10_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP = 27;
    D3D10_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = 4096;
    D3D10_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_CONTEXT = 4096;
    D3D10_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 32;
    D3D10_REQ_DRAW_VERTEX_COUNT_2_TO_EXP = 32;
    D3D10_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION = 8192;
    D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT = 1024;
    D3D10_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT = 4096;
    D3D10_REQ_MAXANISOTROPY = 16;
    D3D10_REQ_MIP_LEVELS = 14;
    D3D10_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES = 2048;
    D3D10_REQ_RASTERIZER_OBJECT_COUNT_PER_CONTEXT = 4096;
    D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH = 8192;
    D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES = 128;
    D3D10_REQ_RESOURCE_VIEW_COUNT_PER_CONTEXT_2_TO_EXP = 20;
    D3D10_REQ_SAMPLER_OBJECT_COUNT_PER_CONTEXT = 4096;
    D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION = 512;
    D3D10_REQ_TEXTURE1D_U_DIMENSION = 8192;
    D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION = 512;
    D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION = 8192;
    D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = 2048;
    D3D10_REQ_TEXTURECUBE_DIMENSION = 8192;
    D3D10_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL = 0;
    D3D10_SHADER_MAJOR_VERSION = 4;
    D3D10_SHADER_MINOR_VERSION = 0;
    D3D10_SHIFT_INSTRUCTION_PAD_VALUE = 0;
    D3D10_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT = 5;
    D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT = 8;
    D3D10_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048;
    D3D10_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = 256;
    D3D10_SO_BUFFER_SLOT_COUNT = 4;
    D3D10_SO_DDI_REGISTER_INDEX_DENOTING_GAP = $ffffffff;
    D3D10_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER = 1;
    D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT = 64;
    D3D10_SRGB_GAMMA = 2.2;
    D3D10_SRGB_TO_FLOAT_DENOMINATOR_1 = 12.92;
    D3D10_SRGB_TO_FLOAT_DENOMINATOR_2 = 1.055;
    D3D10_SRGB_TO_FLOAT_EXPONENT = 2.4;
    D3D10_SRGB_TO_FLOAT_OFFSET = 0.055;
    D3D10_SRGB_TO_FLOAT_THRESHOLD = 0.04045;
    D3D10_SRGB_TO_FLOAT_TOLERANCE_IN_ULP = 0.5;
    D3D10_STANDARD_COMPONENT_BIT_COUNT = 32;
    D3D10_STANDARD_COMPONENT_BIT_COUNT_DOUBLED = 64;
    D3D10_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE = 4;
    D3D10_STANDARD_PIXEL_COMPONENT_COUNT = 128;
    D3D10_STANDARD_PIXEL_ELEMENT_COUNT = 32;
    D3D10_STANDARD_VECTOR_SIZE = 4;
    D3D10_STANDARD_VERTEX_ELEMENT_COUNT = 16;
    D3D10_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT = 64;
    D3D10_SUBPIXEL_FRACTIONAL_BIT_COUNT = 8;
    D3D10_SUBTEXEL_FRACTIONAL_BIT_COUNT = 6;
    D3D10_TEXEL_ADDRESS_RANGE_BIT_COUNT = 18;
    D3D10_UNBOUND_MEMORY_ACCESS_RESULT = 0;
    D3D10_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = 15;
    D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16;
    D3D10_VIEWPORT_BOUNDS_MAX = 16383;
    D3D10_VIEWPORT_BOUNDS_MIN = -16384;
    D3D10_VS_INPUT_REGISTER_COMPONENTS = 4;
    D3D10_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_VS_INPUT_REGISTER_COUNT = 16;
    D3D10_VS_INPUT_REGISTER_READS_PER_INST = 2;
    D3D10_VS_INPUT_REGISTER_READ_PORTS = 1;
    D3D10_VS_OUTPUT_REGISTER_COMPONENTS = 4;
    D3D10_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32;
    D3D10_VS_OUTPUT_REGISTER_COUNT = 16;
    D3D10_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT = 10;
    D3D10_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 25;
    D3D10_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP = 25;
    D3D_MAJOR_VERSION = 10;
    D3D_MINOR_VERSION = 0;
    D3D_SPEC_DATE_DAY = 8;
    D3D_SPEC_DATE_MONTH = 8;
    D3D_SPEC_DATE_YEAR = 2006;
    D3D_SPEC_VERSION = 1.050005;

const
    D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT;
    D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT;

    _FACD3D10 = $879;
    _FACD3D10DEBUG = _FACD3D10 + 1;

    MAKE_D3D10_HRESULT = longword(_FACD3D10 shl 16) or longword(1 shl 31);
    MAKE_D3D10_STATUS = longword(_FACD3D10 shl 16);
    (* Direct3D errors are now found in winerror.h *)

    D3D10_APPEND_ALIGNED_ELEMENT = $ffffffff;

const
    D3D10_FILTER_TYPE_MASK = $3;
    D3D10_MIN_FILTER_SHIFT = 4;
    D3D10_MAG_FILTER_SHIFT = 2;
    D3D10_MIP_FILTER_SHIFT = 0;
    D3D10_COMPARISON_FILTERING_BIT = $80;
    D3D10_ANISOTROPIC_FILTERING_BIT = $40;
    D3D10_TEXT_1BIT_BIT = $80000000;

const
    D3D10_EFFECT_COMPILE_CHILD_EFFECT = (1 shl 0);
    D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS = (1 shl 1);
    D3D10_EFFECT_SINGLE_THREADED = (1 shl 3);


    D3D10_EFFECT_VARIABLE_POOLED = (1 shl 0);
    D3D10_EFFECT_VARIABLE_ANNOTATION = (1 shl 1);
    D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT = (1 shl 2);


const

    D3D10_SDK_LAYERS_VERSION = (11);

    D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP = ($1);

    D3D10_DEBUG_FEATURE_FINISH_PER_RENDER_OP = ($2);

    D3D10_DEBUG_FEATURE_PRESENT_PER_RENDER_OP = ($4);

    D3D10_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT = 1024;

    D3D10_REGKEY_PATH = 'Software\\Microsoft\\Direct3D';
    D3D10_MUTE_DEBUG_OUTPUT = 'MuteDebugOutput';
    D3D10_ENABLE_BREAK_ON_MESSAGE = 'EnableBreakOnMessage';
    D3D10_INFOQUEUE_STORAGE_FILTER_OVERRIDE = 'InfoQueueStorageFilterOverride';
    D3D10_MUTE_CATEGORY = 'Mute_CATEGORY_%s';
    D3D10_MUTE_SEVERITY = 'Mute_SEVERITY_%s';
    D3D10_MUTE_ID_STRING = 'Mute_ID_%s';
    D3D10_MUTE_ID_DECIMAL = 'Mute_ID_%d';
    D3D10_UNMUTE_SEVERITY_INFO = 'Unmute_SEVERITY_INFO';
    D3D10_BREAKON_CATEGORY = 'BreakOn_CATEGORY_%s';
    D3D10_BREAKON_SEVERITY = 'BreakOn_SEVERITY_%s';
    D3D10_BREAKON_ID_STRING = 'BreakOn_ID_%s';
    D3D10_BREAKON_ID_DECIMAL = 'BreakOn_ID_%d';
    D3D10_APPSIZE_STRING = 'Size';
    D3D10_APPNAME_STRING = 'Name';

type

    // TFloatArray4 = array[0..3] of single;

    TD3D10_INPUT_CLASSIFICATION = (
        D3D10_INPUT_PER_VERTEX_DATA = 0,
        D3D10_INPUT_PER_INSTANCE_DATA = 1
        );


    { TD3D10_INPUT_ELEMENT_DESC }

    TD3D10_INPUT_ELEMENT_DESC = record
        SemanticName: PAnsiChar;
        SemanticIndex: UINT;
        Format: TDXGI_FORMAT;
        InputSlot: UINT;
        AlignedByteOffset: UINT;
        InputSlotClass: TD3D10_INPUT_CLASSIFICATION;
        InstanceDataStepRate: UINT;
        procedure Init; overload;
        procedure Init(ASemanticName: PAnsiChar; ASemanticIndex: UINT; AFormat: TDXGI_FORMAT; AInputSlot: UINT;
                AAlignedByteOffset: UINT; AInputSlotClass: TD3D10_INPUT_CLASSIFICATION; AInstanceDataStepRate: UINT); overload;
    end;

    PD3D10_INPUT_ELEMENT_DESC = ^TD3D10_INPUT_ELEMENT_DESC;

    TD3D10_FILL_MODE = (
        D3D10_FILL_WIREFRAME = 2,
        D3D10_FILL_SOLID = 3
        );

    TD3D10_PRIMITIVE_TOPOLOGY = TD3D_PRIMITIVE_TOPOLOGY;

    TD3D10_PRIMITIVE = TD3D_PRIMITIVE;

    TD3D10_CULL_MODE = (
        D3D10_CULL_NONE = 1,
        D3D10_CULL_FRONT = 2,
        D3D10_CULL_BACK = 3
        );

    TD3D10_SO_DECLARATION_ENTRY = record
        SemanticName: PAnsiChar;
        SemanticIndex: UINT;
        StartComponent: byte;
        ComponentCount: byte;
        OutputSlot: byte;
    end;

    PD3D10_SO_DECLARATION_ENTRY = ^TD3D10_SO_DECLARATION_ENTRY;

    TD3D10_VIEWPORT = record
        TopLeftX: integer;
        TopLeftY: integer;
        Width: UINT;
        Height: UINT;
        MinDepth: single;
        MaxDepth: single;
    end;

    PD3D10_VIEWPORT = ^TD3D10_VIEWPORT;

    TD3D10_RESOURCE_DIMENSION = (
        D3D10_RESOURCE_DIMENSION_UNKNOWN = 0,
        D3D10_RESOURCE_DIMENSION_BUFFER = 1,
        D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2,
        D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3,
        D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4
        );

    TD3D10_SRV_DIMENSION = TD3D_SRV_DIMENSION;

    TD3D10_DSV_DIMENSION = (
        D3D10_DSV_DIMENSION_UNKNOWN = 0,
        D3D10_DSV_DIMENSION_TEXTURE1D = 1,
        D3D10_DSV_DIMENSION_TEXTURE1DARRAY = 2,
        D3D10_DSV_DIMENSION_TEXTURE2D = 3,
        D3D10_DSV_DIMENSION_TEXTURE2DARRAY = 4,
        D3D10_DSV_DIMENSION_TEXTURE2DMS = 5,
        D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
        );

    TD3D10_RTV_DIMENSION = (
        D3D10_RTV_DIMENSION_UNKNOWN = 0,
        D3D10_RTV_DIMENSION_BUFFER = 1,
        D3D10_RTV_DIMENSION_TEXTURE1D = 2,
        D3D10_RTV_DIMENSION_TEXTURE1DARRAY = 3,
        D3D10_RTV_DIMENSION_TEXTURE2D = 4,
        D3D10_RTV_DIMENSION_TEXTURE2DARRAY = 5,
        D3D10_RTV_DIMENSION_TEXTURE2DMS = 6,
        D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
        D3D10_RTV_DIMENSION_TEXTURE3D = 8
        );

    TD3D10_USAGE = (
        D3D10_USAGE_DEFAULT = 0,
        D3D10_USAGE_IMMUTABLE = 1,
        D3D10_USAGE_DYNAMIC = 2,
        D3D10_USAGE_STAGING = 3
        );

    TD3D10_BIND_FLAG = (
        D3D10_BIND_VERTEX_BUFFER = $1,
        D3D10_BIND_INDEX_BUFFER = $2,
        D3D10_BIND_CONSTANT_BUFFER = $4,
        D3D10_BIND_SHADER_RESOURCE = $8,
        D3D10_BIND_STREAM_OUTPUT = $10,
        D3D10_BIND_RENDER_TARGET = $20,
        D3D10_BIND_DEPTH_STENCIL = $40
        );

    TD3D10_CPU_ACCESS_FLAG = (
        D3D10_CPU_ACCESS_WRITE = $10000,
        D3D10_CPU_ACCESS_READ = $20000
        );

    TD3D10_RESOURCE_MISC_FLAG = (
        D3D10_RESOURCE_MISC_GENERATE_MIPS = $1,
        D3D10_RESOURCE_MISC_SHARED = $2,
        D3D10_RESOURCE_MISC_TEXTURECUBE = $4,
        D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = $10,
        D3D10_RESOURCE_MISC_GDI_COMPATIBLE = $20
        );

    TD3D10_MAP = (
        D3D10_MAP_READ = 1,
        D3D10_MAP_WRITE = 2,
        D3D10_MAP_READ_WRITE = 3,
        D3D10_MAP_WRITE_DISCARD = 4,
        D3D10_MAP_WRITE_NO_OVERWRITE = 5
        );

    TD3D10_MAP_FLAG = (
        D3D10_MAP_FLAG_DO_NOT_WAIT = $100000
        );

    TD3D10_RAISE_FLAG = (
        D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR = $1
        );

    TD3D10_CLEAR_FLAG = (
        D3D10_CLEAR_DEPTH = $1,
        D3D10_CLEAR_STENCIL = $2
        );

    TD3D10_RECT = TRECT;
    PD3D10_RECT = ^TD3D10_RECT;

    TD3D10_BOX = record
        left: UINT;
        top: UINT;
        front: UINT;
        right: UINT;
        bottom: UINT;
        back: UINT;
    end;
    PD3D10_BOX = ^TD3D10_BOX;


    ID3D10Device = interface;


    TD3D10_COMPARISON_FUNC = (
        D3D10_COMPARISON_NEVER = 1,
        D3D10_COMPARISON_LESS = 2,
        D3D10_COMPARISON_EQUAL = 3,
        D3D10_COMPARISON_LESS_EQUAL = 4,
        D3D10_COMPARISON_GREATER = 5,
        D3D10_COMPARISON_NOT_EQUAL = 6,
        D3D10_COMPARISON_GREATER_EQUAL = 7,
        D3D10_COMPARISON_ALWAYS = 8
        );

    TD3D10_DEPTH_WRITE_MASK = (
        D3D10_DEPTH_WRITE_MASK_ZERO = 0,
        D3D10_DEPTH_WRITE_MASK_ALL = 1
        );

    TD3D10_STENCIL_OP = (
        D3D10_STENCIL_OP_KEEP = 1,
        D3D10_STENCIL_OP_ZERO = 2,
        D3D10_STENCIL_OP_REPLACE = 3,
        D3D10_STENCIL_OP_INCR_SAT = 4,
        D3D10_STENCIL_OP_DECR_SAT = 5,
        D3D10_STENCIL_OP_INVERT = 6,
        D3D10_STENCIL_OP_INCR = 7,
        D3D10_STENCIL_OP_DECR = 8
        );

    TD3D10_DEPTH_STENCILOP_DESC = record
        StencilFailOp: TD3D10_STENCIL_OP;
        StencilDepthFailOp: TD3D10_STENCIL_OP;
        StencilPassOp: TD3D10_STENCIL_OP;
        StencilFunc: TD3D10_COMPARISON_FUNC;
    end;

    PD3D10_DEPTH_STENCILOP_DESC = ^TD3D10_DEPTH_STENCILOP_DESC;

    TD3D10_DEPTH_STENCIL_DESC = record
        DepthEnable: longbool;
        DepthWriteMask: TD3D10_DEPTH_WRITE_MASK;
        DepthFunc: TD3D10_COMPARISON_FUNC;
        StencilEnable: longbool;
        StencilReadMask: UINT8;
        StencilWriteMask: UINT8;
        FrontFace: TD3D10_DEPTH_STENCILOP_DESC;
        BackFace: TD3D10_DEPTH_STENCILOP_DESC;
    end;

    PD3D10_DEPTH_STENCIL_DESC = ^TD3D10_DEPTH_STENCIL_DESC;


    ID3D10DeviceChild = interface(IUnknown)
        ['{9B7E4C00-342C-4106-A19F-4F2704F689F0}']
        function GetDevice(out ppDevice: ID3D10Device): HResult; stdcall;
        function GetPrivateData(guid: TGUID; var pDataSize: UINT; out pData: pointer): HResult; stdcall;
        function SetPrivateData(guid: TGUID; DataSize: UINT; const pData: Pointer): HResult; stdcall;
        function SetPrivateDataInterface(guid: TGUID; const pData: IUnknown): HResult; stdcall;
    end;


    ID3D10DepthStencilState = interface(ID3D10DeviceChild)
        ['{2B4B1CC8-A4AD-41f8-8322-CA86FC3EC675}']
        procedure GetDesc(out pDesc: TD3D10_DEPTH_STENCIL_DESC); stdcall;
    end;

    TD3D10_BLEND = (
        D3D10_BLEND_ZERO = 1,
        D3D10_BLEND_ONE = 2,
        D3D10_BLEND_SRC_COLOR = 3,
        D3D10_BLEND_INV_SRC_COLOR = 4,
        D3D10_BLEND_SRC_ALPHA = 5,
        D3D10_BLEND_INV_SRC_ALPHA = 6,
        D3D10_BLEND_DEST_ALPHA = 7,
        D3D10_BLEND_INV_DEST_ALPHA = 8,
        D3D10_BLEND_DEST_COLOR = 9,
        D3D10_BLEND_INV_DEST_COLOR = 10,
        D3D10_BLEND_SRC_ALPHA_SAT = 11,
        D3D10_BLEND_BLEND_FACTOR = 14,
        D3D10_BLEND_INV_BLEND_FACTOR = 15,
        D3D10_BLEND_SRC1_COLOR = 16,
        D3D10_BLEND_INV_SRC1_COLOR = 17,
        D3D10_BLEND_SRC1_ALPHA = 18,
        D3D10_BLEND_INV_SRC1_ALPHA = 19
        );

    TD3D10_BLEND_OP = (
        D3D10_BLEND_OP_ADD = 1,
        D3D10_BLEND_OP_SUBTRACT = 2,
        D3D10_BLEND_OP_REV_SUBTRACT = 3,
        D3D10_BLEND_OP_MIN = 4,
        D3D10_BLEND_OP_MAX = 5
        );

    TD3D10_COLOR_WRITE_ENABLE = (
        D3D10_COLOR_WRITE_ENABLE_RED = 1,
        D3D10_COLOR_WRITE_ENABLE_GREEN = 2,
        D3D10_COLOR_WRITE_ENABLE_BLUE = 4,
        D3D10_COLOR_WRITE_ENABLE_ALPHA = 8,
        D3D10_COLOR_WRITE_ENABLE_ALL = (((Ord(D3D10_COLOR_WRITE_ENABLE_RED) or Ord(D3D10_COLOR_WRITE_ENABLE_GREEN)) or
        Ord(D3D10_COLOR_WRITE_ENABLE_BLUE)) or Ord(D3D10_COLOR_WRITE_ENABLE_ALPHA))
        );

    TD3D10_BLEND_DESC = record
        AlphaToCoverageEnable: longbool;
        BlendEnable: array [0..7] of longbool;
        SrcBlend: TD3D10_BLEND;
        DestBlend: TD3D10_BLEND;
        BlendOp: TD3D10_BLEND_OP;
        SrcBlendAlpha: TD3D10_BLEND;
        DestBlendAlpha: TD3D10_BLEND;
        BlendOpAlpha: TD3D10_BLEND_OP;
        RenderTargetWriteMask: array [0..7] of UINT8;
    end;

    PD3D10_BLEND_DESC = ^TD3D10_BLEND_DESC;

    ID3D10BlendState = interface(ID3D10DeviceChild)
        ['{EDAD8D19-8A35-4d6d-8566-2EA276CDE161}']
        procedure GetDesc(out pDesc: TD3D10_BLEND_DESC); stdcall;
    end;

    TD3D10_RASTERIZER_DESC = record
        FillMode: TD3D10_FILL_MODE;
        CullMode: TD3D10_CULL_MODE;
        FrontCounterClockwise: longbool;
        DepthBias: integer;
        DepthBiasClamp: single;
        SlopeScaledDepthBias: single;
        DepthClipEnable: longbool;
        ScissorEnable: longbool;
        MultisampleEnable: longbool;
        AntialiasedLineEnable: longbool;
    end;

    PD3D10_RASTERIZER_DESC = ^TD3D10_RASTERIZER_DESC;


    ID3D10RasterizerState = interface(ID3D10DeviceChild)
        ['{A2A07292-89AF-4345-BE2E-C53D9FBB6E9F}']
        procedure GetDesc(out pDesc: TD3D10_RASTERIZER_DESC); stdcall;
    end;

    TD3D10_SUBRESOURCE_DATA = record
        pSysMem: pointer;
        SysMemPitch: UINT;
        SysMemSlicePitch: UINT;
    end;

    PD3D10_SUBRESOURCE_DATA = ^TD3D10_SUBRESOURCE_DATA;

    ID3D10Resource = interface(ID3D10DeviceChild)
        ['{9B7E4C01-342C-4106-A19F-4F2704F689F0}']
        procedure GetType(out rType: TD3D10_RESOURCE_DIMENSION); stdcall;
        procedure SetEvictionPriority(EvictionPriority: UINT); stdcall;
        function GetEvictionPriority(): UINT; stdcall;
    end;

    TD3D10_BUFFER_DESC = record
        ByteWidth: UINT;
        Usage: TD3D10_USAGE;
        BindFlags: UINT;
        CPUAccessFlags: UINT;
        MiscFlags: UINT;
        procedure Init(AByteWidth: UINT; ABindFlags: UINT; AUsage: TD3D10_USAGE = D3D10_USAGE_DEFAULT;
                ACPUAccessFlags: UINT = 0; AMiscFlags: UINT = 0);
    end;
    PD3D10_BUFFER_DESC = ^TD3D10_BUFFER_DESC;

    ID3D10Buffer = interface(ID3D10Resource)
        ['{9B7E4C02-342C-4106-A19F-4F2704F689F0}']
        function Map(MapType: TD3D10_MAP; MapFlags: UINT; out ppData: Pointer): HResult; stdcall;
        procedure Unmap(); stdcall;
        procedure GetDesc(out pDesc: TD3D10_BUFFER_DESC); stdcall;
    end;

    PID3D10Buffer = ^ID3D10Buffer;

    TD3D10_TEXTURE1D_DESC = record
        Width: UINT;
        MipLevels: UINT;
        ArraySize: UINT;
        Format: TDXGI_FORMAT;
        Usage: TD3D10_USAGE;
        BindFlags: UINT;
        CPUAccessFlags: UINT;
        MiscFlags: UINT;
        procedure Init(AFormat: TDXGI_FORMAT; Awidth: UINT; AarraySize: UINT = 1; AmipLevels: UINT = 0;
                AbindFlags: UINT = Ord(D3D10_BIND_SHADER_RESOURCE); AUsage: TD3D10_USAGE = D3D10_USAGE_DEFAULT;
                AcpuaccessFlags: UINT = 0; AmiscFlags: UINT = 0);
    end;
    PD3D10_TEXTURE1D_DESC = ^TD3D10_TEXTURE1D_DESC;

    ID3D10Texture1D = interface(ID3D10Resource)
        ['{9B7E4C03-342C-4106-A19F-4F2704F689F0}']
        function Map(Subresource: UINT; MapType: TD3D10_MAP; MapFlags: UINT; out ppData: pointer): HResult; stdcall;
        procedure Unmap(Subresource: UINT); stdcall;
        procedure GetDesc(out pDesc: TD3D10_TEXTURE1D_DESC); stdcall;
    end;

    { TD3D10_TEXTURE2D_DESC }

    TD3D10_TEXTURE2D_DESC = record
        Width: UINT;
        Height: UINT;
        MipLevels: UINT;
        ArraySize: UINT;
        Format: TDXGI_FORMAT;
        SampleDesc: TDXGI_SAMPLE_DESC;
        Usage: TD3D10_USAGE;
        BindFlags: UINT;
        CPUAccessFlags: UINT;
        MiscFlags: UINT;
        procedure Init(AFormat: TDXGI_FORMAT; Awidth: UINT; AHeight: UINT; AarraySize: UINT; AmipLevels: UINT;
                AbindFlags: UINT; AUsage: TD3D10_USAGE; AcpuaccessFlags: UINT; ASampleCount: UINT = 1; ASampleQuality: UINT = 0;
                AmiscFlags: UINT = 0);

    end;
    PD3D10_TEXTURE2D_DESC = ^TD3D10_TEXTURE2D_DESC;

    TD3D10_MAPPED_TEXTURE2D = record
        pData: pointer;
        RowPitch: UINT;
    end;
    PD3D10_MAPPED_TEXTURE2D = ^TD3D10_MAPPED_TEXTURE2D;

    ID3D10Texture2D = interface(ID3D10Resource)
        ['{9B7E4C04-342C-4106-A19F-4F2704F689F0}']
        function Map(Subresource: UINT; MapType: TD3D10_MAP; MapFlags: UINT; out pMappedTex2D: TD3D10_MAPPED_TEXTURE2D): HResult; stdcall;
        procedure Unmap(Subresource: UINT); stdcall;
        procedure GetDesc(out pDesc: TD3D10_TEXTURE2D_DESC); stdcall;
    end;


    { TD3D10_TEXTURE3D_DESC }

    TD3D10_TEXTURE3D_DESC = record
        Width: UINT;
        Height: UINT;
        Depth: UINT;
        MipLevels: UINT;
        Format: TDXGI_FORMAT;
        Usage: TD3D10_USAGE;
        BindFlags: UINT;
        CPUAccessFlags: UINT;
        MiscFlags: UINT;
        procedure Init(Aformat: TDXGI_FORMAT; Awidth: UINT; Aheight: UINT; Adepth: UINT; AmipLevels: UINT = 0;
                AbindFlags: UINT = Ord(D3D10_BIND_SHADER_RESOURCE); Ausage: TD3D10_USAGE = D3D10_USAGE_DEFAULT;
                AcpuaccessFlags: UINT = 0; AmiscFlags: UINT = 0);
    end;
    PD3D10_TEXTURE3D_DESC = ^TD3D10_TEXTURE3D_DESC;

    TD3D10_MAPPED_TEXTURE3D = record
        pData: Pointer;
        RowPitch: UINT;
        DepthPitch: UINT;
    end;
    PD3D10_MAPPED_TEXTURE3D = ^TD3D10_MAPPED_TEXTURE3D;

    ID3D10Texture3D = interface(ID3D10Resource)
        ['{9B7E4C05-342C-4106-A19F-4F2704F689F0}']
        function Map(Subresource: UINT; MapType: TD3D10_MAP; MapFlags: UINT; out pMappedTex3D: TD3D10_MAPPED_TEXTURE3D): HResult; stdcall;
        procedure Unmap(Subresource: UINT); stdcall;
        procedure GetDesc(out pDesc: TD3D10_TEXTURE3D_DESC); stdcall;
    end;

    PID3D10Texture3D = ^ID3D10Texture3D;

    TD3D10_TEXTURECUBE_FACE = (
        D3D10_TEXTURECUBE_FACE_POSITIVE_X = 0,
        D3D10_TEXTURECUBE_FACE_NEGATIVE_X = 1,
        D3D10_TEXTURECUBE_FACE_POSITIVE_Y = 2,
        D3D10_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
        D3D10_TEXTURECUBE_FACE_POSITIVE_Z = 4,
        D3D10_TEXTURECUBE_FACE_NEGATIVE_Z = 5
        );

    PD3D10_TEXTURECUBE_FACE = ^TD3D10_TEXTURECUBE_FACE;

    ID3D10View = interface(ID3D10DeviceChild)
        ['{C902B03F-60A7-49BA-9936-2A3AB37A7E33}']
        procedure GetResource(out ppResource: ID3D10Resource); stdcall;
    end;

    TD3D10_BUFFER_SRV = record
        case integer of
            0: (
                FirstElement: UINT;
                ElementOffset: UINT;
            );
            1: (
                NumElements: UINT;
                ElementWidth: UINT;
            );
    end;

    PD3D10_BUFFER_SRV = ^TD3D10_BUFFER_SRV;

    TD3D10_TEX1D_SRV = record
        MostDetailedMip: UINT;
        MipLevels: UINT;
    end;
    PD3D10_TEX1D_SRV = ^TD3D10_TEX1D_SRV;

    TD3D10_TEX1D_ARRAY_SRV = record
        MostDetailedMip: UINT;
        MipLevels: UINT;
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    PD3D10_TEX1D_ARRAY_SRV = ^TD3D10_TEX1D_ARRAY_SRV;

    TD3D10_TEX2D_SRV = record
        MostDetailedMip: UINT;
        MipLevels: UINT;
    end;

    PD3D10_TEX2D_SRV = ^TD3D10_TEX2D_SRV;

    TD3D10_TEX2D_ARRAY_SRV = record
        MostDetailedMip: UINT;
        MipLevels: UINT;
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    PD3D10_TEX2D_ARRAY_SRV = ^TD3D10_TEX2D_ARRAY_SRV;

    TD3D10_TEX3D_SRV = record
        MostDetailedMip: UINT;
        MipLevels: UINT;
    end;

    TD3D10_TEXCUBE_SRV = record
        MostDetailedMip: UINT;
        MipLevels: UINT;
    end;

    TD3D10_TEX2DMS_SRV = record
        UnusedField_NothingToDefine: UINT;
    end;

    TD3D10_TEX2DMS_ARRAY_SRV = record
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;
    PD3D10_TEX2DMS_ARRAY_SRV = ^TD3D10_TEX2DMS_ARRAY_SRV;

    TD3D10_SHADER_RESOURCE_VIEW_DESC = record
        Format: TDXGI_FORMAT;
        ViewDimension: TD3D10_SRV_DIMENSION;
        case integer of
            0: (Buffer: TD3D10_BUFFER_SRV;);
            1: (Texture1D: TD3D10_TEX1D_SRV;);
            2: (Texture1DArray: TD3D10_TEX1D_ARRAY_SRV;);
            3: (Texture2D: TD3D10_TEX2D_SRV;);
            4: (Texture2DArray: TD3D10_TEX2D_ARRAY_SRV;);
            5: (Texture2DMS: TD3D10_TEX2DMS_SRV;);
            6: (Texture2DMSArray: TD3D10_TEX2DMS_ARRAY_SRV;);
            7: (Texture3D: TD3D10_TEX3D_SRV;);
            8: (TextureCube: TD3D10_TEXCUBE_SRV;);
    end;
    PD3D10_SHADER_RESOURCE_VIEW_DESC = ^TD3D10_SHADER_RESOURCE_VIEW_DESC;


    ID3D10ShaderResourceView = interface(ID3D10View)
        ['{9B7E4C07-342C-4106-A19F-4F2704F689F0}']
        procedure GetDesc(out pDesc: TD3D10_SHADER_RESOURCE_VIEW_DESC); stdcall;
    end;

    PID3D10ShaderResourceView = ^ID3D10ShaderResourceView;


    TD3D10_BUFFER_RTV = record
        case integer of
            0: (

                FirstElement: UINT;
                ElementOffset: UINT;
            );
            1: (
                NumElements: UINT;
                ElementWidth: UINT;
            );
    end;

    PD3D10_BUFFER_RTV = ^TD3D10_BUFFER_RTV;

    TD3D10_TEX1D_RTV = record
        MipSlice: UINT;
    end;
    PD3D10_TEX1D_RTV = ^TD3D10_TEX1D_RTV;

    TD3D10_TEX1D_ARRAY_RTV = record
        MipSlice: UINT;
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    PD3D10_TEX1D_ARRAY_RTV = ^TD3D10_TEX1D_ARRAY_RTV;

    TD3D10_TEX2D_RTV = record
        MipSlice: UINT;
    end;
    PD3D10_TEX2D_RTV = ^TD3D10_TEX2D_RTV;

    TD3D10_TEX2DMS_RTV = record
        UnusedField_NothingToDefine: UINT;
    end;

    PD3D10_TEX2DMS_RTV = ^TD3D10_TEX2DMS_RTV;

    TD3D10_TEX2D_ARRAY_RTV = record
        MipSlice: UINT;
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    PD3D10_TEX2D_ARRAY_RTV = ^TD3D10_TEX2D_ARRAY_RTV;

    TD3D10_TEX2DMS_ARRAY_RTV = record
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    PD3D10_TEX2DMS_ARRAY_RTV = ^TD3D10_TEX2DMS_ARRAY_RTV;


    TD3D10_TEX3D_RTV = record
        MipSlice: UINT;
        FirstWSlice: UINT;
        WSize: UINT;
    end;

    TD3D10_RENDER_TARGET_VIEW_DESC = record
        Format: TDXGI_FORMAT;
        ViewDimension: TD3D10_RTV_DIMENSION;
        case integer of
            0: (Buffer: TD3D10_BUFFER_RTV;);
            1: (Texture1D: TD3D10_TEX1D_RTV;);
            2: (Texture1DArray: TD3D10_TEX1D_ARRAY_RTV;);
            3: (Texture2D: TD3D10_TEX2D_RTV;);
            4: (Texture2DArray: TD3D10_TEX2D_ARRAY_RTV;);
            5: (Texture2DMS: TD3D10_TEX2DMS_RTV;);
            6: (Texture2DMSArray: TD3D10_TEX2DMS_ARRAY_RTV;);
            7: (Texture3D: TD3D10_TEX3D_RTV;);
    end;

    PD3D10_RENDER_TARGET_VIEW_DESC = ^TD3D10_RENDER_TARGET_VIEW_DESC;

    ID3D10RenderTargetView = interface(ID3D10View)
        ['{9B7E4C08-342C-4106-A19F-4F2704F689F0}']
        procedure GetDesc(out pDesc: TD3D10_RENDER_TARGET_VIEW_DESC); stdcall;
    end;

    PID3D10RenderTargetView = ^ID3D10RenderTargetView;

    TD3D10_TEX1D_DSV = record
        MipSlice: UINT;
    end;

    TD3D10_TEX1D_ARRAY_DSV = record
        MipSlice: UINT;
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    TD3D10_TEX2D_DSV = record
        MipSlice: UINT;
    end;

    TD3D10_TEX2D_ARRAY_DSV = record
        MipSlice: UINT;
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    TD3D10_TEX2DMS_DSV = record
        UnusedField_NothingToDefine: UINT;
    end;

    TD3D10_TEX2DMS_ARRAY_DSV = record
        FirstArraySlice: UINT;
        ArraySize: UINT;
    end;

    TD3D10_DEPTH_STENCIL_VIEW_DESC = record
        Format: TDXGI_FORMAT;
        ViewDimension: TD3D10_DSV_DIMENSION;
        case integer of
            0: (Texture1D: TD3D10_TEX1D_DSV;);
            1: (Texture1DArray: TD3D10_TEX1D_ARRAY_DSV;);
            2: (Texture2D: TD3D10_TEX2D_DSV;);
            3: (Texture2DArray: TD3D10_TEX2D_ARRAY_DSV;);
            4: (Texture2DMS: TD3D10_TEX2DMS_DSV;);
            5: (Texture2DMSArray: TD3D10_TEX2DMS_ARRAY_DSV;);
    end;

    PD3D10_DEPTH_STENCIL_VIEW_DESC = ^TD3D10_DEPTH_STENCIL_VIEW_DESC;

    ID3D10DepthStencilView = interface(ID3D10View)
        ['{9B7E4C09-342C-4106-A19F-4F2704F689F0}']
        procedure GetDesc(out pDesc: TD3D10_DEPTH_STENCIL_VIEW_DESC); stdcall;
    end;

    PID3D10DepthStencilView = ^ID3D10DepthStencilView;


    ID3D10VertexShader = interface(ID3D10DeviceChild)
        ['{9B7E4C0A-342C-4106-A19F-4F2704F689F0}']
    end;

    PID3D10VertexShader = ^ID3D10VertexShader;

    ID3D10GeometryShader = interface(ID3D10DeviceChild)
        ['{6316BE88-54CD-4040-AB44-20461BC81F68}']
    end;

    PID3D10GeometryShader = ^ID3D10GeometryShader;


    ID3D10PixelShader = interface(ID3D10DeviceChild)
        ['{4968B601-9D00-4cde-8346-8E7F675819B6}']
    end;

    PID3D10PixelShader = ^ID3D10PixelShader;

    ID3D10InputLayout = interface(ID3D10DeviceChild)
        ['{9B7E4C0B-342C-4106-A19F-4F2704F689F0}']
    end;

    PID3D10InputLayout = ^ID3D10InputLayout;

    TD3D10_FILTER = (
        D3D10_FILTER_MIN_MAG_MIP_POINT = 0,
        D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = $1,
        D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = $4,
        D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = $5,
        D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = $10,
        D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = $11,
        D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = $14,
        D3D10_FILTER_MIN_MAG_MIP_LINEAR = $15,
        D3D10_FILTER_ANISOTROPIC = $55,
        D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = $80,
        D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = $81,
        D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = $84,
        D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = $85,
        D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = $90,
        D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = $91,
        D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = $94,
        D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = $95,
        D3D10_FILTER_COMPARISON_ANISOTROPIC = $d5,
        D3D10_FILTER_TEXT_1BIT = $80000000
        );

    TD3D10_FILTER_TYPE = (
        D3D10_FILTER_TYPE_POINT = 0,
        D3D10_FILTER_TYPE_LINEAR = 1
        );

    TD3D10_TEXTURE_ADDRESS_MODE = (
        D3D10_TEXTURE_ADDRESS_WRAP = 1,
        D3D10_TEXTURE_ADDRESS_MIRROR = 2,
        D3D10_TEXTURE_ADDRESS_CLAMP = 3,
        D3D10_TEXTURE_ADDRESS_BORDER = 4,
        D3D10_TEXTURE_ADDRESS_MIRROR_ONCE = 5);

    TD3D10_SAMPLER_DESC = record
        Filter: TD3D10_FILTER;
        AddressU: TD3D10_TEXTURE_ADDRESS_MODE;
        AddressV: TD3D10_TEXTURE_ADDRESS_MODE;
        AddressW: TD3D10_TEXTURE_ADDRESS_MODE;
        MipLODBias: single;
        MaxAnisotropy: UINT;
        ComparisonFunc: TD3D10_COMPARISON_FUNC;
        BorderColor: array [0..3] of single;
        MinLOD: single;
        MaxLOD: single;
    end;

    PD3D10_SAMPLER_DESC = ^TD3D10_SAMPLER_DESC;

    ID3D10SamplerState = interface(ID3D10DeviceChild)
        ['{9B7E4C0C-342C-4106-A19F-4F2704F689F0}']
        procedure GetDesc(out pDesc: TD3D10_SAMPLER_DESC); stdcall;
    end;

    PID3D10SamplerState = ^ID3D10SamplerState;

    TD3D10_FORMAT_SUPPORT = (
        D3D10_FORMAT_SUPPORT_BUFFER = $1,
        D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER = $2,
        D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER = $4,
        D3D10_FORMAT_SUPPORT_SO_BUFFER = $8,
        D3D10_FORMAT_SUPPORT_TEXTURE1D = $10,
        D3D10_FORMAT_SUPPORT_TEXTURE2D = $20,
        D3D10_FORMAT_SUPPORT_TEXTURE3D = $40,
        D3D10_FORMAT_SUPPORT_TEXTURECUBE = $80,
        D3D10_FORMAT_SUPPORT_SHADER_LOAD = $100,
        D3D10_FORMAT_SUPPORT_SHADER_SAMPLE = $200,
        D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = $400,
        D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = $800,
        D3D10_FORMAT_SUPPORT_MIP = $1000,
        D3D10_FORMAT_SUPPORT_MIP_AUTOGEN = $2000,
        D3D10_FORMAT_SUPPORT_RENDER_TARGET = $4000,
        D3D10_FORMAT_SUPPORT_BLENDABLE = $8000,
        D3D10_FORMAT_SUPPORT_DEPTH_STENCIL = $10000,
        D3D10_FORMAT_SUPPORT_CPU_LOCKABLE = $20000,
        D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = $40000,
        D3D10_FORMAT_SUPPORT_DISPLAY = $80000,
        D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = $100000,
        D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = $200000,
        D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = $400000,
        D3D10_FORMAT_SUPPORT_SHADER_GATHER = $800000,
        D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST = $1000000
        );

    ID3D10Asynchronous = interface(ID3D10DeviceChild)
        ['{9B7E4C0D-342C-4106-A19F-4F2704F689F0}']
        procedure _Begin(); stdcall;
        procedure _End(); stdcall;
        function GetData(out pData: pointer; DataSize: UINT; GetDataFlags: UINT): HResult; stdcall;
        function GetDataSize(): UINT; stdcall;
    end;

    PID3D10Asynchronous = ^ID3D10Asynchronous;


    TD3D10_ASYNC_GETDATA_FLAG = (
        D3D10_ASYNC_GETDATA_DONOTFLUSH = $1
        );

    TD3D10_QUERY = (
        D3D10_QUERY_EVENT = 0,
        D3D10_QUERY_OCCLUSION = (D3D10_QUERY_EVENT + 1),
        D3D10_QUERY_TIMESTAMP = (D3D10_QUERY_OCCLUSION + 1),
        D3D10_QUERY_TIMESTAMP_DISJOINT = (D3D10_QUERY_TIMESTAMP + 1),
        D3D10_QUERY_PIPELINE_STATISTICS = (D3D10_QUERY_TIMESTAMP_DISJOINT + 1),
        D3D10_QUERY_OCCLUSION_PREDICATE = (D3D10_QUERY_PIPELINE_STATISTICS + 1),
        D3D10_QUERY_SO_STATISTICS = (D3D10_QUERY_OCCLUSION_PREDICATE + 1),
        D3D10_QUERY_SO_OVERFLOW_PREDICATE = (D3D10_QUERY_SO_STATISTICS + 1)
        );

    TD3D10_QUERY_MISC_FLAG = (
        D3D10_QUERY_MISC_PREDICATEHINT = $1
        );

    TD3D10_QUERY_DESC = record
        Query: TD3D10_QUERY;
        MiscFlags: UINT;
    end;

    PD3D10_QUERY_DESC = ^TD3D10_QUERY_DESC;

    ID3D10Query = interface(ID3D10Asynchronous)
        ['{9B7E4C0E-342C-4106-A19F-4F2704F689F0}']
        procedure GetDesc(out pDesc: TD3D10_QUERY_DESC); stdcall;
    end;

    PID3D10Query = ^ID3D10Query;

    ID3D10Predicate = interface(ID3D10Query)
        ['{9B7E4C10-342C-4106-A19F-4F2704F689F0}']
    end;

    PID3D10Predicate = ^ID3D10Predicate;

    TD3D10_QUERY_DATA_TIMESTAMP_DISJOINT = record
        Frequency: UINT64;
        Disjoint: longbool;
    end;

    PD3D10_QUERY_DATA_TIMESTAMP_DISJOINT = ^TD3D10_QUERY_DATA_TIMESTAMP_DISJOINT;

    TD3D10_QUERY_DATA_PIPELINE_STATISTICS = record
        IAVertices: UINT64;
        IAPrimitives: UINT64;
        VSInvocations: UINT64;
        GSInvocations: UINT64;
        GSPrimitives: UINT64;
        CInvocations: UINT64;
        CPrimitives: UINT64;
        PSInvocations: UINT64;
    end;

    PD3D10_QUERY_DATA_PIPELINE_STATISTICS = ^TD3D10_QUERY_DATA_PIPELINE_STATISTICS;

    TD3D10_QUERY_DATA_SO_STATISTICS = record
        NumPrimitivesWritten: UINT64;
        PrimitivesStorageNeeded: UINT64;
    end;

    PD3D10_QUERY_DATA_SO_STATISTICS = ^TD3D10_QUERY_DATA_SO_STATISTICS;

    TD3D10_COUNTER = (
        D3D10_COUNTER_GPU_IDLE = 0,
        D3D10_COUNTER_VERTEX_PROCESSING = (D3D10_COUNTER_GPU_IDLE + 1),
        D3D10_COUNTER_GEOMETRY_PROCESSING = (D3D10_COUNTER_VERTEX_PROCESSING + 1),
        D3D10_COUNTER_PIXEL_PROCESSING = (D3D10_COUNTER_GEOMETRY_PROCESSING + 1),
        D3D10_COUNTER_OTHER_GPU_PROCESSING = (D3D10_COUNTER_PIXEL_PROCESSING + 1),
        D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION = (D3D10_COUNTER_OTHER_GPU_PROCESSING + 1),
        D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION = (D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION + 1),
        D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION = (D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION + 1),
        D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION = (D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION + 1),
        D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION = (D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION + 1),
        D3D10_COUNTER_VS_MEMORY_LIMITED = (D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION + 1),
        D3D10_COUNTER_VS_COMPUTATION_LIMITED = (D3D10_COUNTER_VS_MEMORY_LIMITED + 1),
        D3D10_COUNTER_GS_MEMORY_LIMITED = (D3D10_COUNTER_VS_COMPUTATION_LIMITED + 1),
        D3D10_COUNTER_GS_COMPUTATION_LIMITED = (D3D10_COUNTER_GS_MEMORY_LIMITED + 1),
        D3D10_COUNTER_PS_MEMORY_LIMITED = (D3D10_COUNTER_GS_COMPUTATION_LIMITED + 1),
        D3D10_COUNTER_PS_COMPUTATION_LIMITED = (D3D10_COUNTER_PS_MEMORY_LIMITED + 1),
        D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE = (D3D10_COUNTER_PS_COMPUTATION_LIMITED + 1),
        D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE = (D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE + 1),
        D3D10_COUNTER_DEVICE_DEPENDENT_0 = $40000000
        );

    TD3D10_COUNTER_TYPE = (
        D3D10_COUNTER_TYPE_FLOAT32 = 0,
        D3D10_COUNTER_TYPE_UINT16 = (D3D10_COUNTER_TYPE_FLOAT32 + 1),
        D3D10_COUNTER_TYPE_UINT32 = (D3D10_COUNTER_TYPE_UINT16 + 1),
        D3D10_COUNTER_TYPE_UINT64 = (D3D10_COUNTER_TYPE_UINT32 + 1)
        );

    TD3D10_COUNTER_DESC = record
        Counter: TD3D10_COUNTER;
        MiscFlags: UINT;
    end;

    PD3D10_COUNTER_DESC = ^TD3D10_COUNTER_DESC;

    TD3D10_COUNTER_INFO = record
        LastDeviceDependentCounter: TD3D10_COUNTER;
        NumSimultaneousCounters: UINT;
        NumDetectableParallelUnits: UINT8;
    end;

    PD3D10_COUNTER_INFO = ^TD3D10_COUNTER_INFO;

    ID3D10Counter = interface(ID3D10Asynchronous)
        ['{9B7E4C11-342C-4106-A19F-4F2704F689F0}']
        procedure GetDesc(out pDesc: TD3D10_COUNTER_DESC); stdcall;
    end;

    PID3D10Counter = ^ID3D10Counter;


    ID3D10Device = interface(IUnknown)
        ['{9B7E4C0F-342C-4106-A19F-4F2704F689F0}']
        procedure VSSetConstantBuffers(StartSlot: UINT; NumBuffers: UINT; ppConstantBuffers: PID3D10Buffer); stdcall;
        procedure PSSetShaderResources(StartSlot: UINT; NumViews: UINT; ppShaderResourceViews: PID3D10ShaderResourceView); stdcall;
        procedure PSSetShader(pPixelShader: ID3D10PixelShader); stdcall;
        procedure PSSetSamplers(StartSlot: UINT; NumSamplers: UINT; ppSamplers: PID3D10SamplerState); stdcall;
        procedure VSSetShader(pVertexShader: ID3D10VertexShader); stdcall;
        procedure DrawIndexed(IndexCount: UINT; StartIndexLocation: UINT; BaseVertexLocation: integer); stdcall;
        procedure Draw(VertexCount: UINT; StartVertexLocation: UINT); stdcall;
        procedure PSSetConstantBuffers(StartSlot: UINT; NumBuffers: UINT; ppConstantBuffers: PID3D10Buffer); stdcall;
        procedure IASetInputLayout(pInputLayout: ID3D10InputLayout); stdcall;
        procedure IASetVertexBuffers(StartSlot: UINT; NumBuffers: UINT; ppVertexBuffers: PID3D10Buffer;
            const pStrides: PUINT; pOffsets: PUINT); stdcall;
        procedure IASetIndexBuffer(pIndexBuffer: ID3D10Buffer; Format: TDXGI_FORMAT; Offset: UINT); stdcall;
        procedure DrawIndexedInstanced(IndexCountPerInstance: UINT; InstanceCount: UINT; StartIndexLocation: UINT;
            BaseVertexLocation: integer; StartInstanceLocation: UINT); stdcall;
        procedure DrawInstanced(VertexCountPerInstance: UINT; InstanceCount: UINT; StartVertexLocation: UINT;
            StartInstanceLocation: UINT); stdcall;
        procedure GSSetConstantBuffers(StartSlot: UINT; NumBuffers: UINT; const ppConstantBuffers: PID3D10Buffer); stdcall;
        procedure GSSetShader(pShader: ID3D10GeometryShader); stdcall;
        procedure IASetPrimitiveTopology(Topology: TD3D10_PRIMITIVE_TOPOLOGY); stdcall;
        procedure VSSetShaderResources(StartSlot: UINT; NumViews: UINT; ppShaderResourceViews: PID3D10ShaderResourceView); stdcall;
        procedure VSSetSamplers(StartSlot: UINT; NumSamplers: UINT; ppSamplers: PID3D10SamplerState); stdcall;
        procedure SetPredication(pPredicate: ID3D10Predicate; PredicateValue: longbool); stdcall;
        procedure GSSetShaderResources(StartSlot: UINT; NumViews: UINT; ppShaderResourceViews: PID3D10ShaderResourceView); stdcall;
        procedure GSSetSamplers(StartSlot: UINT; NumSamplers: UINT; ppSamplers: PID3D10SamplerState); stdcall;
        procedure OMSetRenderTargets(NumViews: UINT; ppRenderTargetViews: PID3D10RenderTargetView;
            pDepthStencilView: ID3D10DepthStencilView); stdcall;
        procedure OMSetBlendState(pBlendState: ID3D10BlendState; const BlendFactor: TFloatArray4; SampleMask: UINT); stdcall;
        procedure OMSetDepthStencilState(pDepthStencilState: ID3D10DepthStencilState; StencilRef: UINT); stdcall;
        procedure SOSetTargets(NumBuffers: UINT; ppSOTargets: PID3D10Buffer; pOffsets: PUINT); stdcall;
        procedure DrawAuto(); stdcall;
        procedure RSSetState(pRasterizerState: ID3D10RasterizerState); stdcall;
        procedure RSSetViewports(NumViewports: UINT; pViewports: PD3D10_VIEWPORT); stdcall;
        procedure RSSetScissorRects(NumRects: UINT; pRects: PD3D10_RECT); stdcall;
        procedure CopySubresourceRegion(pDstResource: ID3D10Resource; DstSubresource: UINT; DstX: UINT; DstY: UINT;
            DstZ: UINT; pSrcResource: ID3D10Resource; SrcSubresource: UINT; pSrcBox: PD3D10_BOX); stdcall;
        procedure CopyResource(pDstResource: ID3D10Resource; pSrcResource: ID3D10Resource); stdcall;
        procedure UpdateSubresource(pDstResource: ID3D10Resource; DstSubresource: UINT; pDstBox: PD3D10_BOX;
            const pSrcData: Pointer; SrcRowPitch: UINT; SrcDepthPitch: UINT); stdcall;
        procedure ClearRenderTargetView(pRenderTargetView: ID3D10RenderTargetView; const ColorRGBA: TFloatArray4); stdcall;
        procedure ClearDepthStencilView(pDepthStencilView: ID3D10DepthStencilView; ClearFlags: UINT; Depth: single;
            Stencil: UINT8); stdcall;
        procedure GenerateMips(pShaderResourceView: ID3D10ShaderResourceView); stdcall;
        procedure ResolveSubresource(pDstResource: ID3D10Resource; DstSubresource: UINT; pSrcResource: ID3D10Resource;
            SrcSubresource: UINT; Format: TDXGI_FORMAT); stdcall;
        procedure VSGetConstantBuffers(StartSlot: UINT; NumBuffers: UINT; out ppConstantBuffers: PID3D10Buffer); stdcall;
        procedure PSGetShaderResources(StartSlot: UINT; NumViews: UINT; out ppShaderResourceViews: PID3D10ShaderResourceView); stdcall;
        procedure PSGetShader(out ppPixelShader: ID3D10PixelShader); stdcall;
        procedure PSGetSamplers(StartSlot: UINT; NumSamplers: UINT; out ppSamplers: PID3D10SamplerState); stdcall;
        procedure VSGetShader(out ppVertexShader: ID3D10VertexShader); stdcall;
        procedure PSGetConstantBuffers(StartSlot: UINT; NumBuffers: UINT; out ppConstantBuffers: PID3D10Buffer); stdcall;
        procedure IAGetInputLayout(out ppInputLayout: ID3D10InputLayout); stdcall;
        procedure IAGetVertexBuffers(StartSlot: UINT; NumBuffers: UINT; out ppVertexBuffers: PID3D10Buffer;
            out pStrides: PUINT; out pOffsets: PUINT); stdcall;
        procedure IAGetIndexBuffer(out pIndexBuffer: ID3D10Buffer; out Format: TDXGI_FORMAT; out Offset: UINT); stdcall;
        procedure GSGetConstantBuffers(StartSlot: UINT; NumBuffers: UINT; out ppConstantBuffers: PID3D10Buffer);
            stdcall;
        procedure GSGetShader(out ppGeometryShader: ID3D10GeometryShader); stdcall;
        procedure IAGetPrimitiveTopology(out pTopology: TD3D10_PRIMITIVE_TOPOLOGY); stdcall;
        procedure VSGetShaderResources(StartSlot: UINT; NumViews: UINT; out ppShaderResourceViews: PID3D10ShaderResourceView); stdcall;
        procedure VSGetSamplers(StartSlot: UINT; NumSamplers: UINT; out ppSamplers: PID3D10SamplerState); stdcall;
        procedure GetPredication(out ppPredicate: ID3D10Predicate; out pPredicateValue: longbool); stdcall;
        procedure GSGetShaderResources(StartSlot: UINT; NumViews: UINT; out ppShaderResourceViews: PID3D10ShaderResourceView); stdcall;
        procedure GSGetSamplers(StartSlot: UINT; NumSamplers: UINT; out ppSamplers: PID3D10SamplerState); stdcall;
        procedure OMGetRenderTargets(NumViews: UINT; out ppRenderTargetViews: PID3D10RenderTargetView;
            out ppDepthStencilView: ID3D10DepthStencilView); stdcall;
        procedure OMGetBlendState(out ppBlendState: ID3D10BlendState; out BlendFactor: TFloatArray4; out pSampleMask: UINT); stdcall;
        procedure OMGetDepthStencilState(out ppDepthStencilState: ID3D10DepthStencilState; out pStencilRef: UINT); stdcall;
        procedure SOGetTargets(NumBuffers: UINT; out ppSOTargets: PID3D10Buffer; out pOffsets: PUINT); stdcall;
        procedure RSGetState(out ppRasterizerState: ID3D10RasterizerState); stdcall;
        procedure RSGetViewports(var NumViewports: UINT; out pViewports: PD3D10_VIEWPORT); stdcall;
        procedure RSGetScissorRects(var NumRects: UINT; out pRects: PD3D10_RECT); stdcall;
        function GetDeviceRemovedReason(): HResult; stdcall;
        function SetExceptionMode(RaiseFlags: UINT): HResult; stdcall;
        function GetExceptionMode(): UINT; stdcall;
        function GetPrivateData(guid: TGUID; var pDataSize: UINT; pData: Pointer): HResult; stdcall;
        function SetPrivateData(guid: TGUID; DataSize: UINT; pData: pointer): HResult; stdcall;
        function SetPrivateDataInterface(guid: TGUID; pData: IUnknown): HResult; stdcall;
        procedure ClearState(); stdcall;
        procedure Flush(); stdcall;
        function CreateBuffer(const pDesc: PD3D10_BUFFER_DESC; pInitialData: PD3D10_SUBRESOURCE_DATA;
            out ppBuffer: ID3D10Buffer): HResult; stdcall;
        function CreateTexture1D(pDesc: PD3D10_TEXTURE1D_DESC; pInitialData: PD3D10_SUBRESOURCE_DATA;
            out ppTexture1D: ID3D10Texture1D): HResult; stdcall;
        function CreateTexture2D(pDesc: PD3D10_TEXTURE2D_DESC; pInitialData: PD3D10_SUBRESOURCE_DATA;
            out ppTexture2D: ID3D10Texture2D): HResult; stdcall;
        function CreateTexture3D(pDesc: PD3D10_TEXTURE3D_DESC; pInitialData: PD3D10_SUBRESOURCE_DATA;
            out ppTexture3D: ID3D10Texture3D): HResult; stdcall;
        function CreateShaderResourceView(pResource: ID3D10Resource; pDesc: PD3D10_SHADER_RESOURCE_VIEW_DESC;
            out ppSRView: ID3D10ShaderResourceView): HResult; stdcall;
        function CreateRenderTargetView(pResource: ID3D10Resource; pDesc: PD3D10_RENDER_TARGET_VIEW_DESC;
            out ppRTView: ID3D10RenderTargetView): HResult; stdcall;
        function CreateDepthStencilView(pResource: ID3D10Resource; pDesc: PD3D10_DEPTH_STENCIL_VIEW_DESC;
            out ppDepthStencilView: ID3D10DepthStencilView): HResult; stdcall;
        function CreateInputLayout(pInputElementDescs: PD3D10_INPUT_ELEMENT_DESC; NumElements: UINT;
            pShaderBytecodeWithInputSignature: Pointer; BytecodeLength: SIZE_T; out ppInputLayout: ID3D10InputLayout): HResult; stdcall;
        function CreateVertexShader(pShaderBytecode: Pointer; BytecodeLength: SIZE_T;
            out ppVertexShader: ID3D10VertexShader): HResult; stdcall;
        function CreateGeometryShader(pShaderBytecode: pointer; BytecodeLength: SIZE_T;
            out ppGeometryShader: ID3D10GeometryShader): HResult; stdcall;
        function CreateGeometryShaderWithStreamOutput(pShaderBytecode: pointer; BytecodeLength: SIZE_T;
            const pSODeclaration: PD3D10_SO_DECLARATION_ENTRY; NumEntries: UINT; OutputStreamStride: UINT;
            out ppGeometryShader: ID3D10GeometryShader): HResult; stdcall;
        function CreatePixelShader(pShaderBytecode: pointer; BytecodeLength: SIZE_T;
            out ppPixelShader: ID3D10PixelShader): HResult; stdcall;
        function CreateBlendState(pBlendStateDesc: PD3D10_BLEND_DESC; out ppBlendState: ID3D10BlendState): HResult; stdcall;
        function CreateDepthStencilState(pDepthStencilDesc: PD3D10_DEPTH_STENCIL_DESC;
            out ppDepthStencilState: ID3D10DepthStencilState): HResult; stdcall;
        function CreateRasterizerState(pRasterizerDesc: PD3D10_RASTERIZER_DESC;
            out ppRasterizerState: ID3D10RasterizerState): HResult; stdcall;
        function CreateSamplerState(pSamplerDesc: PD3D10_SAMPLER_DESC; out ppSamplerState: ID3D10SamplerState): HResult; stdcall;
        function CreateQuery(const pQueryDesc: PD3D10_QUERY_DESC; out ppQuery: ID3D10Query): HResult; stdcall;
        function CreatePredicate(pPredicateDesc: PD3D10_QUERY_DESC; out ppPredicate: ID3D10Predicate): HResult; stdcall;
        function CreateCounter(pCounterDesc: PD3D10_COUNTER_DESC; out ppCounter: ID3D10Counter): HResult; stdcall;
        function CheckFormatSupport(Format: TDXGI_FORMAT; out pFormatSupport: UINT): HResult; stdcall;
        function CheckMultisampleQualityLevels(Format: TDXGI_FORMAT; SampleCount: UINT; out pNumQualityLevels: UINT): HResult; stdcall;
        procedure CheckCounterInfo(out pCounterInfo: TD3D10_COUNTER_INFO); stdcall;
        function CheckCounter(const pDesc: PD3D10_COUNTER_DESC; out pType: TD3D10_COUNTER_TYPE; out pActiveCounters: UINT;
            out szName: PAnsiChar; var pNameLength: UINT; out szUnits: PAnsiChar; var pUnitsLength: UINT;
            out szDescription: PAnsiChar; var pDescriptionLength: UINT): HResult; stdcall;
        function GetCreationFlags(): UInt; stdcall;
        function OpenSharedResource(hResource: THANDLE; const ReturnedInterface: TGUID; out ppResource): HResult; stdcall;
        procedure SetTextFilterSize(Width: UINT; Height: UINT); stdcall;
        procedure GetTextFilterSize(out pWidth: UINT; out pHeight: UINT); stdcall;
    end;

    ID3D10Multithread = interface(IUnknown)
        ['{9B7E4E00-342C-4106-A19F-4F2704F689F0}']
        procedure Enter(); stdcall;
        procedure Leave(); stdcall;
        function SetMultithreadProtected(bMTProtect: longbool): longbool; stdcall;
        function GetMultithreadProtected(): longbool; stdcall;
    end;


    TD3D10_CREATE_DEVICE_FLAG = (
        D3D10_CREATE_DEVICE_SINGLETHREADED = $1,
        D3D10_CREATE_DEVICE_DEBUG = $2,
        D3D10_CREATE_DEVICE_SWITCH_TO_REF = $4,
        D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = $8,
        D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP = $10,
        D3D10_CREATE_DEVICE_BGRA_SUPPORT = $20,
        D3D10_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = $80,
        D3D10_CREATE_DEVICE_STRICT_VALIDATION = $200,
        D3D10_CREATE_DEVICE_DEBUGGABLE = $400
        );


const

    D3D10_SHADER_DEBUG = 1 shl 0;
    D3D10_SHADER_SKIP_VALIDATION = 1 shl 1;
    D3D10_SHADER_SKIP_OPTIMIZATION = 1 shl 2;
    D3D10_SHADER_PACK_MATRIX_ROW_MAJOR = 1 shl 3;
    D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR = 1 shl 4;
    D3D10_SHADER_PARTIAL_PRECISION = 1 shl 5;
    D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT = 1 shl 6;
    D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT = 1 shl 7;
    D3D10_SHADER_NO_PRESHADER = 1 shl 8;
    D3D10_SHADER_AVOID_FLOW_CONTROL = 1 shl 9;
    D3D10_SHADER_PREFER_FLOW_CONTROL = 1 shl 10;
    D3D10_SHADER_ENABLE_STRICTNESS = 1 shl 11;
    D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY = 1 shl 12;
    D3D10_SHADER_IEEE_STRICTNESS = 1 shl 13;
    D3D10_SHADER_WARNINGS_ARE_ERRORS = 1 shl 18;
    D3D10_SHADER_RESOURCES_MAY_ALIAS = 1 shl 19;
    D3D10_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES = (1 shl 20);
    D3D10_ALL_RESOURCES_BOUND = (1 shl 21);
    D3D10_SHADER_DEBUG_NAME_FOR_SOURCE = (1 shl 22);
    D3D10_SHADER_DEBUG_NAME_FOR_BINARY = (1 shl 23);


    // optimization level flags
    D3D10_SHADER_OPTIMIZATION_LEVEL0 = 1 shl 14;
    D3D10_SHADER_OPTIMIZATION_LEVEL1 = 0;
    D3D10_SHADER_OPTIMIZATION_LEVEL2 = (1 shl 14) or (1 shl 15);
    D3D10_SHADER_OPTIMIZATION_LEVEL3 = 1 shl 15;

    // Force root signature flags. (Passed in Flags2)
    D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST = 0;
    D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 = (1 shl 4);
    D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 = (1 shl 5);

type
    TD3D10_DRIVER_TYPE = (
        D3D10_DRIVER_TYPE_HARDWARE = 0,
        D3D10_DRIVER_TYPE_REFERENCE = 1,
        D3D10_DRIVER_TYPE_NULL = 2,
        D3D10_DRIVER_TYPE_SOFTWARE = 3,
        D3D10_DRIVER_TYPE_WARP = 5);


    TD3D10_SHADER_MACRO = TD3D_SHADER_MACRO;
    PD3D10_SHADER_MACRO = ^TD3D10_SHADER_MACRO;


    TD3D10_SHADER_VARIABLE_CLASS = TD3D_SHADER_VARIABLE_CLASS;
    LPD3D10_SHADER_VARIABLE_CLASS = ^TD3D10_SHADER_VARIABLE_CLASS;

    TD3D10_SHADER_VARIABLE_FLAGS = TD3D_SHADER_VARIABLE_FLAGS;
    LPD3D10_SHADER_VARIABLE_FLAGS = ^TD3D10_SHADER_VARIABLE_FLAGS;

    TD3D10_SHADER_VARIABLE_TYPE = TD3D_SHADER_VARIABLE_TYPE;
    LPD3D10_SHADER_VARIABLE_TYPE = ^TD3D10_SHADER_VARIABLE_TYPE;

    TD3D10_SHADER_INPUT_FLAGS = TD3D_SHADER_INPUT_FLAGS;
    LPD3D10_SHADER_INPUT_FLAGS = ^TD3D10_SHADER_INPUT_FLAGS;

    TD3D10_SHADER_INPUT_TYPE = TD3D_SHADER_INPUT_TYPE;
    LPD3D10_SHADER_INPUT_TYPE = ^TD3D10_SHADER_INPUT_TYPE;

    TD3D10_SHADER_CBUFFER_FLAGS = TD3D_SHADER_CBUFFER_FLAGS;
    LPD3D10_SHADER_CBUFFER_FLAGS = ^TD3D10_SHADER_CBUFFER_FLAGS;

    TD3D10_CBUFFER_TYPE = TD3D_CBUFFER_TYPE;
    LPD3D10_CBUFFER_TYPE = ^TD3D10_CBUFFER_TYPE;

    TD3D10_NAME = TD3D_NAME;

    TD3D10_RESOURCE_RETURN_TYPE = TD3D_RESOURCE_RETURN_TYPE;

    TD3D10_REGISTER_COMPONENT_TYPE = TD3D_REGISTER_COMPONENT_TYPE;

    TD3D10_INCLUDE_TYPE = TD3D_INCLUDE_TYPE;

    TD3D10_SHADER_DESC = record
        Version: UINT;                     // Shader version
        Creator: PAnsiChar;                // Creator string
        Flags: UINT;                       // Shader compilation/parse flags
        ConstantBuffers: UINT;             // Number of constant buffers
        BoundResources: UINT;              // Number of bound resources
        InputParameters: UINT;             // Number of parameters in the input signature
        OutputParameters: UINT;            // Number of parameters in the output signature
        InstructionCount: UINT;            // Number of emitted instructions
        TempRegisterCount: UINT;           // Number of temporary registers used
        TempArrayCount: UINT;              // Number of temporary arrays used
        DefCount: UINT;                    // Number of constant defines
        DclCount: UINT;                    // Number of declarations (input + output)
        TextureNormalInstructions: UINT;   // Number of non-categorized texture instructions
        TextureLoadInstructions: UINT;     // Number of texture load instructions
        TextureCompInstructions: UINT;     // Number of texture comparison instructions
        TextureBiasInstructions: UINT;     // Number of texture bias instructions
        TextureGradientInstructions: UINT; // Number of texture gradient instructions
        FloatInstructionCount: UINT;       // Number of floating point arithmetic instructions used
        IntInstructionCount: UINT;         // Number of signed integer arithmetic instructions used
        UintInstructionCount: UINT;        // Number of unsigned integer arithmetic instructions used
        StaticFlowControlCount: UINT;      // Number of static flow control instructions used
        DynamicFlowControlCount: UINT;     // Number of dynamic flow control instructions used
        MacroInstructionCount: UINT;       // Number of macro instructions used
        ArrayInstructionCount: UINT;       // Number of array instructions used
        CutInstructionCount: UINT;         // Number of cut instructions used
        EmitInstructionCount: UINT;        // Number of emit instructions used
        GSOutputTopology: TD3D10_PRIMITIVE_TOPOLOGY;           // Geometry shader output topology
        GSMaxOutputVertexCount: UINT;      // Geometry shader maximum output vertex count
    end;

    TD3D10_SHADER_BUFFER_DESC = record
        Name: PAnsiChar;           // Name of the constant buffer
        _Type: TD3D10_CBUFFER_TYPE;           // Indicates that this is a CBuffer or TBuffer
        Variables: UINT;      // Number of member variables
        Size: UINT;           // Size of CB (in bytes)
        uFlags: UINT;         // Buffer description flags
    end;

    TD3D10_SHADER_VARIABLE_DESC = record
        Name: PAnsiChar;           // Name of the variable
        StartOffset: UINT;    // Offset in constant buffer's backing store
        Size: UINT;           // Size of variable (in bytes)
        uFlags: UINT;         // Variable flags
        DefaultValue: pointer;   // Raw pointer to default value
    end;

    TD3D10_SHADER_TYPE_DESC = record
        _Class: TD3D10_SHADER_VARIABLE_CLASS;          // Variable class (e.g. object, matrix, etc.)
        _Type: TD3D10_SHADER_VARIABLE_TYPE;           // Variable type (e.g. float, sampler, etc.)
        Rows: UINT;           // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
        Columns: UINT;        // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
        Elements: UINT;       // Number of elements (0 if not an array)
        Members: UINT;        // Number of members (0 if not a structure)
        Offset: UINT;         // Offset from the start of structure (0 if not a structure member)
    end;

    TD3D10_SHADER_INPUT_BIND_DESC = record
        Name: PAnsiChar;           // Name of the resource
        _Type: TD3D10_SHADER_INPUT_TYPE;           // Type of resource (e.g. texture, cbuffer, etc.)
        BindPoint: UINT;      // Starting bind point
        BindCount: UINT;      // Number of contiguous bind points (for arrays)
        uFlags: UINT;         // Input binding flags
        ReturnType: TD3D10_RESOURCE_RETURN_TYPE;     // Return type (if texture)
        Dimension: TD3D10_SRV_DIMENSION;      // Dimension (if texture)
        NumSamples: UINT;     // Number of samples (0 if not MS texture)
    end;

    TD3D10_SIGNATURE_PARAMETER_DESC = record
        SemanticName: PAnsiChar;   // Name of the semantic
        SemanticIndex: UINT;  // Index of the semantic
        _Register: UINT;       // Number of member variables
        SystemValueType: TD3D10_NAME;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable
        ComponentType: TD3D10_REGISTER_COMPONENT_TYPE;// Scalar type (e.g. uint, float, etc.)
        Mask: byte;           // Mask to indicate which components of the register
        // are used (combination of D3D10_COMPONENT_MASK values)
        ReadWriteMask: byte;  // Mask to indicate whether a given component is
        // never written (if this is an output signature) or
        // always read (if this is an input signature).
        // (combination of D3D10_COMPONENT_MASK values)
    end;


{$IFDEF FPC}
    {$interfaces corba}

    ID3D10ShaderReflectionType = interface
        ['{C530AD7D-9B16-4395-A979-BA2ECFF83ADD}']
        function GetDesc(out pDesc: TD3D10_SHADER_TYPE_DESC): HResult; stdcall;
        function GetMemberTypeByIndex(Index: UINT): ID3D10ShaderReflectionType; stdcall;
        function GetMemberTypeByName(Name: PAnsiChar): ID3D10ShaderReflectionType; stdcall;
        function GetMemberTypeName(Index: UINT): PAnsiChar; stdcall;
    end;

    ID3D10ShaderReflectionVariable = interface
        ['{1BF63C95-2650-405d-99C1-3636BD1DA0A1}']
        function GetDesc(out pDesc: TD3D10_SHADER_VARIABLE_DESC): HResult; stdcall;
        function GetType(): ID3D10ShaderReflectionType; stdcall;
    end;

    ID3D10ShaderReflectionConstantBuffer = interface
        ['{66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0}']
        function GetDesc(out pDesc: TD3D10_SHADER_BUFFER_DESC): HResult; stdcall;
        function GetVariableByIndex(Index: UINT): ID3D10ShaderReflectionVariable; stdcall;
        function GetVariableByName(Name: PAnsiChar): ID3D10ShaderReflectionVariable; stdcall;
    end;

{$interfaces com}
    {$ELSE}

    ID3D10ShaderReflectionType = class // Cannot use 'interface'
        function GetDesc(out pDesc: TD3D10_SHADER_TYPE_DESC): HResult; virtual; stdcall; abstract;
        function GetMemberTypeByIndex(Index: UINT): ID3D10ShaderReflectionType; virtual; stdcall; abstract;
        function GetMemberTypeByName(Name: PAnsiChar): ID3D10ShaderReflectionType; virtual; stdcall; abstract;
        function GetMemberTypeName(Index: UINT): PAnsiChar; virtual; stdcall; abstract;
    end;

    ID3D10ShaderReflectionVariable = class // Cannot use 'interface'
        function GetDesc(out pDesc: TD3D10_SHADER_VARIABLE_DESC): HResult; virtual; stdcall; abstract;
        function GetType(): ID3D10ShaderReflectionType; virtual; stdcall; abstract;
    end;

    ID3D10ShaderReflectionConstantBuffer = class // Cannot use 'interface'
        function GetDesc(out pDesc: TD3D10_SHADER_BUFFER_DESC): HResult; virtual; stdcall; abstract;
        function GetVariableByIndex(Index: UINT): ID3D10ShaderReflectionVariable; virtual; stdcall; abstract;
        function GetVariableByName(Name: PAnsiChar): ID3D10ShaderReflectionVariable; virtual; stdcall; abstract;
    end;

{$ENDIF}

    PID3D10ShaderReflection = ^ID3D10ShaderReflection;
    PID3D10ShaderReflectionType = ^ID3D10ShaderReflectionType;
    PID3D10ShaderReflectionVariable = ^ID3D10ShaderReflectionVariable;

    ID3D10ShaderReflection = interface(IUnknown)
        ['{D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA}']
        function GetDesc(out pDesc: TD3D10_SHADER_DESC): HResult; stdcall;
        function GetConstantBufferByIndex(Index: UINT): ID3D10ShaderReflectionConstantBuffer; stdcall;
        function GetConstantBufferByName(Name: pAnsiChar): ID3D10ShaderReflectionConstantBuffer; stdcall;
        function GetResourceBindingDesc(ResourceIndex: UINT; out pDesc: TD3D10_SHADER_INPUT_BIND_DESC): HResult; stdcall;
        function GetInputParameterDesc(ParameterIndex: UINT; out pDesc: TD3D10_SIGNATURE_PARAMETER_DESC): HResult; stdcall;
        function GetOutputParameterDesc(ParameterIndex: UINT; out pDesc: TD3D10_SIGNATURE_PARAMETER_DESC): HResult; stdcall;
    end;

    // ID3D10Include has been made version-neutral and moved to d3dcommon.h.
    ID3D10Include = ID3DInclude;
    PID3D10INCLUDE = ^ID3DInclude;
// const  IID_ID3DInclude = IID_ID3D10Include;

type

    TD3D10_DEVICE_STATE_TYPES = (

        D3D10_DST_SO_BUFFERS = 1,             // Single-value state (atomical gets/sets)
        D3D10_DST_OM_RENDER_TARGETS,        // Single-value state (atomical gets/sets)
        D3D10_DST_OM_DEPTH_STENCIL_STATE,   // Single-value state
        D3D10_DST_OM_BLEND_STATE,           // Single-value state

        D3D10_DST_VS,                       // Single-value state
        D3D10_DST_VS_SAMPLERS,              // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
        D3D10_DST_VS_SHADER_RESOURCES,      // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
        D3D10_DST_VS_CONSTANT_BUFFERS,      // Count:

        D3D10_DST_GS,                       // Single-value state
        D3D10_DST_GS_SAMPLERS,              // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
        D3D10_DST_GS_SHADER_RESOURCES,      // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
        D3D10_DST_GS_CONSTANT_BUFFERS,      // Count: D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT

        D3D10_DST_PS,                       // Single-value state
        D3D10_DST_PS_SAMPLERS,              // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
        D3D10_DST_PS_SHADER_RESOURCES,      // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
        D3D10_DST_PS_CONSTANT_BUFFERS,      // Count: D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT

        D3D10_DST_IA_VERTEX_BUFFERS,        // Count: D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
        D3D10_DST_IA_INDEX_BUFFER,          // Single-value state
        D3D10_DST_IA_INPUT_LAYOUT,          // Single-value state
        D3D10_DST_IA_PRIMITIVE_TOPOLOGY,    // Single-value state

        D3D10_DST_RS_VIEWPORTS,             // Single-value state (atomical gets/sets)
        D3D10_DST_RS_SCISSOR_RECTS,         // Single-value state (atomical gets/sets)
        D3D10_DST_RS_RASTERIZER_STATE,      // Single-value state

        D3D10_DST_PREDICATION              // Single-value state
        );


    TD3D10_STATE_BLOCK_MASK = record
        VS: byte;
        VSSamplers: array [0..((D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of byte;
        VSShaderResources: array [0..((D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of byte;
        VSConstantBuffers: array [0..((D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of byte;
        GS: byte;
        GSSamplers: array [0..((D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of byte;
        GSShaderResources: array [0..((D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of byte;
        GSConstantBuffers: array [0..((D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of byte;
        PS: byte;
        PSSamplers: array [0..((D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of byte;
        PSShaderResources: array [0..((D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of byte;
        PSConstantBuffers: array [0..((D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of byte;
        IAVertexBuffers: array [0..((D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of byte;
        IAIndexBuffer: byte;
        IAInputLayout: byte;
        IAPrimitiveTopology: byte;
        OMRenderTargets: byte;
        OMDepthStencilState: byte;
        OMBlendState: byte;
        RSViewports: byte;
        RSScissorRects: byte;
        RSRasterizerState: byte;
        SOBuffers: byte;
        Predication: byte;
    end;

    PD3D10_STATE_BLOCK_MASK = ^TD3D10_STATE_BLOCK_MASK;

    ID3D10StateBlock = interface(IUnknown)
        ['{0803425A-57F5-4dd6-9465-A87570834A08}']
        function Capture(): HResult; stdcall;
        function Apply(): HResult; stdcall;
        function ReleaseAllDeviceObjects(): HResult; stdcall;
        function GetDevice(out ppDevice: ID3D10Device): HResult; stdcall;
    end;


    TD3D10_EFFECT_TYPE_DESC = record
        TypeName: PAnsiChar;
        _Class: TD3D10_SHADER_VARIABLE_CLASS;
        _Type: TD3D10_SHADER_VARIABLE_TYPE;
        Elements: UINT;
        Members: UINT;
        Rows: UINT;
        Columns: UINT;
        PackedSize: UINT;
        UnpackedSize: UINT;
        Stride: UINT;
    end;


    TD3D10_EFFECT_VARIABLE_DESC = record
        Name: PAnsiChar;
        Semantic: PAnsiChar;
        Flags: UINT;
        Annotations: UINT;
        BufferOffset: UINT;
        ExplicitBindPoint: UINT;
    end;


    TD3D10_EFFECT_SHADER_DESC = record
        pInputSignature: PByte;
        IsInline: longbool;
        pBytecode: PByte;
        BytecodeLength: UINT;
        SODecl: PAnsiChar;
        NumInputSignatureEntries: UINT;
        NumOutputSignatureEntries: UINT;
    end;


    TD3D10_PASS_DESC = record
        Name: PAnsiChar;
        Annotations: UINT;
        pIAInputSignature: PBYTE;
        IAInputSignatureSize: SIZE_T;
        StencilRef: UINT;
        SampleMask: UINT;
        BlendFactor: array [0..3] of single;
    end;


    TD3D10_TECHNIQUE_DESC = record
        Name: PAnsiChar;                   // Name of this technique (NULL if not anonymous)
        Passes: UINT;                 // Number of passes contained within
        Annotations: UINT;            // Number of annotations on this technique
    end;


    TD3D10_EFFECT_DESC = record
        IsChildEffect: longbool;
        ConstantBuffers: UINT;
        SharedConstantBuffers: UINT;
        GlobalVariables: UINT;
        SharedGlobalVariables: UINT;
        Techniques: UINT;
    end;


    {$IFDEF FPC}
    {$interfaces corba}
    ID3D10EffectScalarVariable = interface;
    ID3D10EffectVectorVariable = interface;
    ID3D10EffectMatrixVariable = interface;
    ID3D10EffectStringVariable = interface;
    ID3D10EffectShaderResourceVariable = interface;
    ID3D10EffectRenderTargetViewVariable = interface;
    ID3D10EffectDepthStencilViewVariable = interface;
    ID3D10EffectConstantBuffer = interface;
    ID3D10EffectBlendVariable = interface;
    ID3D10EffectDepthStencilVariable = interface;
    ID3D10EffectRasterizerVariable = interface;
    ID3D10EffectSamplerVariable = interface;
    ID3D10EffectShaderVariable = interface;

    PID3D10EffectMatrixVariable = ^ID3D10EffectMatrixVariable;

    TD3D10_PASS_SHADER_DESC = record
        pShaderVariable: ID3D10EffectShaderVariable;
        ShaderIndex: UINT;
    end;


    ID3D10EffectType = interface
        ['{4E9E1DDC-CD9D-4772-A837-00180B9B88FD}']
        function IsValid(): longbool; stdcall;
        function GetDesc(out pDesc: TD3D10_EFFECT_TYPE_DESC): HResult; stdcall;
        function GetMemberTypeByIndex(Index: UINT): ID3D10EffectType; stdcall;
        function GetMemberTypeByName(Name: PAnsiChar): ID3D10EffectType; stdcall;
        function GetMemberTypeBySemantic(Semantic: PAnsiChar): ID3D10EffectType; stdcall;
        function GetMemberName(Index: UINT): PAnsiChar; stdcall;
        function GetMemberSemantic(Index: UINT): PAnsiChar; stdcall;
    end;


    ID3D10EffectVariable = interface
        ['{AE897105-00E6-45bf-BB8E-281DD6DB8E1B}']
        function IsValid(): longbool; stdcall;
        function GetType(): ID3D10EffectType; stdcall;
        function GetDesc(out pDesc: TD3D10_EFFECT_VARIABLE_DESC): HResult; stdcall;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; stdcall;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; stdcall;
        function GetMemberByIndex(Index: UINT): ID3D10EffectVariable; stdcall;
        function GetMemberByName(Name: PAnsiChar): ID3D10EffectVariable; stdcall;
        function GetMemberBySemantic(Semantic: PAnsiChar): ID3D10EffectVariable; stdcall;
        function GetElement(Index: UINT): ID3D10EffectVariable; stdcall;
        function GetParentConstantBuffer(): ID3D10EffectConstantBuffer; stdcall;
        function AsScalar(): ID3D10EffectScalarVariable; stdcall;
        function AsVector(): ID3D10EffectVectorVariable; stdcall;
        function AsMatrix(): ID3D10EffectMatrixVariable; stdcall;
        function AsString(): ID3D10EffectStringVariable; stdcall;
        function AsShaderResource(): ID3D10EffectShaderResourceVariable; stdcall;
        function AsRenderTargetView(): ID3D10EffectRenderTargetViewVariable; stdcall;
        function AsDepthStencilView(): ID3D10EffectDepthStencilViewVariable; stdcall;
        function AsConstantBuffer(): ID3D10EffectConstantBuffer; stdcall;
        function AsShader(): ID3D10EffectShaderVariable; stdcall;
        function AsBlend(): ID3D10EffectBlendVariable; stdcall;
        function AsDepthStencil(): ID3D10EffectDepthStencilVariable; stdcall;
        function AsRasterizer(): ID3D10EffectRasterizerVariable; stdcall;
        function AsSampler(): ID3D10EffectSamplerVariable; stdcall;
        function SetRawValue(pData: Pointer; Offset: UINT; ByteCount: UINT): HResult; stdcall;
        function GetRawValue(pData: Pointer; Offset: UINT; ByteCount: UINT): HResult; stdcall;
    end;

    PID3D10EffectVariable = ^ID3D10EffectVariable;


    ID3D10EffectScalarVariable = interface(ID3D10EffectVariable)
        ['{00E48F7B-D2C8-49e8-A86C-022DEE53431F}']
        function SetFloat(Value: single): HResult; stdcall;
        function GetFloat(out pValue: single): HResult; stdcall;
        function SetFloatArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetFloatArray(out pData: Psingle; Offset: UINT; Count: UINT): HResult; stdcall;
        function SetInt(Value: integer): HResult; stdcall;
        function GetInt(out pValue: integer): HResult; stdcall;
        function SetIntArray(pData: PInteger; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetIntArray(out pData: PInteger; Offset: UINT; Count: UINT): HResult; stdcall;
        function SetBool(Value: longbool): HResult; stdcall;
        function GetBool(out pValue: longbool): HResult; stdcall;
        function SetBoolArray(pData: PBoolean; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetBoolArray(out pData: PBOOLean; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    PID3D10EffectScalarVariable = ^ID3D10EffectScalarVariable;


    ID3D10EffectVectorVariable = interface(ID3D10EffectVariable)
        ['{62B98C44-1F82-4c67-BCD0-72CF8F217E81}']
        function SetBoolVector(pData: PBOOLean): HResult; stdcall;
        function SetIntVector(pData: Pinteger): HResult; stdcall;
        function SetFloatVector(pData: Psingle): HResult; stdcall;
        function GetBoolVector(pData: PBOOLean): HResult; stdcall;
        function GetIntVector(pData: PInteger): HResult; stdcall;
        function GetFloatVector(pData: Psingle): HResult; stdcall;
        function SetBoolVectorArray(pData: PBOOLean; Offset: UINT; Count: UINT): HResult; stdcall;
        function SetIntVectorArray(pData: PInteger; Offset: UINT; Count: UINT): HResult; stdcall;
        function SetFloatVectorArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetBoolVectorArray(pData: PBOOLean; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetIntVectorArray(pData: PInteger; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetFloatVectorArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    PID3D10EffectVectorVariable = ^ID3D10EffectVectorVariable;


    ID3D10EffectMatrixVariable = interface(ID3D10EffectVariable)
        ['{50666C24-B82F-4eed-A172-5B6E7E8522E0}']
        function SetMatrix(pData: PSingle): HResult; stdcall;
        function GetMatrix(pData: PSingle): HResult; stdcall;
        function SetMatrixArray(pData: PSingle; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetMatrixArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; stdcall;
        function SetMatrixTranspose(pData: PSingle): HResult; stdcall;
        function GetMatrixTranspose(pData: PSingle): HResult; stdcall;
        function SetMatrixTransposeArray(pData: PSingle; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetMatrixTransposeArray(pData: PSingle; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    //PID3D10EffectMatrixVariable = ^ID3D10EffectMatrixVariable;


    ID3D10EffectStringVariable = interface(ID3D10EffectVariable)
        ['{71417501-8DF9-4e0a-A78A-255F9756BAFF}']
        function GetString(out ppString: PAnsiChar): HResult; stdcall;
        function GetStringArray(ppStrings: PAnsiChar; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    PID3D10EffectStringVariable = ^ID3D10EffectStringVariable;


    ID3D10EffectShaderResourceVariable = interface(ID3D10EffectVariable)
        ['{C0A7157B-D872-4b1d-8073-EFC2ACD4B1FC}']
        function SetResource(pResource: ID3D10ShaderResourceView): HResult; stdcall;
        function GetResource(out ppResource: ID3D10ShaderResourceView): HResult; stdcall;
        function SetResourceArray(ppResources: PID3D10ShaderResourceView; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetResourceArray(out ppResources: PID3D10ShaderResourceView; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    PID3D10EffectShaderResourceVariable = ^ID3D10EffectShaderResourceVariable;


    ID3D10EffectRenderTargetViewVariable = interface(ID3D10EffectVariable)
        ['{28CA0CC3-C2C9-40bb-B57F-67B737122B17}']
        function SetRenderTarget(pResource: ID3D10RenderTargetView): HResult; stdcall;
        function GetRenderTarget(out ppResource: ID3D10RenderTargetView): HResult; stdcall;
        function SetRenderTargetArray(ppResources: PID3D10RenderTargetView; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetRenderTargetArray(out ppResources: PID3D10RenderTargetView; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    PID3D10EffectRenderTargetViewVariable = ^ID3D10EffectRenderTargetViewVariable;


    ID3D10EffectDepthStencilViewVariable = interface(ID3D10EffectVariable)
        ['{3E02C918-CC79-4985-B622-2D92AD701623}']
        function SetDepthStencil(pResource: ID3D10DepthStencilView): HResult; stdcall;
        function GetDepthStencil(out ppResource: ID3D10DepthStencilView): HResult; stdcall;
        function SetDepthStencilArray(ppResources: pID3D10DepthStencilView; Offset: UINT; Count: UINT): HResult; stdcall;
        function GetDepthStencilArray(out ppResources: ID3D10DepthStencilView; Offset: UINT; Count: UINT): HResult; stdcall;
    end;

    PID3D10EffectDepthStencilViewVariable = ^ID3D10EffectDepthStencilViewVariable;


    ID3D10EffectConstantBuffer = interface(ID3D10EffectVariable)
        ['{56648F4D-CC8B-4444-A5AD-B5A3D76E91B3}']
        function SetConstantBuffer(pConstantBuffer: ID3D10Buffer): HResult; stdcall;
        function GetConstantBuffer(out ppConstantBuffer: ID3D10Buffer): HResult; stdcall;
        function SetTextureBuffer(pTextureBuffer: ID3D10ShaderResourceView): HResult; stdcall;
        function GetTextureBuffer(out ppTextureBuffer: ID3D10ShaderResourceView): HResult; stdcall;
    end;

    PID3D10EffectConstantBuffer = ^ID3D10EffectConstantBuffer;


    ID3D10EffectShaderVariable = interface(ID3D10EffectVariable)
        ['{80849279-C799-4797-8C33-0407A07D9E06}']
        function GetShaderDesc(ShaderIndex: UINT; out pDesc: TD3D10_EFFECT_SHADER_DESC): HResult; stdcall;
        function GetVertexShader(ShaderIndex: UINT; out ppVS: ID3D10VertexShader): HResult; stdcall;
        function GetGeometryShader(ShaderIndex: UINT; out ppGS: ID3D10GeometryShader): HResult; stdcall;
        function GetPixelShader(ShaderIndex: UINT; out ppPS: ID3D10PixelShader): HResult; stdcall;
        function GetInputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D10_SIGNATURE_PARAMETER_DESC): HResult; stdcall;
        function GetOutputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D10_SIGNATURE_PARAMETER_DESC): HResult; stdcall;
    end;

    PID3D10EffectShaderVariable = ^ID3D10EffectShaderVariable;


    ID3D10EffectBlendVariable = interface(ID3D10EffectVariable)
        ['{1FCD2294-DF6D-4eae-86B3-0E9160CFB07B}']
        function GetBlendState(Index: UINT; out ppBlendState: ID3D10BlendState): HResult; stdcall;
        function GetBackingStore(Index: UINT; out pBlendDesc: TD3D10_BLEND_DESC): HResult; stdcall;
    end;

    PID3D10EffectBlendVariable = ^ID3D10EffectBlendVariable;


    ID3D10EffectDepthStencilVariable = interface(ID3D10EffectVariable)
        ['{AF482368-330A-46a5-9A5C-01C71AF24C8D}']
        function GetDepthStencilState(Index: UINT; out ppDepthStencilState: ID3D10DepthStencilState): HResult; stdcall;
        function GetBackingStore(Index: UINT; out pDepthStencilDesc: TD3D10_DEPTH_STENCIL_DESC): HResult; stdcall;
    end;

    PID3D10EffectDepthStencilVariable = ^ID3D10EffectDepthStencilVariable;


    ID3D10EffectRasterizerVariable = interface(ID3D10EffectVariable)
        ['{21AF9F0E-4D94-4ea9-9785-2CB76B8C0B34}']
        function GetRasterizerState(Index: UINT; out ppRasterizerState: ID3D10RasterizerState): HResult; stdcall;
        function GetBackingStore(Index: UINT; out pRasterizerDesc: TD3D10_RASTERIZER_DESC): HResult; stdcall;
    end;

    PID3D10EffectRasterizerVariable = ^ID3D10EffectRasterizerVariable;

    ID3D10EffectSamplerVariable = interface(ID3D10EffectVariable)
        ['{6530D5C7-07E9-4271-A418-E7CE4BD1E480}']
        function GetSampler(Index: UINT; out ppSampler: ID3D10SamplerState): HResult; stdcall;
        function GetBackingStore(Index: UINT; out pSamplerDesc: TD3D10_SAMPLER_DESC): HResult; stdcall;
    end;

    PID3D10EffectSamplerVariable = ^ID3D10EffectSamplerVariable;


    ID3D10EffectPass = interface
        ['{5CFBEB89-1A06-46e0-B282-E3F9BFA36A54}']
        function IsValid(): longbool; stdcall;
        function GetDesc(out pDesc: TD3D10_PASS_DESC): HResult; stdcall;
        function GetVertexShaderDesc(out pDesc: TD3D10_PASS_SHADER_DESC): HResult; stdcall;
        function GetGeometryShaderDesc(out pDesc: TD3D10_PASS_SHADER_DESC): HResult; stdcall;
        function GetPixelShaderDesc(out pDesc: TD3D10_PASS_SHADER_DESC): HResult; stdcall;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; stdcall;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; stdcall;
        function Apply(Flags: UINT): HResult; stdcall;
        function ComputeStateBlockMask(out pStateBlockMask: TD3D10_STATE_BLOCK_MASK): HResult; stdcall;
    end;

    PID3D10EffectPass = ^ID3D10EffectPass;


    ID3D10EffectTechnique = interface
        ['{DB122CE8-D1C9-4292-B237-24ED3DE8B175}']
        function IsValid(): longbool; stdcall;
        function GetDesc(var pDesc: TD3D10_TECHNIQUE_DESC): HResult; stdcall;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; stdcall;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; stdcall;
        function GetPassByIndex(Index: UINT): ID3D10EffectPass; stdcall;
        function GetPassByName(Name: PAnsiChar): ID3D10EffectPass; stdcall;
        function ComputeStateBlockMask(out pStateBlockMask: TD3D10_STATE_BLOCK_MASK): HResult; stdcall;
    end;

    PID3D10EffectTechnique = ^ID3D10EffectTechnique;


    {$interfaces com}
    {$ELSE}

    ID3D10EffectScalarVariable = class;
    ID3D10EffectVectorVariable = class;
    ID3D10EffectMatrixVariable = class;
    ID3D10EffectStringVariable = class;
    ID3D10EffectShaderResourceVariable = class;
    ID3D10EffectRenderTargetViewVariable = class;
    ID3D10EffectDepthStencilViewVariable = class;
    ID3D10EffectConstantBuffer = class;
    ID3D10EffectBlendVariable = class;
    ID3D10EffectDepthStencilVariable = class;
    ID3D10EffectRasterizerVariable = class;
    ID3D10EffectSamplerVariable = class;
    ID3D10EffectShaderVariable = class;

    TD3D10_PASS_SHADER_DESC = record
        pShaderVariable: ID3D10EffectShaderVariable;
        ShaderIndex: UINT;
    end;




    ID3D10EffectType = class // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function IsValid(): longbool; virtual; stdcall; abstract;
        function GetDesc(out pDesc: TD3D10_EFFECT_TYPE_DESC): HResult; virtual; stdcall; abstract;
        function GetMemberTypeByIndex(Index: UINT): ID3D10EffectType; virtual; stdcall; abstract;
        function GetMemberTypeByName(Name: PAnsiChar): ID3D10EffectType; virtual; stdcall; abstract;
        function GetMemberTypeBySemantic(Semantic: PAnsiChar): ID3D10EffectType; virtual; stdcall; abstract;
        function GetMemberName(Index: UINT): PAnsiChar; virtual; stdcall; abstract;
        function GetMemberSemantic(Index: UINT): PAnsiChar; virtual; stdcall; abstract;
    end;


    ID3D10EffectVariable = class // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function IsValid(): longbool; virtual; stdcall; abstract;
        function GetType(): ID3D10EffectType; virtual; stdcall; abstract;
        function GetDesc(out pDesc: TD3D10_EFFECT_VARIABLE_DESC): HResult; virtual; stdcall; abstract;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetMemberByIndex(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetMemberByName(Name: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetMemberBySemantic(Semantic: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetElement(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetParentConstantBuffer(): ID3D10EffectConstantBuffer; virtual; stdcall; abstract;
        function AsScalar(): ID3D10EffectScalarVariable; virtual; stdcall; abstract;
        function AsVector(): ID3D10EffectVectorVariable; virtual; stdcall; abstract;
        function AsMatrix(): ID3D10EffectMatrixVariable; virtual; stdcall; abstract;
        function AsString(): ID3D10EffectStringVariable; virtual; stdcall; abstract;
        function AsShaderResource(): ID3D10EffectShaderResourceVariable; virtual; stdcall; abstract;
        function AsRenderTargetView(): ID3D10EffectRenderTargetViewVariable; virtual; stdcall; abstract;
        function AsDepthStencilView(): ID3D10EffectDepthStencilViewVariable; virtual; stdcall; abstract;
        function AsConstantBuffer(): ID3D10EffectConstantBuffer; virtual; stdcall; abstract;
        function AsShader(): ID3D10EffectShaderVariable; virtual; stdcall; abstract;
        function AsBlend(): ID3D10EffectBlendVariable; virtual; stdcall; abstract;
        function AsDepthStencil(): ID3D10EffectDepthStencilVariable; virtual; stdcall; abstract;
        function AsRasterizer(): ID3D10EffectRasterizerVariable; virtual; stdcall; abstract;
        function AsSampler(): ID3D10EffectSamplerVariable; virtual; stdcall; abstract;
        function SetRawValue(pData: Pointer; Offset: UINT; ByteCount: UINT): HResult; virtual; stdcall; abstract;
        function GetRawValue(pData: Pointer; Offset: UINT; ByteCount: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectVariable = ^ID3D10EffectVariable;


    ID3D10EffectScalarVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function SetFloat(Value: single): HResult; virtual; stdcall; abstract;
        function GetFloat(out pValue: single): HResult; virtual; stdcall; abstract;
        function SetFloatArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetFloatArray(out pData: Psingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function SetInt(Value: integer): HResult; virtual; stdcall; abstract;
        function GetInt(out pValue: integer): HResult; virtual; stdcall; abstract;
        function SetIntArray(pData: PInteger; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetIntArray(out pData: PInteger; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function SetBool(Value: longbool): HResult; virtual; stdcall; abstract;
        function GetBool(out pValue: longbool): HResult; virtual; stdcall; abstract;
        function SetBoolArray(pData: PBoolean; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetBoolArray(out pData: PBOOLean; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectScalarVariable = ^ID3D10EffectScalarVariable;


    ID3D10EffectVectorVariable = class(ID3D10EffectVariable) // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function SetBoolVector(pData: PBOOLean): HResult; virtual; stdcall; abstract;
        function SetIntVector(pData: Pinteger): HResult; virtual; stdcall; abstract;
        function SetFloatVector(pData: Psingle): HResult; virtual; stdcall; abstract;
        function GetBoolVector(pData: PBOOLean): HResult; virtual; stdcall; abstract;
        function GetIntVector(pData: PInteger): HResult; virtual; stdcall; abstract;
        function GetFloatVector(pData: Psingle): HResult; virtual; stdcall; abstract;
        function SetBoolVectorArray(pData: PBOOLean; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function SetIntVectorArray(pData: PInteger; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function SetFloatVectorArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetBoolVectorArray(pData: PBOOLean; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetIntVectorArray(pData: PInteger; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetFloatVectorArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectVectorVariable = ^ID3D10EffectVectorVariable;


    ID3D10EffectMatrixVariable = class {(ID3D10EffectVariable)}
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function IsValid(): longbool; virtual; stdcall; abstract;
        function GetType(): ID3D10EffectType; virtual; stdcall; abstract;
        function GetDesc(out pDesc: TD3D10_EFFECT_VARIABLE_DESC): HResult; virtual; stdcall; abstract;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetMemberByIndex(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetMemberByName(Name: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetMemberBySemantic(Semantic: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetElement(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetParentConstantBuffer(): ID3D10EffectConstantBuffer; virtual; stdcall; abstract;
        function AsScalar(): ID3D10EffectScalarVariable; virtual; stdcall; abstract;
        function AsVector(): ID3D10EffectVectorVariable; virtual; stdcall; abstract;
        function AsMatrix(): ID3D10EffectMatrixVariable; virtual; stdcall; abstract;
        function AsString(): ID3D10EffectStringVariable; virtual; stdcall; abstract;
        function AsShaderResource(): ID3D10EffectShaderResourceVariable; virtual; stdcall; abstract;
        function AsRenderTargetView(): ID3D10EffectRenderTargetViewVariable; virtual; stdcall; abstract;
        function AsDepthStencilView(): ID3D10EffectDepthStencilViewVariable; virtual; stdcall; abstract;
        function AsConstantBuffer(): ID3D10EffectConstantBuffer; virtual; stdcall; abstract;
        function AsShader(): ID3D10EffectShaderVariable; virtual; stdcall; abstract;
        function AsBlend(): ID3D10EffectBlendVariable; virtual; stdcall; abstract;
        function AsDepthStencil(): ID3D10EffectDepthStencilVariable; virtual; stdcall; abstract;
        function AsRasterizer(): ID3D10EffectRasterizerVariable; virtual; stdcall; abstract;
        function AsSampler(): ID3D10EffectSamplerVariable; virtual; stdcall; abstract;
        function SetRawValue(pData: Pointer; Offset: UINT; ByteCount: UINT): HResult; virtual; stdcall; abstract;
        function GetRawValue(pData: Pointer; Offset: UINT; ByteCount: UINT): HResult; virtual; stdcall; abstract;

        function SetMatrix(pData: PSingle): HResult; virtual; stdcall; abstract;
        function GetMatrix(out pData: PSingle): HResult; virtual; stdcall; abstract;
        function SetMatrixArray(pData: PSingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetMatrixArray(pData: Psingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function SetMatrixTranspose(pData: PSingle): HResult; virtual; stdcall; abstract;
        function GetMatrixTranspose(pData: PSingle): HResult; virtual; stdcall; abstract;
        function SetMatrixTransposeArray(pData: PSingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetMatrixTransposeArray(pData: PSingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectMatrixVariable = ^ID3D10EffectMatrixVariable;


    ID3D10EffectStringVariable = class(ID3D10EffectVariable) // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function GetString(out ppString: PAnsiChar): HResult; virtual; stdcall; abstract;
        function GetStringArray(ppStrings: PAnsiChar; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectStringVariable = ^ID3D10EffectStringVariable;


    ID3D10EffectShaderResourceVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function SetResource(pResource: ID3D10ShaderResourceView): HResult; virtual; stdcall; abstract;
        function GetResource(out ppResource: ID3D10ShaderResourceView): HResult; virtual; stdcall; abstract;
        function SetResourceArray(ppResources: PID3D10ShaderResourceView; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetResourceArray(out ppResources: PID3D10ShaderResourceView; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectShaderResourceVariable = ^ID3D10EffectShaderResourceVariable;


    ID3D10EffectRenderTargetViewVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function SetRenderTarget(pResource: ID3D10RenderTargetView): HResult; virtual; stdcall; abstract;
        function GetRenderTarget(out ppResource: ID3D10RenderTargetView): HResult; virtual; stdcall; abstract;
        function SetRenderTargetArray(ppResources: PID3D10RenderTargetView; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetRenderTargetArray(out ppResources: PID3D10RenderTargetView; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectRenderTargetViewVariable = ^ID3D10EffectRenderTargetViewVariable;


    ID3D10EffectDepthStencilViewVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function SetDepthStencil(pResource: ID3D10DepthStencilView): HResult; virtual; stdcall; abstract;
        function GetDepthStencil(out ppResource: ID3D10DepthStencilView): HResult; virtual; stdcall; abstract;
        function SetDepthStencilArray(ppResources: pID3D10DepthStencilView; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
        function GetDepthStencilArray(out ppResources: ID3D10DepthStencilView; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectDepthStencilViewVariable = ^ID3D10EffectDepthStencilViewVariable;


    ID3D10EffectConstantBuffer = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function SetConstantBuffer(pConstantBuffer: ID3D10Buffer): HResult; virtual; stdcall; abstract;
        function GetConstantBuffer(out ppConstantBuffer: ID3D10Buffer): HResult; virtual; stdcall; abstract;
        function SetTextureBuffer(pTextureBuffer: ID3D10ShaderResourceView): HResult; virtual; stdcall; abstract;
        function GetTextureBuffer(out ppTextureBuffer: ID3D10ShaderResourceView): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectConstantBuffer = ^ID3D10EffectConstantBuffer;


    ID3D10EffectShaderVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function GetShaderDesc(ShaderIndex: UINT; out pDesc: TD3D10_EFFECT_SHADER_DESC): HResult; virtual; stdcall; abstract;
        function GetVertexShader(ShaderIndex: UINT; out ppVS: ID3D10VertexShader): HResult; virtual; stdcall; abstract;
        function GetGeometryShader(ShaderIndex: UINT; out ppGS: ID3D10GeometryShader): HResult; virtual; stdcall; abstract;
        function GetPixelShader(ShaderIndex: UINT; out ppPS: ID3D10PixelShader): HResult; virtual; stdcall; abstract;
        function GetInputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D10_SIGNATURE_PARAMETER_DESC): HResult;
            virtual; stdcall; abstract;
        function GetOutputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D10_SIGNATURE_PARAMETER_DESC): HResult;
            virtual; stdcall; abstract;
    end;

    PID3D10EffectShaderVariable = ^ID3D10EffectShaderVariable;


    ID3D10EffectBlendVariable = class(ID3D10EffectVariable)  // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function GetBlendState(Index: UINT; out ppBlendState: ID3D10BlendState): HResult; virtual; stdcall; abstract;
        function GetBackingStore(Index: UINT; out pBlendDesc: TD3D10_BLEND_DESC): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectBlendVariable = ^ID3D10EffectBlendVariable;


    ID3D10EffectDepthStencilVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function GetDepthStencilState(Index: UINT; out ppDepthStencilState: ID3D10DepthStencilState): HResult; virtual; stdcall; abstract;
        function GetBackingStore(Index: UINT; out pDepthStencilDesc: TD3D10_DEPTH_STENCIL_DESC): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectDepthStencilVariable = ^ID3D10EffectDepthStencilVariable;


    ID3D10EffectRasterizerVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function GetRasterizerState(Index: UINT; out ppRasterizerState: ID3D10RasterizerState): HResult; virtual; stdcall; abstract;
        function GetBackingStore(Index: UINT; out pRasterizerDesc: TD3D10_RASTERIZER_DESC): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectRasterizerVariable = ^ID3D10EffectRasterizerVariable;

    ID3D10EffectSamplerVariable = class(ID3D10EffectVariable)
        // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function GetSampler(Index: UINT; out ppSampler: ID3D10SamplerState): HResult; virtual; stdcall; abstract;
        function GetBackingStore(Index: UINT; out pSamplerDesc: TD3D10_SAMPLER_DESC): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectSamplerVariable = ^ID3D10EffectSamplerVariable;


    ID3D10EffectPass = class // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function IsValid(): longbool; virtual; stdcall; abstract;
        function GetDesc(out pDesc: TD3D10_PASS_DESC): HResult; virtual; stdcall; abstract;
        function GetVertexShaderDesc(out pDesc: TD3D10_PASS_SHADER_DESC): HResult; virtual; stdcall; abstract;
        function GetGeometryShaderDesc(out pDesc: TD3D10_PASS_SHADER_DESC): HResult; virtual; stdcall; abstract;
        function GetPixelShaderDesc(out pDesc: TD3D10_PASS_SHADER_DESC): HResult; virtual; stdcall; abstract;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function Apply(Flags: UINT): HResult; virtual; stdcall; abstract;
        function ComputeStateBlockMask(out pStateBlockMask: TD3D10_STATE_BLOCK_MASK): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectPass = ^ID3D10EffectPass;


    ID3D10EffectTechnique = class // Cannot use 'interface' as the QueryInterface, AddRef and Release methods are missing.
        function IsValid(): longbool; virtual; stdcall; abstract;
        function GetDesc(out pDesc: TD3D10_TECHNIQUE_DESC): HResult; virtual; stdcall; abstract;
        function GetAnnotationByIndex(Index: UINT): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetAnnotationByName(Name: PAnsiChar): ID3D10EffectVariable; virtual; stdcall; abstract;
        function GetPassByIndex(Index: UINT): ID3D10EffectPass; virtual; stdcall; abstract;
        function GetPassByName(Name: PAnsiChar): ID3D10EffectPass; virtual; stdcall; abstract;
        function ComputeStateBlockMask(out pStateBlockMask: TD3D10_STATE_BLOCK_MASK): HResult; virtual; stdcall; abstract;
    end;

    PID3D10EffectTechnique = ^ID3D10EffectTechnique;

    {$ENDIF}


    ID3D10Effect = interface(IUnknown)
        ['{DB122CE8-D1C9-4292-B237-24ED3DE8B175}']
        function IsValid(): longbool; stdcall;
        function IsPool(): longbool; stdcall;
        function GetDevice(out ppDevice: ID3D10Device): HResult; stdcall;
        function GetDesc(out pDesc: TD3D10_EFFECT_DESC): HResult; stdcall;
        function GetConstantBufferByIndex(Index: UINT): ID3D10EffectConstantBuffer; stdcall;
        function GetConstantBufferByName(Name: PAnsiChar): ID3D10EffectConstantBuffer; stdcall;
        function GetVariableByIndex(Index: UINT): ID3D10EffectVariable; stdcall;
        function GetVariableByName(Name: PAnsiChar): ID3D10EffectVariable; stdcall;
        function GetVariableBySemantic(Semantic: PAnsiChar): ID3D10EffectVariable; stdcall;
        function GetTechniqueByIndex(Index: UINT): ID3D10EffectTechnique; stdcall;
        function GetTechniqueByName(Name: PAnsiChar): ID3D10EffectTechnique; stdcall;
        function Optimize(): HResult; stdcall;
        function IsOptimized(): longbool; stdcall;
    end;

    PID3D10Effect = ^ID3D10Effect;


    ID3D10EffectPool = interface(IUnknown)
        ['{9537AB04-3250-412e-8213-FCD2F8677933}']
        function AsEffect(): ID3D10Effect; stdcall;
        // No public methods
    end;


    { D3D10SDKLayers.h}

    TD3D10_MESSAGE_CATEGORY = (

        D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
        D3D10_MESSAGE_CATEGORY_MISCELLANEOUS = (D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1),
        D3D10_MESSAGE_CATEGORY_INITIALIZATION = (D3D10_MESSAGE_CATEGORY_MISCELLANEOUS + 1),
        D3D10_MESSAGE_CATEGORY_CLEANUP = (D3D10_MESSAGE_CATEGORY_INITIALIZATION + 1),
        D3D10_MESSAGE_CATEGORY_COMPILATION = (D3D10_MESSAGE_CATEGORY_CLEANUP + 1),
        D3D10_MESSAGE_CATEGORY_STATE_CREATION = (D3D10_MESSAGE_CATEGORY_COMPILATION + 1),
        D3D10_MESSAGE_CATEGORY_STATE_SETTING = (D3D10_MESSAGE_CATEGORY_STATE_CREATION + 1),
        D3D10_MESSAGE_CATEGORY_STATE_GETTING = (D3D10_MESSAGE_CATEGORY_STATE_SETTING + 1),
        D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = (D3D10_MESSAGE_CATEGORY_STATE_GETTING + 1),
        D3D10_MESSAGE_CATEGORY_EXECUTION = (D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1),
        D3D10_MESSAGE_CATEGORY_SHADER = (D3D10_MESSAGE_CATEGORY_EXECUTION + 1)
        );

    PD3D10_MESSAGE_CATEGORY = ^TD3D10_MESSAGE_CATEGORY;

    TD3D10_MESSAGE_SEVERITY = (
        D3D10_MESSAGE_SEVERITY_CORRUPTION = 0,
        D3D10_MESSAGE_SEVERITY_ERROR = (D3D10_MESSAGE_SEVERITY_CORRUPTION + 1),
        D3D10_MESSAGE_SEVERITY_WARNING = (D3D10_MESSAGE_SEVERITY_ERROR + 1),
        D3D10_MESSAGE_SEVERITY_INFO = (D3D10_MESSAGE_SEVERITY_WARNING + 1),
        D3D10_MESSAGE_SEVERITY_MESSAGE = (D3D10_MESSAGE_SEVERITY_INFO + 1)
        );

    PD3D10_MESSAGE_SEVERITY = ^TD3D10_MESSAGE_SEVERITY;

    TD3D10_MESSAGE_ID = (
        D3D10_MESSAGE_ID_UNKNOWN = 0,
        D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = (D3D10_MESSAGE_ID_UNKNOWN + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = (D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = (D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = (D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = (D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = (D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = (D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = (D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = (D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1),
        D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = (D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1),
        D3D10_MESSAGE_ID_STRING_FROM_APPLICATION = (D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1),
        D3D10_MESSAGE_ID_CORRUPTED_THIS = (D3D10_MESSAGE_ID_STRING_FROM_APPLICATION + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 = (D3D10_MESSAGE_ID_CORRUPTED_THIS + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1),
        D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING = (D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1),
        D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = (D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1),
        D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = (D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = (D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1),
        D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = (D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1),
        D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = (D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1),
        D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = (D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1),
        D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = (D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1),
        D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = (D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = (D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = (D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = (D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC = (D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = (D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = (D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = (D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = (D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = (D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = (D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = (D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = (D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = (D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = (D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = (D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = (D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = (D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = (D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = (D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1),
        D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = (D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = (D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = (D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1),
        D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1),
        D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = (D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1),
        D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = (D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = (D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC =
        (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1),
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1),
        D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1),
        D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = (D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1),
        D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = (D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1),
        D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = (D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = (D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED =
        (D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1),
        D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = (D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = (D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1),
        D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = (D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = (D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = (D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = (D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1),
        D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1),
        D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = (D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1),
        D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = (D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = (D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = (D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1),
        D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = (D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = (D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = (D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1),
        D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = (D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1),
        D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = (D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1),
        D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = (D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1),
        D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1),
        D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = (D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1),
        D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = (D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1),
        D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = (D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1),
        D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE =
        (D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = (D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1),
        D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = (D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1),
        D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = (D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1),
        D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = (D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = (D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = (D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = (D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1),
        D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = (D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1),
        D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = (D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = (D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1),
        D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = (D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1),
        D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID =
        (D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1),
        D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID =
        (D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1),
        D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = (D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1),
        D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = (D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1),
        D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = (D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1),
        D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = (D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1),
        D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = (D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1),
        D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = (D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1),
        D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = (D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = (D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = (D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = (D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = (D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = (D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = (D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1),
        D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = (D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = (D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = (D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = (D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = (D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = (D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = (D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1),
        D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = (D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = (D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = (D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = (D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = (D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = (D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = (D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1),
        D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = (D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1),
        D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = (D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1),
        D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = (D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1),
        D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = (D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1),
        D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1),
        D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = (D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = (D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1),
        D3D10_MESSAGE_ID_REF_THREADING_MODE = (D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1),
        D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = (D3D10_MESSAGE_ID_REF_THREADING_MODE + 1),
        D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = (D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1),
        D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION = (D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1),
        D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = (D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1),
        D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = (D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1),
        D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY = (D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1),
        D3D10_MESSAGE_ID_REF_INFO = (D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = (D3D10_MESSAGE_ID_REF_INFO + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = (D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = (D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = (D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = (D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1),
        D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = (D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1),
        D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = (D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1),
        D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = (D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1),
        D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = (D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1),
        D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = (D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = (D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = (D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = (D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = (D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = (D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = (D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = (D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = (D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = (D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = (D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = (D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = (D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = (D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = (D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = (D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 =
        (D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1),
        D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT =
        (D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1),
        D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = (D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1),
        D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = (D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1),
        D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = (D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1),
        D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1),
        D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = (D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = (D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = (D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1),
        D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC =
        (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1),
        D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH =
        (D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1),
        D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = (D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1),
        D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = (D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = (D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = (D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1),
        D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1),
        D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = (D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1),
        D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1),
        D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = (D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = (D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1),
        D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER =
        (D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1),
        D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = (D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1),
        D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = (D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1),
        D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC = (D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1),
        D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = (D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1),
        D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = (D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1),
        D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = (D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1),
        D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = (D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1),
        D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = (D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = (D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1),
        D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = (D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1),
        D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = (D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1),
        D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = (D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1),
        D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = (D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1),
        D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = (D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1),
        D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = (D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1),
        D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = (D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = (D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = (D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN =
        (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE =
        (D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = (D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = (D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1),
        D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1),
        D3D10_MESSAGE_ID_LIVE_OBJECT_SUMMARY = (D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1),
        D3D10_MESSAGE_ID_LIVE_BUFFER = (D3D10_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1),
        D3D10_MESSAGE_ID_LIVE_TEXTURE1D = (D3D10_MESSAGE_ID_LIVE_BUFFER + 1),
        D3D10_MESSAGE_ID_LIVE_TEXTURE2D = (D3D10_MESSAGE_ID_LIVE_TEXTURE1D + 1),
        D3D10_MESSAGE_ID_LIVE_TEXTURE3D = (D3D10_MESSAGE_ID_LIVE_TEXTURE2D + 1),
        D3D10_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = (D3D10_MESSAGE_ID_LIVE_TEXTURE3D + 1),
        D3D10_MESSAGE_ID_LIVE_RENDERTARGETVIEW = (D3D10_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1),
        D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = (D3D10_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1),
        D3D10_MESSAGE_ID_LIVE_VERTEXSHADER = (D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1),
        D3D10_MESSAGE_ID_LIVE_GEOMETRYSHADER = (D3D10_MESSAGE_ID_LIVE_VERTEXSHADER + 1),
        D3D10_MESSAGE_ID_LIVE_PIXELSHADER = (D3D10_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1),
        D3D10_MESSAGE_ID_LIVE_INPUTLAYOUT = (D3D10_MESSAGE_ID_LIVE_PIXELSHADER + 1),
        D3D10_MESSAGE_ID_LIVE_SAMPLER = (D3D10_MESSAGE_ID_LIVE_INPUTLAYOUT + 1),
        D3D10_MESSAGE_ID_LIVE_BLENDSTATE = (D3D10_MESSAGE_ID_LIVE_SAMPLER + 1),
        D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = (D3D10_MESSAGE_ID_LIVE_BLENDSTATE + 1),
        D3D10_MESSAGE_ID_LIVE_RASTERIZERSTATE = (D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1),
        D3D10_MESSAGE_ID_LIVE_QUERY = (D3D10_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1),
        D3D10_MESSAGE_ID_LIVE_PREDICATE = (D3D10_MESSAGE_ID_LIVE_QUERY + 1),
        D3D10_MESSAGE_ID_LIVE_COUNTER = (D3D10_MESSAGE_ID_LIVE_PREDICATE + 1),
        D3D10_MESSAGE_ID_LIVE_DEVICE = (D3D10_MESSAGE_ID_LIVE_COUNTER + 1),
        D3D10_MESSAGE_ID_LIVE_SWAPCHAIN = (D3D10_MESSAGE_ID_LIVE_DEVICE + 1),
        D3D10_MESSAGE_ID_D3D10_MESSAGES_END = (D3D10_MESSAGE_ID_LIVE_SWAPCHAIN + 1),
        D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START = $100000,
        D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = (D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = (D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1),
        D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1),
        D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = (D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = (D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = (D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = (D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = (D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = (D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = (D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1),
        D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = (D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1),
        D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = (D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1),
        D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = (D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1),
        D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = (D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1),
        D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = (D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1),
        D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = (D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = (D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = (D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = (D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1),
        D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = (D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = (D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1),
        D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1),
        D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE =
        (D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = (D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1),
        D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES =
        (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = (D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = (D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = (D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE =
        (D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE =
        (D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = (D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = (D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = (D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1),
        D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = (D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1),
        D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = (D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = (D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = (D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = (D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1),
        D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = (D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1),
        D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = (D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = (D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1),
        D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = (D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION =
        (D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED =
        (D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1),
        D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR =
        (D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1),
        D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = (D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1),
        D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = (D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1),
        D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = (D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1),
        D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = (D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1),
        D3D10_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES = (D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1),
        D3D10_MESSAGE_ID_D3D10L9_MESSAGES_END = (D3D10_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES + 1)
        );

    PD3D10_MESSAGE_ID = ^TD3D10_MESSAGE_ID;

    TD3D10_MESSAGE = record
        Category: TD3D10_MESSAGE_CATEGORY;
        Severity: TD3D10_MESSAGE_SEVERITY;
        ID: TD3D10_MESSAGE_ID;
        pDescription: PChar;
        DescriptionByteLength: SIZE_T;
    end;
    PD3D10_MESSAGE = ^TD3D10_MESSAGE;

    TD3D10_INFO_QUEUE_FILTER_DESC = record
        NumCategories: UINT;
        pCategoryList: PD3D10_MESSAGE_CATEGORY;
        NumSeverities: UINT;
        pSeverityList: PD3D10_MESSAGE_SEVERITY;
        NumIDs: UINT;
        pIDList: PD3D10_MESSAGE_ID;
    end;

    PD3D10_INFO_QUEUE_FILTER_DESC = ^TD3D10_INFO_QUEUE_FILTER_DESC;

    TD3D10_INFO_QUEUE_FILTER = record
        AllowList: TD3D10_INFO_QUEUE_FILTER_DESC;
        DenyList: TD3D10_INFO_QUEUE_FILTER_DESC;
    end;
    PD3D10_INFO_QUEUE_FILTER = ^TD3D10_INFO_QUEUE_FILTER;


    ID3D10Debug = interface(IUnknown)
        ['{9B7E4E01-342C-4106-A19F-4F2704F689F0}']
        function SetFeatureMask(Mask: UINT): HResult; stdcall;
        function GetFeatureMask(): UINT; stdcall;
        function SetPresentPerRenderOpDelay(Milliseconds: UINT): HResult; stdcall;
        function GetPresentPerRenderOpDelay(): UINT; stdcall;
        function SetSwapChain(pSwapChain: IDXGISwapChain): HResult; stdcall;
        function GetSwapChain(out ppSwapChain: IDXGISwapChain): HResult; stdcall;
        function Validate(): HResult; stdcall;
    end;


    ID3D10SwitchToRef = interface(IUnknown)
        ['{9B7E4E02-342C-4106-A19F-4F2704F689F0}']
        function SetUseRef(UseRef: longbool): longbool; stdcall;
        function GetUseRef(): longbool; stdcall;
    end;

    ID3D10InfoQueue = interface(IUnknown)
        ['{1b940b17-2642-4d1f-ab1f-b99bad0c395f}']
        function SetMessageCountLimit(MessageCountLimit: UINT64): HResult; stdcall;
        procedure ClearStoredMessages(); stdcall;
        function GetMessage(MessageIndex: UINT64; out pMessage: PD3D10_MESSAGE; var pMessageByteLength: SIZE_T): HResult; stdcall;
        function GetNumMessagesAllowedByStorageFilter(): UINT64; stdcall;
        function GetNumMessagesDeniedByStorageFilter(): UINT64; stdcall;
        function GetNumStoredMessages(): UINT64; stdcall;
        function GetNumStoredMessagesAllowedByRetrievalFilter(): UINT64; stdcall;
        function GetNumMessagesDiscardedByMessageCountLimit(): UINT64; stdcall;
        function GetMessageCountLimit(): UINT64; stdcall;
        function AddStorageFilterEntries(pFilter: PD3D10_INFO_QUEUE_FILTER): HResult; stdcall;
        function GetStorageFilter(out pFilter: PD3D10_INFO_QUEUE_FILTER; var pFilterByteLength: SIZE_T): HResult; stdcall;
        procedure ClearStorageFilter(); stdcall;
        function PushEmptyStorageFilter(): HResult; stdcall;
        function PushCopyOfStorageFilter(): HResult; stdcall;
        function PushStorageFilter(pFilter: PD3D10_INFO_QUEUE_FILTER): HResult; stdcall;
        procedure PopStorageFilter(); stdcall;
        function GetStorageFilterStackSize(): UINT; stdcall;
        function AddRetrievalFilterEntries(pFilter: PD3D10_INFO_QUEUE_FILTER): HResult; stdcall;
        function GetRetrievalFilter(out pFilter: PD3D10_INFO_QUEUE_FILTER; var pFilterByteLength: SIZE_T): HResult; stdcall;
        procedure ClearRetrievalFilter(); stdcall;
        function PushEmptyRetrievalFilter(): HResult; stdcall;
        function PushCopyOfRetrievalFilter(): HResult; stdcall;
        function PushRetrievalFilter(pFilter: PD3D10_INFO_QUEUE_FILTER): HResult; stdcall;
        procedure PopRetrievalFilter(); stdcall;
        function GetRetrievalFilterStackSize(): UINT; stdcall;
        function AddMessage(Category: TD3D10_MESSAGE_CATEGORY; Severity: TD3D10_MESSAGE_SEVERITY; ID: TD3D10_MESSAGE_ID;
            pDescription: PAnsiChar): HResult; stdcall;
        function AddApplicationMessage(Severity: TD3D10_MESSAGE_SEVERITY; pDescription: PAnsiChar): HResult; stdcall;
        function SetBreakOnCategory(Category: TD3D10_MESSAGE_CATEGORY; bEnable: longbool): HResult; stdcall;
        function SetBreakOnSeverity(Severity: TD3D10_MESSAGE_SEVERITY; bEnable: longbool): HResult; stdcall;
        function SetBreakOnID(ID: TD3D10_MESSAGE_ID; bEnable: longbool): HResult; stdcall;
        function GetBreakOnCategory(Category: TD3D10_MESSAGE_CATEGORY): longbool; stdcall;
        function GetBreakOnSeverity(Severity: TD3D10_MESSAGE_SEVERITY): longbool; stdcall;
        function GetBreakOnID(ID: TD3D10_MESSAGE_ID): longbool; stdcall;
        procedure SetMuteDebugOutput(bMute: longbool); stdcall;
        function GetMuteDebugOutput(): longbool; stdcall;
    end;


function D3D10CreateDevice(pAdapter: IDXGIAdapter; DriverType: TD3D10_DRIVER_TYPE; Software: HMODULE; Flags: UINT;
    SDKVersion: UINT; out ppDevice: ID3D10Device): HResult; stdcall; external DLL_D3D10;

function D3D10CreateDeviceAndSwapChain(pAdapter: IDXGIAdapter; DriverType: TD3D10_DRIVER_TYPE; Software: HMODULE;
    Flags: UINT; SDKVersion: UINT; pSwapChainDesc: PDXGI_SWAP_CHAIN_DESC; out ppSwapChain: IDXGISwapChain;
    out ppDevice: ID3D10Device): HResult; stdcall; external DLL_D3D10;

function D3D10CreateBlob(NumBytes: SIZE_T; out ppBuffer: ID3D10BLOB): HResult; stdcall; external DLL_D3D10;


function D3D10CompileShader(pSrcData: pAnsiChar; SrcDataSize: SIZE_T; pFileName: pAnsiChar; const pDefines: PD3D10_SHADER_MACRO;
    pInclude: PID3D10INCLUDE; pFunctionName: pAnsiChar; pProfile: pAnsiChar; Flags: UINT; out ppShader: ID3D10Blob;
    out ppErrorMsgs: ID3D10Blob): HResult; stdcall; external DLL_D3D10;
function D3D10DisassembleShader(const pShader: pointer; BytecodeLength: SIZE_T; EnableColorCode: longbool;
    pComments: pAnsiChar; out ppDisassembly: ID3D10Blob): HResult; stdcall; external DLL_D3D10;

function D3D10GetPixelShaderProfile(pDevice: ID3D10Device): PAnsiChar; stdcall; external DLL_D3D10;
function D3D10GetVertexShaderProfile(pDevice: ID3D10Device): PAnsiChar; stdcall; external DLL_D3D10;
function D3D10GetGeometryShaderProfile(pDevice: ID3D10Device): PAnsiChar; stdcall; external DLL_D3D10;
function D3D10ReflectShader(const pShaderBytecode: pointer; BytecodeLength: SIZE_T; out ppReflector: ID3D10ShaderReflection): HResult;
    stdcall; external DLL_D3D10;
function D3D10PreprocessShader(pSrcData: LPCSTR; SrcDataSize: SIZE_T; pFileName: LPCSTR; const pDefines: PD3D10_SHADER_MACRO;
    pInclude: PID3D10INCLUDE; out ppShaderText: ID3D10Blob; out ppErrorMsgs: ID3D10Blob): HResult; stdcall; external DLL_D3D10;
function D3D10GetInputSignatureBlob(const pShaderBytecode: pointer; BytecodeLength: SIZE_T; out ppSignatureBlob: ID3D10Blob): HResult;
    stdcall; external DLL_D3D10;
function D3D10GetOutputSignatureBlob(const pShaderBytecode: pointer; BytecodeLength: SIZE_T; out ppSignatureBlob: ID3D10Blob): HResult;
    stdcall; external DLL_D3D10;
function D3D10GetInputAndOutputSignatureBlob(const pShaderBytecode: pointer; BytecodeLength: SIZE_T; out ppSignatureBlob: ID3D10Blob): HResult;
    stdcall; external DLL_D3D10;
function D3D10GetShaderDebugInfo(const pShaderBytecode: pointer; BytecodeLength: SIZE_T; out ppDebugInfo: ID3D10Blob): HResult;
    stdcall; external DLL_D3D10;


function D3D10CompileEffectFromMemory(pData: Pointer; DataLength: SIZE_T; pSrcFileName: PAnsiChar; pDefines: PD3D10_SHADER_MACRO;
    pInclude: ID3D10Include; HLSLFlags: UINT; FXFlags: UINT; out ppCompiledEffect: ID3D10Blob; out ppErrors: ID3D10Blob): HResult;
    stdcall; external DLL_D3D10;

function D3D10CreateEffectFromMemory(pData: Pointer; DataLength: SIZE_T; FXFlags: UINT; pDevice: ID3D10Device;
    pEffectPool: ID3D10EffectPool; out ppEffect: ID3D10Effect): HResult; stdcall; external DLL_D3D10;

function D3D10CreateEffectPoolFromMemory(pData: Pointer; DataLength: SIZE_T; FXFlags: UINT; pDevice: ID3D10Device;
    out ppEffectPool: ID3D10EffectPool): HResult; stdcall; external DLL_D3D10;


function D3D10DisassembleEffect(pEffect: ID3D10Effect; EnableColorCode: longbool; out ppDisassembly: ID3D10Blob): HResult;
    stdcall; external DLL_D3D10;


function D3D10StateBlockMaskUnion(pA: PD3D10_STATE_BLOCK_MASK; pB: PD3D10_STATE_BLOCK_MASK; out pResult: TD3D10_STATE_BLOCK_MASK): HResult;
    stdcall; external DLL_D3D10;
function D3D10StateBlockMaskIntersect(pA: pD3D10_STATE_BLOCK_MASK; pB: PD3D10_STATE_BLOCK_MASK; out pResult: TD3D10_STATE_BLOCK_MASK): HResult;
    stdcall; external DLL_D3D10;
function D3D10StateBlockMaskDifference(pA: PD3D10_STATE_BLOCK_MASK; pB: PD3D10_STATE_BLOCK_MASK; out pResult: TD3D10_STATE_BLOCK_MASK): HResult;
    stdcall; external DLL_D3D10;
function D3D10StateBlockMaskEnableCapture(var pMask: TD3D10_STATE_BLOCK_MASK; StateType: TD3D10_DEVICE_STATE_TYPES;
    RangeStart: UINT; RangeLength: UINT): HResult; stdcall; external DLL_D3D10;
function D3D10StateBlockMaskDisableCapture(var pMask: TD3D10_STATE_BLOCK_MASK; StateType: TD3D10_DEVICE_STATE_TYPES;
    RangeStart: UINT; RangeLength: UINT): HResult; stdcall; external DLL_D3D10;
function D3D10StateBlockMaskEnableAll(out pMask: TD3D10_STATE_BLOCK_MASK): HResult; stdcall; external DLL_D3D10;
function D3D10StateBlockMaskDisableAll(out pMask: TD3D10_STATE_BLOCK_MASK): HResult; stdcall; external DLL_D3D10;
function D3D10StateBlockMaskGetSetting(pMask: PD3D10_STATE_BLOCK_MASK; StateType: TD3D10_DEVICE_STATE_TYPES; Entry: UINT): longbool;
    stdcall; external DLL_D3D10;
function D3D10CreateStateBlock(pDevice: ID3D10Device; pStateBlockMask: pD3D10_STATE_BLOCK_MASK; out ppStateBlock: ID3D10StateBlock): HResult;
    stdcall; external DLL_D3D10;


function D3D10CalcSubresource(MipSlice: UINT; ArraySlice: UINT; MipLevels: UINT): UINT;

function D3D10_TX_VERSION(_Major, _Minor: byte): DWORD;

implementation



function D3D10CalcSubresource(MipSlice: UINT; ArraySlice: UINT; MipLevels: UINT): UINT;
begin
    Result := MipSlice + ArraySlice * MipLevels;
end;



function D3D10_TX_VERSION(_Major, _Minor: byte): DWORD;
begin
    // #define D3D10_TX_VERSION(_Major,_Minor) (('T'  shl  24) | ('X'  shl  16) | ((_Major)  shl  8) | (_Minor))
    Result := (Ord('T') shl 24) or (Ord('X') shl 16) or (_Major shl 8) or _Minor;

end;

{ TD3D10_INPUT_ELEMENT_DESC }

procedure TD3D10_INPUT_ELEMENT_DESC.Init;
begin
    ZeroMemory(@Self, SizeOf(TD3D10_INPUT_ELEMENT_DESC));
end;



procedure TD3D10_INPUT_ELEMENT_DESC.Init(ASemanticName: PAnsiChar; ASemanticIndex: UINT; AFormat: TDXGI_FORMAT;
    AInputSlot: UINT; AAlignedByteOffset: UINT; AInputSlotClass: TD3D10_INPUT_CLASSIFICATION; AInstanceDataStepRate: UINT);
begin
    SemanticName := ASemanticName;
    SemanticIndex := ASemanticIndex;
    Format := AFormat;
    InputSlot := AInputSlot;
    AlignedByteOffset := AAlignedByteOffset;
    InputSlotClass := AInputSlotClass;
    InstanceDataStepRate := AInstanceDataStepRate;
end;



procedure TD3D10_BUFFER_DESC.Init(AByteWidth: UINT; ABindFlags: UINT; AUsage: TD3D10_USAGE = D3D10_USAGE_DEFAULT;
    ACPUAccessFlags: UINT = 0; AMiscFlags: UINT = 0);
begin
    ByteWidth := AbyteWidth;
    Usage := Ausage;
    BindFlags := AbindFlags;
    CPUAccessFlags := AcpuaccessFlags;
    MiscFlags := AmiscFlags;
end;



procedure TD3D10_TEXTURE1D_DESC.Init(AFormat: TDXGI_FORMAT; Awidth: UINT; AarraySize: UINT = 1; AmipLevels: UINT = 0;
    ABindFlags: UINT = Ord(D3D10_BIND_SHADER_RESOURCE); AUsage: TD3D10_USAGE = D3D10_USAGE_DEFAULT; AcpuaccessFlags: UINT = 0;
    AmiscFlags: UINT = 0);
begin
    Width := Width;
    MipLevels := mipLevels;
    ArraySize := arraySize;
    Format := format;
    Usage := usage;
    BindFlags := bindFlags;
    CPUAccessFlags := cpuaccessFlags;
    MiscFlags := miscFlags;
end;



procedure TD3D10_TEXTURE2D_DESC.Init(AFormat: TDXGI_FORMAT; Awidth: UINT; AHeight: UINT; AarraySize: UINT;
    AmipLevels: UINT; AbindFlags: UINT; AUsage: TD3D10_USAGE; AcpuaccessFlags: UINT; ASampleCount: UINT = 1;
    ASampleQuality: UINT = 0; AmiscFlags: UINT = 0);
begin
    Width := Awidth;
    Height := Aheight;
    MipLevels := AmipLevels;
    ArraySize := AarraySize;
    Format := Aformat;
    SampleDesc.Count := AsampleCount;
    SampleDesc.Quality := AsampleQuality;
    Usage := Ausage;
    BindFlags := AbindFlags;
    CPUAccessFlags := AcpuaccessFlags;
    MiscFlags := AmiscFlags;
end;


{ TD3D10_TEXTURE3D_DESC }

procedure TD3D10_TEXTURE3D_DESC.Init(Aformat: TDXGI_FORMAT; Awidth: UINT; Aheight: UINT; Adepth: UINT; AmipLevels: UINT;
    AbindFlags: UINT; Ausage: TD3D10_USAGE; AcpuaccessFlags: UINT; AmiscFlags: UINT);
begin
    Width := Awidth;
    Height := Aheight;
    Depth := Adepth;
    MipLevels := AmipLevels;
    Format := Aformat;
    Usage := Ausage;
    BindFlags := AbindFlags;
    CPUAccessFlags := AcpuaccessFlags;
    MiscFlags := AmiscFlags;
end;

end.
