Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 98.54 KB | None | 0 0
  1. {******************************************************************************}
  2. {*                                                                            *}
  3. {*  Copyright (C) Microsoft Corporation.  All Rights Reserved.                *}
  4. {*                                                                            *}
  5. {*  Files:      D3DX11.h                              *}
  6. {*  Content:    D3DX11 include files                                          *}
  7. {*                                                                            *}
  8. {*  DirectX Delphi / FreePascal adaptation by Alexey Barkovoy                 *}
  9. {*  E-Mail: directx@clootie.ru                                                *}
  10. {*                                                                            *}
  11. {*  Latest version can be downloaded from:                                    *}
  12. {*    http://www.clootie.ru                                                   *}
  13. {*    http://sourceforge.net/projects/delphi-dx9sdk                           *}
  14. {*                                                                            *}
  15. {*----------------------------------------------------------------------------*}
  16. {*  $Id: $ }
  17. {******************************************************************************}
  18.  
  19. // Original source contained in "Winapi.D3DX11.par"
  20.  
  21. unit Winapi.D3DX11;
  22.  
  23. {$ALIGN ON}
  24. {$MINENUMSIZE 4}
  25. {$WEAKPACKAGEUNIT}
  26. {$WARN SYMBOL_PLATFORM OFF}
  27.  
  28. interface
  29.  
  30. {$HPPEMIT '#include "D3DX10.h"'}
  31. {$HPPEMIT '#include "D3DX11.h"'}
  32. {$HPPEMIT '#include "d3dtypes.h"'}
  33. {$HPPEMIT '#include "d3dcommon.h"'}
  34. {$HPPEMIT '#include "d3d11shader.h"'}
  35.  
  36. uses
  37.   Winapi.Windows,Winapi.DxgiFormat, Winapi.D3D11, Winapi.D3DCommon, Winapi.D3D11Shader;
  38.  
  39. type
  40.   PHResult = ^HRESULT;
  41.  
  42.   {$REGION 'DX11'}
  43.  
  44. const
  45.   //////////// DLL export definitions ///////////////////////////////////////
  46.   d3dx11_retail_DLL = 'd3dx11_43.dll';
  47.   d3dx11_debug_DLL = 'd3dx11d_43.dll';
  48.   d3dx11dll = d3dx11_retail_DLL;
  49.  
  50. //////////////////////////////////////////////////////////////////////////////
  51. //
  52. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  53. //
  54. //  File:       d3dx11.h
  55. //  Content:    D3DX11 utility library
  56. //
  57. //////////////////////////////////////////////////////////////////////////////
  58.  
  59. // Defines
  60.  
  61. const
  62.   D3DX11_DEFAULT            = -1;
  63.   {$EXTERNALSYM D3DX11_DEFAULT}
  64.   D3DX11_FROM_FILE          = -3;
  65.   {$EXTERNALSYM D3DX11_FROM_FILE}
  66.   DXGI_FORMAT_FROM_FILE     = DXGI_FORMAT(-3);
  67.   {$EXTERNALSYM DXGI_FORMAT_FROM_FILE}
  68.  
  69. // Errors
  70. const
  71.   _FACDD  = $876;
  72.   {$EXTERNALSYM _FACDD}
  73.  
  74. // #define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
  75. function MAKE_DDHRESULT(Code: DWord): DWord; inline;
  76. {$EXTERNALSYM MAKE_DDHRESULT}
  77.  
  78.  
  79. type
  80.   _D3DX11_ERR = DWORD;
  81.   {$EXTERNALSYM _D3DX11_ERR}
  82.  
  83. const
  84.   MAKE_DDHRESULT_R     = (1 shl 31) or (_FACDD shl 16);
  85.  
  86. const
  87.   D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER       = HResult(MAKE_DDHRESULT_R or 2900);
  88.   {$EXTERNALSYM D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER}
  89.   D3DX11_ERR_INVALID_MESH                     = HResult(MAKE_DDHRESULT_R or 2901);
  90.   {$EXTERNALSYM D3DX11_ERR_INVALID_MESH}
  91.   D3DX11_ERR_CANNOT_ATTR_SORT                 = HResult(MAKE_DDHRESULT_R or 2902);
  92.   {$EXTERNALSYM D3DX11_ERR_CANNOT_ATTR_SORT}
  93.   D3DX11_ERR_SKINNING_NOT_SUPPORTED           = HResult(MAKE_DDHRESULT_R or 2903);
  94.   {$EXTERNALSYM D3DX11_ERR_SKINNING_NOT_SUPPORTED}
  95.   D3DX11_ERR_TOO_MANY_INFLUENCES              = HResult(MAKE_DDHRESULT_R or 2904);
  96.   {$EXTERNALSYM D3DX11_ERR_TOO_MANY_INFLUENCES}
  97.   D3DX11_ERR_INVALID_DATA                     = HResult(MAKE_DDHRESULT_R or 2905);
  98.   {$EXTERNALSYM D3DX11_ERR_INVALID_DATA}
  99.   D3DX11_ERR_LOADED_MESH_HAS_NO_DATA          = HResult(MAKE_DDHRESULT_R or 2906);
  100.   {$EXTERNALSYM D3DX11_ERR_LOADED_MESH_HAS_NO_DATA}
  101.   D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT         = HResult(MAKE_DDHRESULT_R or 2907);
  102.   {$EXTERNALSYM D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT}
  103.   D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM              = HResult(MAKE_DDHRESULT_R or 2908);
  104.   {$EXTERNALSYM D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM}
  105.  
  106.  
  107. ///////////////////////////////////////////////////////////////////////////
  108. //
  109. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  110. //
  111. //  File:       d3dx11core.h
  112. //  Content:    D3DX11 core types and functions
  113. //
  114. ///////////////////////////////////////////////////////////////////////////
  115.  
  116. // Current name of the DLL shipped in the same SDK as this header.
  117. const
  118.   D3DX11_DLL_W = d3dx11_retail_DLL;
  119.   {$EXTERNALSYM D3DX11_DLL_W}
  120.   D3DX11_DLL_A = d3dx11_retail_DLL;
  121.   {$EXTERNALSYM D3DX11_DLL_A}
  122.   D3DX11_DLL = d3dx11_retail_DLL;
  123.   {$EXTERNALSYM D3DX11_DLL}
  124.  
  125.  
  126. ///////////////////////////////////////////////////////////////////////////
  127. // D3DX11_SDK_VERSION:
  128. // -----------------
  129. // This identifier is passed to D3DX11CheckVersion in order to ensure that an
  130. // application was built against the correct header files and lib files.
  131. // This number is incremented whenever a header (or other) change would
  132. // require applications to be rebuilt. If the version doesn't match,
  133. // D3DX11CreateVersion will return FALSE. (The number itself has no meaning.)
  134. ///////////////////////////////////////////////////////////////////////////
  135.  
  136. const
  137.   D3DX11_SDK_VERSION = 43;
  138.   {$EXTERNALSYM D3DX11_SDK_VERSION}
  139.  
  140. function D3DX11CheckVersion(D3DSdkVersion: UINT; D3DX11SdkVersion: UINT): HResult; stdcall; external d3dx11dll delayed;
  141. {$EXTERNALSYM D3DX11CheckVersion}
  142.  
  143. //////////////////////////////////////////////////////////////////////////////
  144. // ID3DX11ThreadPump:
  145. //////////////////////////////////////////////////////////////////////////////
  146.  
  147. type
  148.   {$EXTERNALSYM ID3DX11DataLoader}
  149.  
  150.   ID3DX11DataLoader = class
  151.     function Load(): HResult; virtual; stdcall; abstract;
  152.     function Decompress(ppData: PPointer; pcBytes: PSIZE_T): HResult; virtual; stdcall; abstract;
  153.     {$WARNINGS OFF}
  154.     function Destroy(): HResult; virtual; stdcall; abstract;
  155.     {$WARNINGS ON}
  156.   end;
  157.  
  158.  
  159.  
  160.   {$EXTERNALSYM ID3DX11DataProcessor}
  161.  
  162.   ID3DX11DataProcessor = class
  163.     function Process(pData: Pointer; cBytes: SIZE_T): HResult; virtual; stdcall; abstract;
  164.     function CreateDeviceObject(out ppDataObject: Pointer): HResult; virtual; stdcall; abstract;
  165.     {$WARNINGS OFF}
  166.     function Destroy(): HResult; virtual; stdcall; abstract;
  167.     {$WARNINGS ON}
  168.   end;
  169.  
  170.  
  171.  
  172.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DX11ThreadPump);'}
  173.   {$EXTERNALSYM ID3DX11ThreadPump}
  174.   ID3DX11ThreadPump = interface (IUnknown)
  175.     ['{C93FECFA-6967-478a-ABBC-402D90621FCB}']
  176.     // ID3DX11ThreadPump
  177.     function AddWorkItem(const pDataLoader: ID3DX11DataLoader; const pDataProcessor: ID3DX11DataProcessor; pHResult: PHRESULT; ppDeviceObject: PPointer): HResult; stdcall;
  178.     function GetWorkItemCount(): UINT; stdcall;
  179.  
  180.     function WaitForAllItems(): HResult; stdcall;
  181.     function ProcessDeviceWorkItems(iWorkItemCount: UINT): HResult; stdcall;
  182.  
  183.  
  184.     function PurgeAllItems(): HResult; stdcall;
  185.     function GetQueueStatus(pIoQueue: PUINT; pProcessQueue: PUINT; pDeviceQueue: PUINT): HResult; stdcall;
  186.   end;
  187.  
  188.  
  189. function D3DX11CreateThreadPump(cIoThreads: UINT; cProcThreads: UINT; out ppThreadPump: ID3DX11ThreadPump): HResult; stdcall; external d3dx11dll delayed;
  190. {$EXTERNALSYM D3DX11CreateThreadPump}
  191.  
  192.  
  193. const
  194.   _FACD3D = $876;
  195.   {$EXTERNALSYM _FACD3D}
  196.  
  197. // #define MAKE_D3DHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )
  198. function MAKE_D3DHRESULT(Code: DWord): DWord;
  199. {$EXTERNALSYM MAKE_D3DHRESULT}
  200. // #define MAKE_D3DSTATUS( code )  MAKE_HRESULT( 0, _FACD3D, code )
  201. function MAKE_D3DSTATUS(Code: DWord): DWord;
  202. {$EXTERNALSYM MAKE_D3DSTATUS}
  203.  
  204. const
  205.   MAKE_D3DHRESULT_R     = (1 shl 31) or (_FACD3D shl 16);
  206.   {$EXTERNALSYM MAKE_D3DHRESULT_R}
  207.  
  208. const
  209.   D3DERR_INVALIDCALL                          = HResult(MAKE_D3DHRESULT_R or 2156);
  210.   {$EXTERNALSYM D3DERR_INVALIDCALL}
  211.   D3DERR_WASSTILLDRAWING                      = HResult(MAKE_D3DHRESULT_R or 540);
  212.   {$EXTERNALSYM D3DERR_WASSTILLDRAWING}
  213.  
  214.  
  215. //////////////////////////////////////////////////////////////////////////////
  216. //
  217. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  218. //
  219. //  File:       d3dx11tex.h
  220. //  Content:    D3DX11 texturing APIs
  221. //
  222. //////////////////////////////////////////////////////////////////////////////
  223.  
  224. //----------------------------------------------------------------------------
  225. // D3DX11_FILTER flags:
  226. // ------------------
  227. //
  228. // A valid filter must contain one of these values:
  229. //
  230. //  D3DX11_FILTER_NONE
  231. //      No scaling or filtering will take place.  Pixels outside the bounds
  232. //      of the source image are assumed to be transparent black.
  233. //  D3DX11_FILTER_POINT
  234. //      Each destination pixel is computed by sampling the nearest pixel
  235. //      from the source image.
  236. //  D3DX11_FILTER_LINEAR
  237. //      Each destination pixel is computed by linearly interpolating between
  238. //      the nearest pixels in the source image.  This filter works best
  239. //      when the scale on each axis is less than 2.
  240. //  D3DX11_FILTER_TRIANGLE
  241. //      Every pixel in the source image contributes equally to the
  242. //      destination image.  This is the slowest of all the filters.
  243. //  D3DX11_FILTER_BOX
  244. //      Each pixel is computed by averaging a 2x2(x2) box pixels from
  245. //      the source image. Only works when the dimensions of the
  246. //      destination are half those of the source. (as with mip maps)
  247. //
  248. // And can be OR'd with any of these optional flags:
  249. //
  250. //  D3DX11_FILTER_MIRROR_U
  251. //      Indicates that pixels off the edge of the texture on the U-axis
  252. //      should be mirrored, not wraped.
  253. //  D3DX11_FILTER_MIRROR_V
  254. //      Indicates that pixels off the edge of the texture on the V-axis
  255. //      should be mirrored, not wraped.
  256. //  D3DX11_FILTER_MIRROR_W
  257. //      Indicates that pixels off the edge of the texture on the W-axis
  258. //      should be mirrored, not wraped.
  259. //  D3DX11_FILTER_MIRROR
  260. //      Same as specifying D3DX11_FILTER_MIRROR_U | D3DX11_FILTER_MIRROR_V |
  261. //      D3DX11_FILTER_MIRROR_V
  262. //  D3DX11_FILTER_DITHER
  263. //      Dithers the resulting image using a 4x4 order dither pattern.
  264. //  D3DX11_FILTER_SRGB_IN
  265. //      Denotes that the input data is in sRGB (gamma 2.2) colorspace.
  266. //  D3DX11_FILTER_SRGB_OUT
  267. //      Denotes that the output data is in sRGB (gamma 2.2) colorspace.
  268. //  D3DX11_FILTER_SRGB
  269. //      Same as specifying D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT
  270. //
  271. //----------------------------------------------------------------------------
  272.  
  273. type
  274.   D3DX11_FILTER_FLAG = Cardinal;
  275.   {$EXTERNALSYM D3DX11_FILTER_FLAG}
  276.  
  277. const
  278.   D3DX11_FILTER_NONE            = (1 shl 0);
  279.   {$EXTERNALSYM D3DX11_FILTER_NONE}
  280.   D3DX11_FILTER_POINT           = (2 shl 0);
  281.   {$EXTERNALSYM D3DX11_FILTER_POINT}
  282.   D3DX11_FILTER_LINEAR          = (3 shl 0);
  283.   {$EXTERNALSYM D3DX11_FILTER_LINEAR}
  284.   D3DX11_FILTER_TRIANGLE        = (4 shl 0);
  285.   {$EXTERNALSYM D3DX11_FILTER_TRIANGLE}
  286.   D3DX11_FILTER_BOX             = (5 shl 0);
  287.   {$EXTERNALSYM D3DX11_FILTER_BOX}
  288.  
  289.   D3DX11_FILTER_MIRROR_U        = (1 shl 16);
  290.   {$EXTERNALSYM D3DX11_FILTER_MIRROR_U}
  291.   D3DX11_FILTER_MIRROR_V        = (2 shl 16);
  292.   {$EXTERNALSYM D3DX11_FILTER_MIRROR_V}
  293.   D3DX11_FILTER_MIRROR_W        = (4 shl 16);
  294.   {$EXTERNALSYM D3DX11_FILTER_MIRROR_W}
  295.   D3DX11_FILTER_MIRROR          = (7 shl 16);
  296.   {$EXTERNALSYM D3DX11_FILTER_MIRROR}
  297.  
  298.   D3DX11_FILTER_DITHER          = (1 shl 19);
  299.   {$EXTERNALSYM D3DX11_FILTER_DITHER}
  300.   D3DX11_FILTER_DITHER_DIFFUSION= (2 shl 19);
  301.   {$EXTERNALSYM D3DX11_FILTER_DITHER_DIFFUSION}
  302.  
  303.   D3DX11_FILTER_SRGB_IN         = (1 shl 21);
  304.   {$EXTERNALSYM D3DX11_FILTER_SRGB_IN}
  305.   D3DX11_FILTER_SRGB_OUT        = (2 shl 21);
  306.   {$EXTERNALSYM D3DX11_FILTER_SRGB_OUT}
  307.   D3DX11_FILTER_SRGB            = (3 shl 21);
  308.   {$EXTERNALSYM D3DX11_FILTER_SRGB}
  309.  
  310. //----------------------------------------------------------------------------
  311. // D3DX11_NORMALMAP flags:
  312. // ---------------------
  313. // These flags are used to control how D3DX11ComputeNormalMap generates normal
  314. // maps.  Any number of these flags may be OR'd together in any combination.
  315. //
  316. //  D3DX11_NORMALMAP_MIRROR_U
  317. //      Indicates that pixels off the edge of the texture on the U-axis
  318. //      should be mirrored, not wraped.
  319. //  D3DX11_NORMALMAP_MIRROR_V
  320. //      Indicates that pixels off the edge of the texture on the V-axis
  321. //      should be mirrored, not wraped.
  322. //  D3DX11_NORMALMAP_MIRROR
  323. //      Same as specifying D3DX11_NORMALMAP_MIRROR_U | D3DX11_NORMALMAP_MIRROR_V
  324. //  D3DX11_NORMALMAP_INVERTSIGN
  325. //      Inverts the direction of each normal
  326. //  D3DX11_NORMALMAP_COMPUTE_OCCLUSION
  327. //      Compute the per pixel Occlusion term and encodes it into the alpha.
  328. //      An Alpha of 1 means that the pixel is not obscured in anyway, and
  329. //      an alpha of 0 would mean that the pixel is completly obscured.
  330. //
  331. //----------------------------------------------------------------------------
  332.  
  333. type
  334.   D3DX11_NORMALMAP_FLAG = Cardinal;
  335.   {$EXTERNALSYM D3DX11_NORMALMAP_FLAG}
  336.  
  337. const
  338.   D3DX11_NORMALMAP_MIRROR_U          = (1 shl 16);
  339.   {$EXTERNALSYM D3DX11_NORMALMAP_MIRROR_U}
  340.   D3DX11_NORMALMAP_MIRROR_V          = (2 shl 16);
  341.   {$EXTERNALSYM D3DX11_NORMALMAP_MIRROR_V}
  342.   D3DX11_NORMALMAP_MIRROR            = (3 shl 16);
  343.   {$EXTERNALSYM D3DX11_NORMALMAP_MIRROR}
  344.   D3DX11_NORMALMAP_INVERTSIGN        = (8 shl 16);
  345.   {$EXTERNALSYM D3DX11_NORMALMAP_INVERTSIGN}
  346.   D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 shl 16);
  347.   {$EXTERNALSYM D3DX11_NORMALMAP_COMPUTE_OCCLUSION}
  348.  
  349.  
  350. //----------------------------------------------------------------------------
  351. // D3DX11_CHANNEL flags:
  352. // -------------------
  353. // These flags are used by functions which operate on or more channels
  354. // in a texture.
  355. //
  356. // D3DX11_CHANNEL_RED
  357. //     Indicates the red channel should be used
  358. // D3DX11_CHANNEL_BLUE
  359. //     Indicates the blue channel should be used
  360. // D3DX11_CHANNEL_GREEN
  361. //     Indicates the green channel should be used
  362. // D3DX11_CHANNEL_ALPHA
  363. //     Indicates the alpha channel should be used
  364. // D3DX11_CHANNEL_LUMINANCE
  365. //     Indicates the luminaces of the red green and blue channels should be
  366. //     used.
  367. //
  368. //----------------------------------------------------------------------------
  369.  
  370. type
  371.   D3DX11_CHANNEL_FLAG = Cardinal;
  372.   {$EXTERNALSYM D3DX11_CHANNEL_FLAG}
  373.  
  374. const
  375.   D3DX11_CHANNEL_RED           = (1 shl 0);
  376.   {$EXTERNALSYM D3DX11_CHANNEL_RED}
  377.   D3DX11_CHANNEL_BLUE          = (1 shl 1);
  378.   {$EXTERNALSYM D3DX11_CHANNEL_BLUE}
  379.   D3DX11_CHANNEL_GREEN         = (1 shl 2);
  380.   {$EXTERNALSYM D3DX11_CHANNEL_GREEN}
  381.   D3DX11_CHANNEL_ALPHA         = (1 shl 3);
  382.   {$EXTERNALSYM D3DX11_CHANNEL_ALPHA}
  383.   D3DX11_CHANNEL_LUMINANCE     = (1 shl 4);
  384.   {$EXTERNALSYM D3DX11_CHANNEL_LUMINANCE}
  385.  
  386.  
  387. //----------------------------------------------------------------------------
  388. // D3DX11_IMAGE_FILE_FORMAT:
  389. // ---------------------
  390. // This enum is used to describe supported image file formats.
  391. //
  392. //----------------------------------------------------------------------------
  393.  
  394. type
  395.   PD3DX11ImageFileFormat = ^TD3DX11ImageFileFormat;
  396.   D3DX11_IMAGE_FILE_FORMAT =
  397.    (
  398.     D3DX11_IFF_BMP      = 0,
  399.     D3DX11_IFF_JPG      = 1,
  400.     D3DX11_IFF_PNG      = 3,
  401.     D3DX11_IFF_DDS      = 4,
  402.     D3DX11_IFF_TIFF       = 10,
  403.     D3DX11_IFF_GIF        = 11,
  404.     D3DX11_IFF_WMP        = 12,
  405.     D3DX11_IFF_FORCE_DWORD = $7fffffff
  406.    );
  407.   {$EXTERNALSYM D3DX11_IMAGE_FILE_FORMAT}
  408.   TD3DX11ImageFileFormat = D3DX11_IMAGE_FILE_FORMAT;
  409.  
  410.  
  411. //----------------------------------------------------------------------------
  412. // D3DX11_SAVE_TEXTURE_FLAG:
  413. // ---------------------
  414. // This enum is used to support texture saving options.
  415. //
  416. //----------------------------------------------------------------------------
  417.  
  418. type
  419.   D3DX11_SAVE_TEXTURE_FLAG = Cardinal;
  420.   {$EXTERNALSYM D3DX11_SAVE_TEXTURE_FLAG}
  421.  
  422. const
  423.   D3DX11_STF_USEINPUTBLOB      = $0001;
  424.   {$EXTERNALSYM D3DX11_STF_USEINPUTBLOB}
  425.  
  426.  
  427. //----------------------------------------------------------------------------
  428. // D3DX11_IMAGE_INFO:
  429. // ---------------
  430. // This structure is used to return a rough description of what the
  431. // the original contents of an image file looked like.
  432. //
  433. //  Width
  434. //      Width of original image in pixels
  435. //  Height
  436. //      Height of original image in pixels
  437. //  Depth
  438. //      Depth of original image in pixels
  439. //  ArraySize
  440. //      Array size in textures
  441. //  MipLevels
  442. //      Number of mip levels in original image
  443. //  MiscFlags
  444. //      Miscellaneous flags
  445. //  Format
  446. //      D3D format which most closely describes the data in original image
  447. //  ResourceDimension
  448. //      D3D11_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
  449. //      D3D11_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
  450. //  ImageFileFormat
  451. //      D3DX11_IMAGE_FILE_FORMAT representing the format of the image file.
  452. //----------------------------------------------------------------------------
  453.  
  454. type
  455.   PD3DX11ImageInfo = ^TD3DX11ImageInfo;
  456.   D3DX11_IMAGE_INFO = record
  457.     Width:             UINT;
  458.     Height:            UINT;
  459.     Depth:             UINT;
  460.     ArraySize:         UINT;
  461.     MipLevels:         UINT;
  462.     MiscFlags:         UINT;
  463.     Format:            DXGI_FORMAT;
  464.     ResourceDimension: D3D11_RESOURCE_DIMENSION;
  465.     ImageFileFormat:   D3DX11_IMAGE_FILE_FORMAT;
  466.   end;
  467.   {$EXTERNALSYM D3DX11_IMAGE_INFO}
  468.   TD3DX11ImageInfo = D3DX11_IMAGE_INFO;
  469.  
  470.  
  471.  
  472. //////////////////////////////////////////////////////////////////////////////
  473. // Image File APIs ///////////////////////////////////////////////////////////
  474. //////////////////////////////////////////////////////////////////////////////
  475.  
  476. //----------------------------------------------------------------------------
  477. // D3DX11_IMAGE_LOAD_INFO:
  478. // ---------------
  479. // This structure can be optionally passed in to texture loader APIs to
  480. // control how textures get loaded. Pass in D3DX11_DEFAULT for any of these
  481. // to have D3DX automatically pick defaults based on the source file.
  482. //
  483. //  Width
  484. //      Rescale texture to Width texels wide
  485. //  Height
  486. //      Rescale texture to Height texels high
  487. //  Depth
  488. //      Rescale texture to Depth texels deep
  489. //  FirstMipLevel
  490. //      First mip level to load
  491. //  MipLevels
  492. //      Number of mip levels to load after the first level
  493. //  Usage
  494. //      D3D11_USAGE flag for the new texture
  495. //  BindFlags
  496. //      D3D11 Bind flags for the new texture
  497. //  CpuAccessFlags
  498. //      D3D11 CPU Access flags for the new texture
  499. //  MiscFlags
  500. //      Reserved. Must be 0
  501. //  Format
  502. //      Resample texture to the specified format
  503. //  Filter
  504. //      Filter the texture using the specified filter (only when resampling)
  505. //  MipFilter
  506. //      Filter the texture mip levels using the specified filter (only if
  507. //      generating mips)
  508. //  pSrcInfo
  509. //      (optional) pointer to a D3DX11_IMAGE_INFO structure that will get
  510. //      populated with source image information
  511. //----------------------------------------------------------------------------
  512.  
  513. type
  514.   PD3DX11ImageLoadInfo = ^TD3DX11ImageLoadInfo;
  515.   D3DX11_IMAGE_LOAD_INFO = record
  516.     Width:             UINT;
  517.     Height:            UINT;
  518.     Depth:             UINT;
  519.     FirstMipLevel:     UINT;
  520.     MipLevels:         UINT;
  521.     Usage:             D3D11_USAGE;
  522.     BindFlags:         UINT;
  523.     CpuAccessFlags:    UINT;
  524.     MiscFlags:         UINT;
  525.     Format:            DXGI_FORMAT;
  526.     Filter:            UINT;
  527.     MipFilter:         UINT;
  528.     pSrcInfo:          PD3DX11ImageInfo;
  529.   end;
  530.   {$EXTERNALSYM D3DX11_IMAGE_LOAD_INFO}
  531.   TD3DX11ImageLoadInfo = D3DX11_IMAGE_LOAD_INFO;
  532.  
  533. const
  534.   D3DX11_IMAGE_LOAD_INFO_default : TD3DX11ImageLoadInfo =
  535.     (
  536.         Width         : UINT(D3DX11_DEFAULT);
  537.         Height        : UINT(D3DX11_DEFAULT);
  538.         Depth         : UINT(D3DX11_DEFAULT);
  539.         FirstMipLevel : UINT(D3DX11_DEFAULT);
  540.         MipLevels     : UINT(D3DX11_DEFAULT);
  541.         Usage         : D3D11_USAGE(D3DX11_DEFAULT);
  542.         BindFlags     : UINT(D3DX11_DEFAULT);
  543.         CpuAccessFlags: UINT(D3DX11_DEFAULT);
  544.         MiscFlags     : UINT(D3DX11_DEFAULT);
  545.         Format        : DXGI_FORMAT_FROM_FILE;
  546.         Filter        : UINT(D3DX11_DEFAULT);
  547.         MipFilter     : UINT(D3DX11_DEFAULT);
  548.         pSrcInfo      : nil;
  549.     );
  550.  
  551.  
  552. //-------------------------------------------------------------------------------
  553. // GetImageInfoFromFile/Resource/Memory:
  554. // ------------------------------
  555. // Fills in a D3DX11_IMAGE_INFO struct with information about an image file.
  556. //
  557. // Parameters:
  558. //  pSrcFile
  559. //      File name of the source image.
  560. //  pSrcModule
  561. //      Module where resource is located, or NULL for module associated
  562. //      with image the os used to create the current process.
  563. //  pSrcResource
  564. //      Resource name.
  565. //  pSrcData
  566. //      Pointer to file in memory.
  567. //  SrcDataSize
  568. //      Size in bytes of file in memory.
  569. //  pPump
  570. //      Optional pointer to a thread pump object to use.
  571. //  pSrcInfo
  572. //      Pointer to a D3DX11_IMAGE_INFO structure to be filled in with the
  573. //      description of the data in the source image file.
  574. //  pHResult
  575. //      Pointer to a memory location to receive the return value upon completion.
  576. //      Maybe NULL if not needed.
  577. //      If pPump != NULL, pHResult must be a valid memory location until the
  578. //      the asynchronous execution completes.
  579. //-------------------------------------------------------------------------------
  580.  
  581. function D3DX11GetImageInfoFromFile(
  582.     pSrcFile: LPCWSTR;
  583.     pPump: ID3DX11ThreadPump;
  584.     pSrcInfo: PD3DX11ImageInfo;
  585.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromFileW' delayed;
  586. {$EXTERNALSYM D3DX11GetImageInfoFromFile}
  587. function D3DX11GetImageInfoFromFileA(
  588.     pSrcFile: LPCSTR;
  589.     pPump: ID3DX11ThreadPump;
  590.     pSrcInfo: PD3DX11ImageInfo;
  591.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromFileA' delayed;
  592. {$EXTERNALSYM D3DX11GetImageInfoFromFileA}
  593. function D3DX11GetImageInfoFromFileW(
  594.     pSrcFile: LPCWSTR;
  595.     pPump: ID3DX11ThreadPump;
  596.     pSrcInfo: PD3DX11ImageInfo;
  597.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromFileW' delayed;
  598. {$EXTERNALSYM D3DX11GetImageInfoFromFileW}
  599.  
  600. function D3DX11GetImageInfoFromResource(
  601.     hSrcModule: HMODULE;
  602.     pSrcResource: LPCWSTR;
  603.     pPump: ID3DX11ThreadPump;
  604.     pSrcInfo: D3DX11_IMAGE_INFO;
  605.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromResourceW' delayed;
  606. {$EXTERNALSYM D3DX11GetImageInfoFromResource}
  607. function D3DX11GetImageInfoFromResourceA(
  608.     hSrcModule: HMODULE;
  609.     pSrcResource: LPCSTR;
  610.     pPump: ID3DX11ThreadPump;
  611.     pSrcInfo: D3DX11_IMAGE_INFO;
  612.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromResourceA' delayed;
  613. {$EXTERNALSYM D3DX11GetImageInfoFromResourceA}
  614. function D3DX11GetImageInfoFromResourceW(
  615.     hSrcModule: HMODULE;
  616.     pSrcResource: LPCWSTR;
  617.     pPump: ID3DX11ThreadPump;
  618.     pSrcInfo: D3DX11_IMAGE_INFO;
  619.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromResourceW' delayed;
  620. {$EXTERNALSYM D3DX11GetImageInfoFromResourceW}
  621.  
  622. function D3DX11GetImageInfoFromMemory(
  623.     pSrcData: Pointer;
  624.     SrcDataSize: SIZE_T;
  625.     pPump: ID3DX11ThreadPump;
  626.     pSrcInfo: D3DX11_IMAGE_INFO;
  627.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromMemory' delayed;
  628. {$EXTERNALSYM D3DX11GetImageInfoFromMemory}
  629.  
  630. //////////////////////////////////////////////////////////////////////////////
  631. // Create/Save Texture APIs //////////////////////////////////////////////////
  632. //////////////////////////////////////////////////////////////////////////////
  633.  
  634. //----------------------------------------------------------------------------
  635. // D3DX11CreateTextureFromFile/Resource/Memory:
  636. // D3DX11CreateShaderResourceViewFromFile/Resource/Memory:
  637. // -----------------------------------
  638. // Create a texture object from a file or resource.
  639. //
  640. // Parameters:
  641. //
  642. //  pDevice
  643. //      The D3D device with which the texture is going to be used.
  644. //  pSrcFile
  645. //      File name.
  646. //  hSrcModule
  647. //      Module handle. if NULL, current module will be used.
  648. //  pSrcResource
  649. //      Resource name in module
  650. //  pvSrcData
  651. //      Pointer to file in memory.
  652. //  SrcDataSize
  653. //      Size in bytes of file in memory.
  654. //  pLoadInfo
  655. //      Optional pointer to a D3DX11_IMAGE_LOAD_INFO structure that
  656. //      contains additional loader parameters.
  657. //  pPump
  658. //      Optional pointer to a thread pump object to use.
  659. //  ppTexture
  660. //      [out] Created texture object.
  661. //  ppShaderResourceView
  662. //      [out] Shader resource view object created.
  663. //  pHResult
  664. //      Pointer to a memory location to receive the return value upon completion.
  665. //      Maybe NULL if not needed.
  666. //      If pPump != NULL, pHResult must be a valid memory location until the
  667. //      the asynchronous execution completes.
  668. //
  669. //----------------------------------------------------------------------------
  670.  
  671. // FromFile
  672.  
  673. function D3DX11CreateShaderResourceViewFromFile(
  674.     const pDevice: ID3D11Device;
  675.     pSrcFile: LPCWSTR;
  676.     pLoadInfo: PD3DX11ImageLoadInfo;
  677.     pPump: ID3DX11ThreadPump;
  678.     out ppShaderResourceView: ID3D11ShaderResourceView;
  679.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromFileW' delayed;
  680. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromFile}
  681. function D3DX11CreateShaderResourceViewFromFileA(
  682.     const pDevice: ID3D11Device;
  683.     pSrcFile: LPCSTR;
  684.     pLoadInfo: PD3DX11ImageLoadInfo;
  685.     pPump: ID3DX11ThreadPump;
  686.     out ppShaderResourceView: ID3D11ShaderResourceView;
  687.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromFileA' delayed;
  688. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromFileA}
  689. function D3DX11CreateShaderResourceViewFromFileW(
  690.     const pDevice: ID3D11Device;
  691.     pSrcFile: LPCWSTR;
  692.     pLoadInfo: PD3DX11ImageLoadInfo;
  693.     pPump: ID3DX11ThreadPump;
  694.     out ppShaderResourceView: ID3D11ShaderResourceView;
  695.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromFileW' delayed;
  696. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromFileW}
  697.  
  698. function D3DX11CreateTextureFromFile(
  699.     const pDevice: ID3D11Device;
  700.     pSrcFile: LPCWSTR;
  701.     pLoadInfo: PD3DX11ImageLoadInfo;
  702.     pPump: ID3DX11ThreadPump;
  703.     out ppTexture: ID3D11Resource;
  704.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromFileW' delayed;
  705. {$EXTERNALSYM D3DX11CreateTextureFromFile}
  706. function D3DX11CreateTextureFromFileA(
  707.     const pDevice: ID3D11Device;
  708.     pSrcFile: LPCSTR;
  709.     pLoadInfo: PD3DX11ImageLoadInfo;
  710.     pPump: ID3DX11ThreadPump;
  711.     out ppTexture: ID3D11Resource;
  712.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromFileA' delayed;
  713. {$EXTERNALSYM D3DX11CreateTextureFromFileA}
  714. function D3DX11CreateTextureFromFileW(
  715.     const pDevice: ID3D11Device;
  716.     pSrcFile: LPCWSTR;
  717.     pLoadInfo: PD3DX11ImageLoadInfo;
  718.     pPump: ID3DX11ThreadPump;
  719.     out ppTexture: ID3D11Resource;
  720.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromFileW' delayed;
  721. {$EXTERNALSYM D3DX11CreateTextureFromFileW}
  722.  
  723. // FromResource (resources in dll/exes)
  724. function D3DX11CreateShaderResourceViewFromResource(
  725.     const pDevice: ID3D11Device;
  726.     hSrcModule: HMODULE;
  727.     pSrcResource: LPCWSTR;
  728.     pLoadInfo: PD3DX11ImageLoadInfo;
  729.     pPump: ID3DX11ThreadPump;
  730.     out ppShaderResourceView: ID3D11ShaderResourceView;
  731.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromResourceW' delayed;
  732. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromResource}
  733. function D3DX11CreateShaderResourceViewFromResourceA(
  734.     const pDevice: ID3D11Device;
  735.     hSrcModule: HMODULE;
  736.     pSrcResource: LPCSTR;
  737.     pLoadInfo: PD3DX11ImageLoadInfo;
  738.     pPump: ID3DX11ThreadPump;
  739.     out ppShaderResourceView: ID3D11ShaderResourceView;
  740.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromResourceA' delayed;
  741. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromResourceA}
  742. function D3DX11CreateShaderResourceViewFromResourceW(
  743.     const pDevice: ID3D11Device;
  744.     hSrcModule: HMODULE;
  745.     pSrcResource: LPCWSTR;
  746.     pLoadInfo: PD3DX11ImageLoadInfo;
  747.     pPump: ID3DX11ThreadPump;
  748.     out ppShaderResourceView: ID3D11ShaderResourceView;
  749.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromResourceW' delayed;
  750. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromResourceW}
  751.  
  752. function D3DX11CreateTextureFromResource(
  753.     const pDevice: ID3D11Device;
  754.     hSrcModule: HMODULE;
  755.     pSrcResource: LPCWSTR;
  756.     pLoadInfo: PD3DX11ImageLoadInfo;
  757.     pPump: ID3DX11ThreadPump;
  758.     out ppTexture: ID3D11Resource;
  759.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromResourceW' delayed;
  760. {$EXTERNALSYM D3DX11CreateTextureFromResource}
  761. function D3DX11CreateTextureFromResourceA(
  762.     const pDevice: ID3D11Device;
  763.     hSrcModule: HMODULE;
  764.     pSrcResource: LPCSTR;
  765.     pLoadInfo: PD3DX11ImageLoadInfo;
  766.     pPump: ID3DX11ThreadPump;
  767.     out ppTexture: ID3D11Resource;
  768.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromResourceA' delayed;
  769. {$EXTERNALSYM D3DX11CreateTextureFromResourceA}
  770. function D3DX11CreateTextureFromResourceW(
  771.     const pDevice: ID3D11Device;
  772.     hSrcModule: HMODULE;
  773.     pSrcResource: LPCWSTR;
  774.     pLoadInfo: PD3DX11ImageLoadInfo;
  775.     pPump: ID3DX11ThreadPump;
  776.     out ppTexture: ID3D11Resource;
  777.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromResourceW' delayed;
  778. {$EXTERNALSYM D3DX11CreateTextureFromResourceW}
  779.  
  780. // FromFileInMemory
  781.  
  782. function D3DX11CreateShaderResourceViewFromMemory(
  783.     const pDevice: ID3D11Device;
  784.     pSrcData: Pointer;
  785.     SrcDataSize: SIZE_T;
  786.     pLoadInfo: PD3DX11ImageLoadInfo;
  787.     pPump: ID3DX11ThreadPump;
  788.     out ppShaderResourceView: ID3D11ShaderResourceView;
  789.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromMemory' delayed;
  790. {$EXTERNALSYM D3DX11CreateShaderResourceViewFromMemory}
  791.  
  792. function D3DX11CreateTextureFromMemory(
  793.     const pDevice: ID3D11Device;
  794.     pSrcData: Pointer;
  795.     SrcDataSize: SIZE_T;
  796.     pLoadInfo: PD3DX11ImageLoadInfo;
  797.     pPump: ID3DX11ThreadPump;
  798.     out ppTexture: ID3D11Resource;
  799.     pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromMemory' delayed;
  800. {$EXTERNALSYM D3DX11CreateTextureFromMemory}
  801.  
  802. //////////////////////////////////////////////////////////////////////////////
  803. // Misc Texture APIs /////////////////////////////////////////////////////////
  804. //////////////////////////////////////////////////////////////////////////////
  805.  
  806.  
  807. //----------------------------------------------------------------------------
  808. // D3DX11_TEXTURE_LOAD_INFO:
  809. // ------------------------
  810. //
  811. //----------------------------------------------------------------------------
  812.  
  813. type
  814.   PD3DX11_TextureLoadInfo = ^TD3DX11_TextureLoadInfo;
  815.   _D3DX11_TEXTURE_LOAD_INFO = record
  816.     pSrcBox:          PD3D11_Box;
  817.     pDstBox:          PD3D11_Box;
  818.     SrcFirstMip:      UINT;
  819.     DstFirstMip:      UINT;
  820.     NumMips:          UINT;
  821.     SrcFirstElement:  UINT;
  822.     DstFirstElement:  UINT;
  823.     NumElements:      UINT;
  824.     Filter:           UINT;
  825.     MipFilter:        UINT;
  826.   end;
  827.   {$EXTERNALSYM _D3DX11_TEXTURE_LOAD_INFO}
  828.   D3DX11_TEXTURE_LOAD_INFO = _D3DX11_TEXTURE_LOAD_INFO;
  829.   {$EXTERNALSYM D3DX11_TEXTURE_LOAD_INFO}
  830.   TD3DX11_TextureLoadInfo = _D3DX11_TEXTURE_LOAD_INFO;
  831.  
  832. const
  833.   D3DX11_TEXTURE_LOAD_INFO_default : TD3DX11_TextureLoadInfo =
  834.     (
  835.         pSrcBox         : nil;
  836.         pDstBox         : nil;
  837.         SrcFirstMip     : 0;
  838.         DstFirstMip     : 0;
  839.         NumMips         : UINT(D3DX11_DEFAULT);
  840.         SrcFirstElement : 0;
  841.         DstFirstElement : 0;
  842.         NumElements     : UINT(D3DX11_DEFAULT);
  843.         Filter          : UINT(D3DX11_DEFAULT);
  844.         MipFilter       : UINT(D3DX11_DEFAULT);
  845.     );
  846.  
  847.  
  848. //----------------------------------------------------------------------------
  849. // D3DX11LoadTextureFromTexture:
  850. // ----------------------------
  851. // Load a texture from a texture.
  852. //
  853. // Parameters:
  854. //
  855. //----------------------------------------------------------------------------
  856.  
  857. function D3DX11LoadTextureFromTexture(
  858.     pContext: ID3D11DeviceContext;
  859.     pSrcTexture: ID3D11Resource;
  860.     pLoadInfo: PD3DX11_TextureLoadInfo;
  861.     pDstTexture: ID3D11Resource): HResult; stdcall; external d3dx11dll name 'D3DX11LoadTextureFromTexture' delayed;
  862. {$EXTERNALSYM D3DX11LoadTextureFromTexture}
  863.  
  864.  
  865. //----------------------------------------------------------------------------
  866. // D3DX11FilterTexture:
  867. // ------------------
  868. // Filters mipmaps levels of a texture.
  869. //
  870. // Parameters:
  871. //  pBaseTexture
  872. //      The texture object to be filtered
  873. //  SrcLevel
  874. //      The level whose image is used to generate the subsequent levels.
  875. //  MipFilter
  876. //      D3DX11_FILTER flags controlling how each miplevel is filtered.
  877. //      Or D3DX11_DEFAULT for D3DX11_FILTER_BOX,
  878. //
  879. //----------------------------------------------------------------------------
  880.  
  881. function D3DX11FilterTexture(
  882.     pContext: ID3D11DeviceContext;
  883.     pTexture: ID3D11Resource;
  884.     SrcLevel: UINT;
  885.     MipFilter: UINT): HResult; stdcall; external d3dx11dll name 'D3DX11FilterTexture' delayed;
  886. {$EXTERNALSYM D3DX11FilterTexture}
  887.  
  888.  
  889. //----------------------------------------------------------------------------
  890. // D3DX11SaveTextureToFile:
  891. // ----------------------
  892. // Save a texture to a file.
  893. //
  894. // Parameters:
  895. //  pDestFile
  896. //      File name of the destination file
  897. //  DestFormat
  898. //      D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
  899. //  pSrcTexture
  900. //      Source texture, containing the image to be saved
  901. //
  902. //----------------------------------------------------------------------------
  903.  
  904. function D3DX11SaveTextureToFile(
  905.     pContext: ID3D11DeviceContext;
  906.     pSrcTexture: ID3D11Resource;
  907.     DestFormat: D3DX11_IMAGE_FILE_FORMAT;
  908.     pDestFile: LPCWSTR): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToFileW' delayed;
  909. {$EXTERNALSYM D3DX11SaveTextureToFile}
  910. function D3DX11SaveTextureToFileA(
  911.     pContext: ID3D11DeviceContext;
  912.     pSrcTexture: ID3D11Resource;
  913.     DestFormat: D3DX11_IMAGE_FILE_FORMAT;
  914.     pDestFile: LPCSTR): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToFileA' delayed;
  915. {$EXTERNALSYM D3DX11SaveTextureToFileA}
  916. function D3DX11SaveTextureToFileW(
  917.     pContext: ID3D11DeviceContext;
  918.     pSrcTexture: ID3D11Resource;
  919.     DestFormat: D3DX11_IMAGE_FILE_FORMAT;
  920.     pDestFile: LPCWSTR): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToFileW' delayed;
  921. {$EXTERNALSYM D3DX11SaveTextureToFileW}
  922.  
  923.  
  924. //----------------------------------------------------------------------------
  925. // D3DX11SaveTextureToMemory:
  926. // ----------------------
  927. // Save a texture to a blob.
  928. //
  929. // Parameters:
  930. //  pSrcTexture
  931. //      Source texture, containing the image to be saved
  932. //  DestFormat
  933. //      D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
  934. //  ppDestBuf
  935. //      address of a d3dxbuffer pointer to return the image data
  936. //  Flags
  937. //      optional flags
  938. //----------------------------------------------------------------------------
  939.  
  940. function D3DX11SaveTextureToMemory(
  941.     pContext: ID3D11DeviceContext;
  942.     pSrcTexture: ID3D11Resource;
  943.     DestFormat: D3DX11_IMAGE_FILE_FORMAT;
  944.     out ppDestBuf: ID3DBlob;
  945.     Flags: UINT): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToMemory' delayed;
  946. {$EXTERNALSYM D3DX11SaveTextureToMemory}
  947.  
  948.  
  949. //----------------------------------------------------------------------------
  950. // D3DX11ComputeNormalMap:
  951. // ---------------------
  952. // Converts a height map into a normal map.  The (x,y,z) components of each
  953. // normal are mapped to the (r,g,b) channels of the output texture.
  954. //
  955. // Parameters
  956. //  pSrcTexture
  957. //      Pointer to the source heightmap texture
  958. //  Flags
  959. //      D3DX11_NORMALMAP flags
  960. //  Channel
  961. //      D3DX11_CHANNEL specifying source of height information
  962. //  Amplitude
  963. //      The constant value which the height information is multiplied by.
  964. //  pDestTexture
  965. //      Pointer to the destination texture
  966. //---------------------------------------------------------------------------
  967.  
  968. function D3DX11ComputeNormalMap(
  969.     pContext: ID3D11DeviceContext;
  970.     pSrcTexture: ID3D11Texture2D;
  971.     Flags: UINT;
  972.     Channel: UINT;
  973.     Amplitude: Single;
  974.     pDestTexture: ID3D11Texture2D): HResult; stdcall; external d3dx11dll name 'D3DX11ComputeNormalMap' delayed;
  975. {$EXTERNALSYM D3DX11ComputeNormalMap}
  976.  
  977.  
  978. //----------------------------------------------------------------------------
  979. // D3DX11SHProjectCubeMap:
  980. // ----------------------
  981. //  Projects a function represented in a cube map into spherical harmonics.
  982. //
  983. //  Parameters:
  984. //   Order
  985. //      Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
  986. //   pCubeMap
  987. //      CubeMap that is going to be projected into spherical harmonics
  988. //   pROut
  989. //      Output SH vector for Red.
  990. //   pGOut
  991. //      Output SH vector for Green
  992. //   pBOut
  993. //      Output SH vector for Blue
  994. //
  995. //---------------------------------------------------------------------------
  996.  
  997. function D3DX11SHProjectCubeMap(
  998.     pContext: ID3D11DeviceContext;
  999.     Order: UINT;
  1000.     pCubeMap: ID3D11Texture2D;
  1001.     pROut: PSingle;
  1002.     pGOut: PSingle;
  1003.     pBOut: PSingle): HResult; stdcall; external d3dx11dll delayed;
  1004. {$EXTERNALSYM D3DX11SHProjectCubeMap}
  1005.  
  1006.  
  1007. //////////////////////////////////////////////////////////////////////////////
  1008. //
  1009. //  Copyright (c) Microsoft Corporation.  All rights reserved.
  1010. //
  1011. //  File:       D3DX11Async.h
  1012. //  Content:    D3DX11 Asynchronous Shader loaders / compilers
  1013. //
  1014. //////////////////////////////////////////////////////////////////////////////
  1015.  
  1016. //----------------------------------------------------------------------------
  1017. // D3DX11Compile:
  1018. // ------------------
  1019. // Compiles an effect or shader.
  1020. //
  1021. // Parameters:
  1022. //  pSrcFile
  1023. //      Source file name.
  1024. //  hSrcModule
  1025. //      Module handle. if NULL, current module will be used.
  1026. //  pSrcResource
  1027. //      Resource name in module.
  1028. //  pSrcData
  1029. //      Pointer to source code.
  1030. //  SrcDataLen
  1031. //      Size of source code, in bytes.
  1032. //  pDefines
  1033. //      Optional NULL-terminated array of preprocessor macro definitions.
  1034. //  pInclude
  1035. //      Optional interface pointer to use for handling #include directives.
  1036. //      If this parameter is NULL, #includes will be honored when compiling
  1037. //      from file, and will error when compiling from resource or memory.
  1038. //  pFunctionName
  1039. //      Name of the entrypoint function where execution should begin.
  1040. //  pProfile
  1041. //      Instruction set to be used when generating code.  Currently supported
  1042. //      profiles are "vs_1_1",  "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
  1043. //                   "vs_3_sw", "vs_4_0", "vs_4_1",
  1044. //                   "ps_2_0",  "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
  1045. //                   "ps_3_sw", "ps_4_0", "ps_4_1",
  1046. //                   "gs_4_0",  "gs_4_1",
  1047. //                   "tx_1_0",
  1048. //                   "fx_4_0",  "fx_4_1"
  1049. //      Note that this entrypoint does not compile fx_2_0 targets, for that
  1050. //      you need to use the D3DX9 function.
  1051. //  Flags1
  1052. //      See D3D10_SHADER_xxx flags.
  1053. //  Flags2
  1054. //      See D3D10_EFFECT_xxx flags.
  1055. //  ppShader
  1056. //      Returns a buffer containing the created shader.  This buffer contains
  1057. //      the compiled shader code, as well as any embedded debug and symbol
  1058. //      table info.  (See D3D10GetShaderConstantTable)
  1059. //  ppErrorMsgs
  1060. //      Returns a buffer containing a listing of errors and warnings that were
  1061. //      encountered during the compile.  If you are running in a debugger,
  1062. //      these are the same messages you will see in your debug output.
  1063. //  pHResult
  1064. //      Pointer to a memory location to receive the return value upon completion.
  1065. //      Maybe NULL if not needed.
  1066. //      If pPump != NULL, pHResult must be a valid memory location until the
  1067. //      the asynchronous execution completes.
  1068. //----------------------------------------------------------------------------
  1069.  
  1070. function D3DX11CompileFromFile(
  1071.   pSrcFile: LPCWSTR;
  1072.   pDefines: LPD3D_SHADER_MACRO;
  1073.   pInclude: ID3DInclude;
  1074.   pFunctionName: LPCSTR;
  1075.   pProfile: LPCSTR;
  1076.   Flags1, Flags2: UINT;
  1077.   pPump: ID3DX11ThreadPump;
  1078.   out ppShader: ID3DBlob;
  1079.   ppErrorMsgs: PID3DBlob;
  1080.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromFileW' delayed;
  1081. {$EXTERNALSYM D3DX11CompileFromFile}
  1082. function D3DX11CompileFromFileA(
  1083.   pSrcFile: LPCSTR;
  1084.   pDefines: LPD3D_SHADER_MACRO;
  1085.   pInclude: ID3DInclude;
  1086.   pFunctionName: LPCSTR;
  1087.   pProfile: LPCSTR;
  1088.   Flags1, Flags2: UINT;
  1089.   pPump: ID3DX11ThreadPump;
  1090.   out ppShader: ID3DBlob;
  1091.   ppErrorMsgs: PID3DBlob;
  1092.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromFileA' delayed;
  1093. {$EXTERNALSYM D3DX11CompileFromFileA}
  1094. function D3DX11CompileFromFileW(
  1095.   pSrcFile: LPCWSTR;
  1096.   pDefines: LPD3D_SHADER_MACRO;
  1097.   pInclude: ID3DInclude;
  1098.   pFunctionName: LPCSTR;
  1099.   pProfile: LPCSTR;
  1100.   Flags1, Flags2: UINT;
  1101.   pPump: ID3DX11ThreadPump;
  1102.   out ppShader: ID3DBlob;
  1103.   ppErrorMsgs: PID3DBlob;
  1104.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromFileW' delayed;
  1105. {$EXTERNALSYM D3DX11CompileFromFileW}
  1106.  
  1107. function D3DX11CompileFromResource(
  1108.   hSrcModule: HMODULE;
  1109.   pSrcResource: LPCWSTR;
  1110.   pSrcFileName: LPCWSTR;
  1111.   pDefines: LPD3D_SHADER_MACRO;
  1112.   pInclude: ID3DInclude;
  1113.   pFunctionName: LPCSTR;
  1114.   pProfile: LPCSTR;
  1115.   Flags1, Flags2: UINT;
  1116.   pPump: ID3DX11ThreadPump;
  1117.   out ppShader: ID3DBlob;
  1118.   ppErrorMsgs: PID3DBlob;
  1119.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromResourceW' delayed;
  1120. {$EXTERNALSYM D3DX11CompileFromResource}
  1121. function D3DX11CompileFromResourceA(
  1122.   hSrcModule: HMODULE;
  1123.   pSrcResource: LPCSTR;
  1124.   pSrcFileName: LPCSTR;
  1125.   pDefines: LPD3D_SHADER_MACRO;
  1126.   pInclude: ID3DInclude;
  1127.   pFunctionName: LPCSTR;
  1128.   pProfile: LPCSTR;
  1129.   Flags1, Flags2: UINT;
  1130.   pPump: ID3DX11ThreadPump;
  1131.   out ppShader: ID3DBlob;
  1132.   ppErrorMsgs: PID3DBlob;
  1133.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromResourceA' delayed;
  1134. {$EXTERNALSYM D3DX11CompileFromResourceA}
  1135. function D3DX11CompileFromResourceW(
  1136.   hSrcModule: HMODULE;
  1137.   pSrcResource: LPCWSTR;
  1138.   pSrcFileName: LPCWSTR;
  1139.   pDefines: LPD3D_SHADER_MACRO;
  1140.   pInclude: ID3DInclude;
  1141.   pFunctionName: LPCSTR;
  1142.   pProfile: LPCSTR;
  1143.   Flags1, Flags2: UINT;
  1144.   pPump: ID3DX11ThreadPump;
  1145.   out ppShader: ID3DBlob;
  1146.   ppErrorMsgs: PID3DBlob;
  1147.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromResourceW' delayed;
  1148. {$EXTERNALSYM D3DX11CompileFromResourceW}
  1149.  
  1150. function D3DX11CompileFromMemory(
  1151.   pSrcData: LPCSTR;
  1152.   SrcDataLen: SIZE_T;
  1153.   pDefines: LPD3D_SHADER_MACRO;
  1154.   pInclude: ID3DInclude;
  1155.   pFunctionName: LPCSTR;
  1156.   pProfile: LPCSTR;
  1157.   Flags1, Flags2: UINT;
  1158.   pPump: ID3DX11ThreadPump;
  1159.   out ppShader: ID3DBlob;
  1160.   ppErrorMsgs: PID3DBlob;
  1161.   pHResult: PHResult): HResult; stdcall; external d3dx11dll delayed;
  1162. {$EXTERNALSYM D3DX11CompileFromMemory}
  1163.  
  1164.  
  1165. function D3DX11PreprocessShaderFromFile(
  1166.   pFileName: LPCWSTR;
  1167.   pDefines: LPD3D_SHADER_MACRO;
  1168.   pInclude: ID3DInclude;
  1169.   pPump: ID3DX11ThreadPump;
  1170.   out ppShaderText: ID3DBlob;
  1171.   ppErrors: PID3DBlob;
  1172.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromFileW' delayed;
  1173. {$EXTERNALSYM D3DX11PreprocessShaderFromFile}
  1174. function D3DX11PreprocessShaderFromFileA(
  1175.   pFileName: LPCSTR;
  1176.   pDefines: LPD3D_SHADER_MACRO;
  1177.   pInclude: ID3DInclude;
  1178.   pPump: ID3DX11ThreadPump;
  1179.   out ppShaderText: ID3DBlob;
  1180.   ppErrors: PID3DBlob;
  1181.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromFileA' delayed;
  1182. {$EXTERNALSYM D3DX11PreprocessShaderFromFileA}
  1183. function D3DX11PreprocessShaderFromFileW(
  1184.   pFileName: LPCWSTR;
  1185.   pDefines: LPD3D_SHADER_MACRO;
  1186.   pInclude: ID3DInclude;
  1187.   pPump: ID3DX11ThreadPump;
  1188.   out ppShaderText: ID3DBlob;
  1189.   ppErrors: PID3DBlob;
  1190.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromFileW' delayed;
  1191. {$EXTERNALSYM D3DX11PreprocessShaderFromFileW}
  1192.  
  1193. function D3DX11PreprocessShaderFromMemory(
  1194.   pSrcData: LPCSTR;
  1195.   SrcDataSize: SIZE_T;
  1196.   pFileName: LPCSTR;
  1197.   pDefines: LPD3D_SHADER_MACRO;
  1198.   pInclude: ID3DInclude;
  1199.   pPump: ID3DX11ThreadPump;
  1200.   out ppShaderText: ID3DBlob;
  1201.   ppErrors: PID3DBlob;
  1202.   pHResult: PHResult): HResult; stdcall; external d3dx11dll delayed;
  1203. {$EXTERNALSYM D3DX11PreprocessShaderFromMemory}
  1204.  
  1205. function D3DX11PreprocessShaderFromResource(
  1206.   hModule: HMODULE;
  1207.   pResourceName: LPCWSTR;
  1208.   pSrcFileName: LPCWSTR;
  1209.   pDefines: LPD3D_SHADER_MACRO;
  1210.   pInclude: ID3DInclude;
  1211.   pPump: ID3DX11ThreadPump;
  1212.   out ppShaderText: ID3DBlob;
  1213.   ppErrors: PID3DBlob;
  1214.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromResourceW' delayed;
  1215. {$EXTERNALSYM D3DX11PreprocessShaderFromResource}
  1216. function D3DX11PreprocessShaderFromResourceA(
  1217.   hModule: HMODULE;
  1218.   pResourceName: LPCSTR;
  1219.   pSrcFileName: LPCSTR;
  1220.   pDefines: LPD3D_SHADER_MACRO;
  1221.   pInclude: ID3DInclude;
  1222.   pPump: ID3DX11ThreadPump;
  1223.   out ppShaderText: ID3DBlob;
  1224.   ppErrors: PID3DBlob;
  1225.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromResourceA' delayed;
  1226. {$EXTERNALSYM D3DX11PreprocessShaderFromResourceA}
  1227. function D3DX11PreprocessShaderFromResourceW(
  1228.   hModule: HMODULE;
  1229.   pResourceName: LPCWSTR;
  1230.   pSrcFileName: LPCWSTR;
  1231.   pDefines: LPD3D_SHADER_MACRO;
  1232.   pInclude: ID3DInclude;
  1233.   pPump: ID3DX11ThreadPump;
  1234.   out ppShaderText: ID3DBlob;
  1235.   ppErrors: PID3DBlob;
  1236.   pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromResourceW' delayed;
  1237. {$EXTERNALSYM D3DX11PreprocessShaderFromResourceW}
  1238.  
  1239. //----------------------------------------------------------------------------
  1240. // Async processors
  1241. //----------------------------------------------------------------------------
  1242.  
  1243. function D3DX11CreateAsyncCompilerProcessor(
  1244.   pFileName: LPCSTR;
  1245.   pDefines: LPD3D_SHADER_MACRO;
  1246.   pInclude: ID3DInclude;
  1247.   pFunctionName: LPCSTR;
  1248.   pProfile: LPCSTR;
  1249.   Flags1, Flags2: UINT;
  1250.   out ppCompiledShader: ID3DBlob;
  1251.   ppErrorBuffer: PID3DBlob;
  1252.   out ppProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
  1253. {$EXTERNALSYM D3DX11CreateAsyncCompilerProcessor}
  1254.  
  1255. function D3DX11CreateAsyncShaderPreprocessProcessor(
  1256.   pFileName: LPCSTR;
  1257.   pDefines: LPD3D_SHADER_MACRO;
  1258.   pInclude: ID3DInclude;
  1259.   out ppShaderText: ID3DBlob;
  1260.   ppErrorBuffer: PID3DBlob;
  1261.   out ppProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
  1262. {$EXTERNALSYM D3DX11CreateAsyncShaderPreprocessProcessor}
  1263.  
  1264. //----------------------------------------------------------------------------
  1265. // D3DX11 Asynchronous texture I/O (advanced mode)
  1266. //----------------------------------------------------------------------------
  1267.  
  1268. function D3DX11CreateAsyncFileLoader(pFileName: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncFileLoaderW' delayed;
  1269. {$EXTERNALSYM D3DX11CreateAsyncFileLoader}
  1270. function D3DX11CreateAsyncFileLoaderA(pFileName: LPCSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncFileLoaderA' delayed;
  1271. {$EXTERNALSYM D3DX11CreateAsyncFileLoaderA}
  1272. function D3DX11CreateAsyncFileLoaderW(pFileName: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncFileLoaderW' delayed;
  1273. {$EXTERNALSYM D3DX11CreateAsyncFileLoaderW}
  1274. function D3DX11CreateAsyncMemoryLoader(pData: Pointer; cbData: SIZE_T; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll delayed;
  1275. {$EXTERNALSYM D3DX11CreateAsyncMemoryLoader}
  1276. function D3DX11CreateAsyncResourceLoader(hSrcModule: HMODULE; pSrcResource: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncResourceLoaderW' delayed;
  1277. {$EXTERNALSYM D3DX11CreateAsyncResourceLoaderA}
  1278. function D3DX11CreateAsyncResourceLoaderA(hSrcModule: HMODULE; pSrcResource: LPCSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncResourceLoaderA' delayed;
  1279. {$EXTERNALSYM D3DX11CreateAsyncResourceLoaderA}
  1280. function D3DX11CreateAsyncResourceLoaderW(hSrcModule: HMODULE; pSrcResource: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncResourceLoaderW' delayed;
  1281. {$EXTERNALSYM D3DX11CreateAsyncResourceLoaderA}
  1282.  
  1283. function D3DX11CreateAsyncTextureProcessor(pDevice: ID3D11Device; pLoadInfo: PD3DX11ImageLoadInfo; out ppDataProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
  1284. {$EXTERNALSYM D3DX11CreateAsyncTextureProcessor}
  1285. function D3DX11CreateAsyncTextureInfoProcessor(pImageInfo: PD3DX11ImageLoadInfo; out ppDataProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
  1286. {$EXTERNALSYM D3DX11CreateAsyncTextureInfoProcessor}
  1287. function D3DX11CreateAsyncShaderResourceViewProcessor(pDevice: ID3D11Device; pLoadInfo: PD3DX11ImageLoadInfo; out ppDataProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
  1288. {$EXTERNALSYM D3DX11CreateAsyncShaderResourceViewProcessor}
  1289.  
  1290.   {$ENDREGION}
  1291.  
  1292.   {$REGION 'FX11'}
  1293.  
  1294. const
  1295.   //////////// DLL export definitions ///////////////////////////////////////
  1296.   d3fx11dll = 'd3fx11.dll';
  1297.  
  1298. type
  1299.   PD3DX11_StateBlockMask = ^TD3DX11_StateBlockMask;
  1300.   D3DX11_STATE_BLOCK_MASK = record
  1301.     VS: Byte;
  1302.     VSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1303.     VSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1304.     VSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1305.     VSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
  1306.  
  1307.     HS: Byte;
  1308.     HSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1309.     HSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1310.     HSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1311.     HSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
  1312.  
  1313.     DS: Byte;
  1314.     DSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1315.     DSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1316.     DSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1317.     DSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
  1318.  
  1319.     GS: Byte;
  1320.     GSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1321.     GSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1322.     GSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1323.     GSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
  1324.  
  1325.     PS: Byte;
  1326.     PSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1327.     PSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1328.     PSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1329.     PSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
  1330.     PSUnorderedAccessViews: Byte;
  1331.  
  1332.     CS: Byte;
  1333.     CSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1334.     CSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1335.     CSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1336.     CSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
  1337.     CSUnorderedAccessViews: Byte;
  1338.  
  1339.     IAVertexBuffers: array[0..((D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
  1340.     IAIndexBuffer: Byte;
  1341.     IAInputLayout: Byte;
  1342.     IAPrimitiveTopology: Byte;
  1343.  
  1344.     OMRenderTargets: Byte;
  1345.     OMDepthStencilState: Byte;
  1346.     OMBlendState: Byte;
  1347.  
  1348.     RSViewports: Byte;
  1349.     RSScissorRects: Byte;
  1350.     RSRasterizerState: Byte;
  1351.  
  1352.     SOBuffers: Byte;
  1353.  
  1354.     Predication: Byte;
  1355.   end;
  1356.   {$EXTERNALSYM D3DX11_STATE_BLOCK_MASK}
  1357.   TD3DX11_StateBlockMask = D3DX11_STATE_BLOCK_MASK;
  1358.  
  1359. //----------------------------------------------------------------------------
  1360. // D3DX11_EFFECT flags:
  1361. // -------------------------------------
  1362. //
  1363. // These flags are passed in when creating an effect, and affect
  1364. // the runtime effect behavior:
  1365. //
  1366. // (Currently none)
  1367. //
  1368. //
  1369. // These flags are set by the effect runtime:
  1370. //
  1371. // D3DX11_EFFECT_OPTIMIZED
  1372. //   This effect has been optimized. Reflection functions that rely on
  1373. //   names/semantics/strings should fail. This is set when Optimize() is
  1374. //   called, but CEffect::IsOptimized() should be used to test for this.
  1375. //
  1376. // D3DX11_EFFECT_CLONE
  1377. //   This effect is a clone of another effect. Single CBs will never be
  1378. //   updated when internal variable values are changed.
  1379. //   This flag is not set when the D3DX11_EFFECT_CLONE_FORCE_NONSINGLE flag
  1380. //   is used in cloning.
  1381. //
  1382. //----------------------------------------------------------------------------
  1383.  
  1384. const
  1385.   D3DX11_EFFECT_OPTIMIZED = (1 shl 21);
  1386.   {$EXTERNALSYM D3DX11_EFFECT_OPTIMIZED}
  1387.   D3DX11_EFFECT_CLONE = (1 shl 22);
  1388.   {$EXTERNALSYM D3DX11_EFFECT_CLONE}
  1389.  
  1390. // Mask of valid D3DCOMPILE_EFFECT flags for D3DX11CreateEffect*
  1391.   D3DX11_EFFECT_RUNTIME_VALID_FLAGS = (0);
  1392.   {$EXTERNALSYM D3DX11_EFFECT_RUNTIME_VALID_FLAGS}
  1393.  
  1394.  
  1395. //----------------------------------------------------------------------------
  1396. // D3DX11_EFFECT_VARIABLE flags:
  1397. // ----------------------------
  1398. //
  1399. // These flags describe an effect variable (global or annotation),
  1400. // and are returned in D3DX11_EFFECT_VARIABLE_DESC::Flags.
  1401. //
  1402. // D3DX11_EFFECT_VARIABLE_ANNOTATION
  1403. //   Indicates that this is an annotation on a technique, pass, or global
  1404. //   variable. Otherwise, this is a global variable. Annotations cannot
  1405. //   be shared.
  1406. //
  1407. // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
  1408. //   Indicates that the variable has been explicitly bound using the
  1409. //   register keyword.
  1410. //----------------------------------------------------------------------------
  1411.  
  1412.   D3DX11_EFFECT_VARIABLE_ANNOTATION = (1 shl 1);
  1413.   {$EXTERNALSYM D3DX11_EFFECT_VARIABLE_ANNOTATION}
  1414.   D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT = (1 shl 2);
  1415.   {$EXTERNALSYM D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT}
  1416.  
  1417.  
  1418. //----------------------------------------------------------------------------
  1419. // D3DX11_EFFECT_CLONE flags:
  1420. // ----------------------------
  1421. //
  1422. // These flags modify the effect cloning process and are passed into Clone.
  1423. //
  1424. // D3DX11_EFFECT_CLONE_FORCE_NONSINGLE
  1425. //   Ignore all "single" qualifiers on cbuffers.  All cbuffers will have their
  1426. //   own ID3D11Buffer's created in the cloned effect.
  1427. //----------------------------------------------------------------------------
  1428.  
  1429.   D3DX11_EFFECT_CLONE_FORCE_NONSINGLE = (1 shl 0);
  1430.  
  1431.  
  1432. //////////////////////////////////////////////////////////////////////////////
  1433. // ID3DX11EffectType //////////////////////////////////////////////////////////
  1434. //////////////////////////////////////////////////////////////////////////////
  1435.  
  1436. //----------------------------------------------------------------------------
  1437. // D3DX11_EFFECT_TYPE_DESC:
  1438. //
  1439. // Retrieved by ID3DX11EffectType::GetDesc()
  1440. //----------------------------------------------------------------------------
  1441.  
  1442. type
  1443.   PD3DX11_EffectTypeDesc = ^TD3DX11_EffectTypeDesc;
  1444.   D3DX11_EFFECT_TYPE_DESC = record
  1445.     TypeName:     LPCSTR;        // Name of the type
  1446.                                     // (e.g. "float4" or "MyStruct")
  1447.  
  1448.     Class_: TD3D_SHADER_VARIABLE_CLASS;  // (e.g. scalar, vector, object, etc.)
  1449.     Type_:  TD3D_SHADER_VARIABLE_TYPE;   // (e.g. float, texture, vertexshader, etc.)
  1450.  
  1451.     Elements:     UINT;         // Number of elements in this type
  1452.                                     // (0 if not an array)
  1453.     Members:      UINT;         // Number of members
  1454.                                     // (0 if not a structure)
  1455.     Rows:         UINT;         // Number of rows in this type
  1456.                                     // (0 if not a numeric primitive)
  1457.     Columns:      UINT;         // Number of columns in this type
  1458.                                     // (0 if not a numeric primitive)
  1459.  
  1460.     PackedSize:   UINT;         // Number of bytes required to represent
  1461.                                     // this data type, when tightly packed
  1462.     UnpackedSize: UINT;         // Number of bytes occupied by this data
  1463.                                     // type, when laid out in a constant buffer
  1464.     Stride:       UINT;         // Number of bytes to seek between elements,
  1465.                                     // when laid out in a constant buffer
  1466.   end;
  1467.   {$EXTERNALSYM D3DX11_EFFECT_TYPE_DESC}
  1468.   TD3DX11_EffectTypeDesc = D3DX11_EFFECT_TYPE_DESC;
  1469.  
  1470. const
  1471.   IID_ID3DX11EffectType: TGUID = '{4250D721-D5E5-491F-B62B-587C43186285}';
  1472.   {$EXTERNALSYM IID_ID3DX11EffectType}
  1473.  
  1474. type
  1475.   ID3DX11IUnknown = class
  1476.     function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; abstract;
  1477.     function _AddRef: Integer; virtual; stdcall; abstract;
  1478.     function _Release: Integer; virtual; stdcall; abstract;
  1479.   end;
  1480.  
  1481.   {$EXTERNALSYM ID3DX11EffectType}
  1482.   ID3DX11EffectType = class(ID3DX11IUnknown)
  1483.     function IsValid(): BOOL; virtual; stdcall; abstract;
  1484.     function GetDesc(out pDesc: TD3DX11_EffectTypeDesc): HResult; virtual; stdcall; abstract;
  1485.     function GetMemberTypeByIndex(Index: UINT): ID3DX11EffectType; virtual; stdcall; abstract;
  1486.     function GetMemberTypeByName(Name: LPCSTR): ID3DX11EffectType; virtual; stdcall; abstract;
  1487.     function GetMemberTypeBySemantic(Semantic: LPCSTR): ID3DX11EffectType; virtual; stdcall; abstract;
  1488.     function GetMemberName(Index: UINT): LPCSTR; virtual; stdcall; abstract;
  1489.     function GetMemberSemantic(Index: UINT): LPCSTR; virtual; stdcall; abstract;
  1490.   end;
  1491.  
  1492. //////////////////////////////////////////////////////////////////////////////
  1493. // ID3DX11EffectVariable //////////////////////////////////////////////////////
  1494. //////////////////////////////////////////////////////////////////////////////
  1495.  
  1496. //----------------------------------------------------------------------------
  1497. // D3DX11_EFFECT_VARIABLE_DESC:
  1498. //
  1499. // Retrieved by ID3DX11EffectVariable::GetDesc()
  1500. //----------------------------------------------------------------------------
  1501.  
  1502.   PD3DX11_EffectVariableDesc = ^TD3DX11_EffectVariableDesc;
  1503.   D3DX11_EFFECT_VARIABLE_DESC = record
  1504.     Name: LPCSTR;                // Name of this variable, annotation,
  1505.                                     // or structure member
  1506.     Semantic:  LPCSTR;           // Semantic string of this variable
  1507.                                     // or structure member (NULL for
  1508.                                     // annotations or if not present)
  1509.  
  1510.     Flags: UINT;                // D3DX11_EFFECT_VARIABLE_* flags
  1511.     Annotations: UINT;          // Number of annotations on this variable
  1512.                                     // (always 0 for annotations)
  1513.  
  1514.     BufferOffset: UINT;         // Offset into containing cbuffer or tbuffer
  1515.                                     // (always 0 for annotations or variables
  1516.                                     // not in constant buffers)
  1517.  
  1518.     ExplicitBindPoint: UINT;    // Used if the variable has been explicitly bound
  1519.                                     // using the register keyword. Check Flags for
  1520.                                     // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT;
  1521.   end;
  1522.   {$EXTERNALSYM D3DX11_EFFECT_VARIABLE_DESC}
  1523.   TD3DX11_EffectVariableDesc = D3DX11_EFFECT_VARIABLE_DESC;
  1524.  
  1525. const
  1526.   IID_ID3DX11EffectVariable: TGUID = '{036A777D-B56E-4B25-B313-CC3DDAB71873}';
  1527.   {$EXTERNALSYM IID_ID3DX11EffectVariable}
  1528.  
  1529. type
  1530.   ID3DX11EffectScalarVariable = class;
  1531.   ID3DX11EffectVectorVariable = class;
  1532.   ID3DX11EffectMatrixVariable = class;
  1533.   ID3DX11EffectStringVariable = class;
  1534.   ID3DX11EffectClassInstanceVariable = class;
  1535.   ID3DX11EffectInterfaceVariable = class;
  1536.   ID3DX11EffectShaderResourceVariable = class;
  1537.   ID3DX11EffectUnorderedAccessViewVariable = class;
  1538.   ID3DX11EffectRenderTargetViewVariable = class;
  1539.   ID3DX11EffectDepthStencilViewVariable = class;
  1540.   ID3DX11EffectConstantBuffer = class;
  1541.   ID3DX11EffectShaderVariable = class;
  1542.   ID3DX11EffectBlendVariable = class;
  1543.   ID3DX11EffectDepthStencilVariable = class;
  1544.   ID3DX11EffectRasterizerVariable = class;
  1545.   ID3DX11EffectSamplerVariable = class;
  1546.  
  1547.   {$EXTERNALSYM ID3DX11EffectVariable}
  1548.   ID3DX11EffectVariable = class(ID3DX11IUnknown)
  1549.     function IsValid(): BOOL; virtual; stdcall; abstract;
  1550.     function GetType(): ID3DX11EffectType; virtual; stdcall; abstract;
  1551.     function GetDesc(out pDesc: TD3DX11_EffectVariableDesc): HResult; virtual; stdcall; abstract;
  1552.  
  1553.     function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1554.     function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1555.  
  1556.     function GetMemberByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1557.     function GetMemberByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1558.     function GetMemberBySemantic(Semantic: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1559.  
  1560.     function GetElement(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1561.  
  1562.     function GetParentConstantBuffer(): ID3DX11EffectConstantBuffer; virtual; stdcall; abstract;
  1563.  
  1564.     function AsScalar(): ID3DX11EffectScalarVariable; virtual; stdcall; abstract;
  1565.     function AsVector(): ID3DX11EffectVectorVariable; virtual; stdcall; abstract;
  1566.     function AsMatrix(): ID3DX11EffectMatrixVariable; virtual; stdcall; abstract;
  1567.     function AsString(): ID3DX11EffectStringVariable; virtual; stdcall; abstract;
  1568.     function AsClassInstance(): ID3DX11EffectClassInstanceVariable; virtual; stdcall; abstract;
  1569.     function AsInterface(): ID3DX11EffectInterfaceVariable; virtual; stdcall; abstract;
  1570.     function AsShaderResource(): ID3DX11EffectShaderResourceVariable; virtual; stdcall; abstract;
  1571.     function AsUnorderedAccessView(): ID3DX11EffectShaderResourceVariable; virtual; stdcall; abstract;
  1572.     function AsRenderTargetView(): ID3DX11EffectRenderTargetViewVariable; virtual; stdcall; abstract;
  1573.     function AsDepthStencilView(): ID3DX11EffectDepthStencilViewVariable; virtual; stdcall; abstract;
  1574.     function AsConstantBuffer(): ID3DX11EffectConstantBuffer; virtual; stdcall; abstract;
  1575.     function AsShader(): ID3DX11EffectShaderVariable; virtual; stdcall; abstract;
  1576.     function AsBlend(): ID3DX11EffectBlendVariable; virtual; stdcall; abstract;
  1577.     function AsDepthStencil(): ID3DX11EffectDepthStencilVariable; virtual; stdcall; abstract;
  1578.     function AsRasterizer(): ID3DX11EffectRasterizerVariable; virtual; stdcall; abstract;
  1579.     function AsSampler(): ID3DX11EffectSamplerVariable; virtual; stdcall; abstract;
  1580.  
  1581.     function SetRawValue(const pData: Pointer; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1582.     function GetRawValue(pData: Pointer; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1583.   end;
  1584.  
  1585. //////////////////////////////////////////////////////////////////////////////
  1586. // ID3DX11EffectScalarVariable ////////////////////////////////////////////////
  1587. //////////////////////////////////////////////////////////////////////////////
  1588.  
  1589.  
  1590. // {921EF2E5-A65D-4E92-9FC6-4E9CC09A4ADE}
  1591. //DEFINE_GUID(IID_ID3DX11EffectScalarVariable,
  1592. //0x921ef2e5, 0xa65d, 0x4e92, 0x9f, 0xc6, 0x4e, 0x9c, 0xc0, 0x9a, 0x4a, 0xde);
  1593.  
  1594.   {$EXTERNALSYM ID3DX11EffectScalarVariable}
  1595.   ID3DX11EffectScalarVariable = class(ID3DX11EffectVariable)
  1596.     function SetFloat(Value: Single): HResult; virtual; stdcall; abstract;
  1597.     function GetFloat(out pValue: Single): HResult; virtual; stdcall; abstract;
  1598.  
  1599.     function SetFloatArray(const pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1600.     function GetFloatArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1601.  
  1602.     function SetInt(Value: Integer): HResult; virtual; stdcall; abstract;
  1603.     function GetInt(out pValue: Integer): HResult; virtual; stdcall; abstract;
  1604.  
  1605.     function SetIntArray(const pData: PInteger; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1606.     function GetIntArray(pData: PInteger; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1607.  
  1608.     function SetBool(Value: BOOL): HResult; virtual; stdcall; abstract;
  1609.     function GetBool(out pValue: BOOL): HResult; virtual; stdcall; abstract;
  1610.  
  1611.     function SetBoolArray(const pData: PBOOL; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1612.     function GetBoolArray(pData: PBOOL; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1613.   end;
  1614.  
  1615. //////////////////////////////////////////////////////////////////////////////
  1616. // ID3DX11EffectVectorVariable ////////////////////////////////////////////////
  1617. //////////////////////////////////////////////////////////////////////////////
  1618.  
  1619. // {5E785D4A-D87B-48D8-B6E6-0F8CA7E7467A}
  1620. //DEFINE_GUID(IID_ID3DX11EffectVectorVariable,
  1621. //0x5e785d4a, 0xd87b, 0x48d8, 0xb6, 0xe6, 0x0f, 0x8c, 0xa7, 0xe7, 0x46, 0x7a);
  1622.  
  1623.   {$EXTERNALSYM ID3DX11EffectVectorVariable}
  1624.   ID3DX11EffectVectorVariable = class(ID3DX11EffectVariable)
  1625.     procedure SetBoolVector(const pData: PBOOL); virtual; stdcall; abstract;
  1626.     procedure SetIntVector(const pData: PInteger); virtual; stdcall; abstract;
  1627.     function SetFloatVector(const pData: PSingle): HResult; virtual; stdcall; abstract;
  1628.  
  1629.     procedure GetBoolVector(pData: PBOOL); virtual; stdcall; abstract;
  1630.     procedure GetIntVector(pData: PInteger); virtual; stdcall; abstract;
  1631.     function GetFloatVector(pData: PSingle): HResult; virtual; stdcall; abstract;
  1632.  
  1633.     procedure SetBoolVectorArray(const pData: PBOOL; Offset, Count: UINT); virtual; stdcall; abstract;
  1634.     procedure SetIntVectorArray(const pData: PInteger; Offset, Count: UINT); virtual; stdcall; abstract;
  1635.     function SetFloatVectorArray(const pData: PSingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
  1636.  
  1637.     procedure GetBoolVectorArray(pData: PBOOL; Offset, Count: UINT); virtual; stdcall; abstract;
  1638.     procedure GetIntVectorArray(pData: PInteger; Offset, Count: UINT); virtual; stdcall; abstract;
  1639.     function GetFloatVectorArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1640.   end;
  1641.  
  1642. //////////////////////////////////////////////////////////////////////////////
  1643. // ID3DX11EffectMatrixVariable ////////////////////////////////////////////////
  1644. //////////////////////////////////////////////////////////////////////////////
  1645.  
  1646. // {E1096CF4-C027-419A-8D86-D29173DC803E}
  1647. //DEFINE_GUID(IID_ID3DX11EffectMatrixVariable,
  1648. //0xe1096cf4, 0xc027, 0x419a, 0x8d, 0x86, 0xd2, 0x91, 0x73, 0xdc, 0x80, 0x3e);
  1649.  
  1650.   {$EXTERNALSYM ID3DX11EffectMatrixVariable}
  1651.   ID3DX11EffectMatrixVariable = class(ID3DX11EffectVariable)
  1652.     function SetMatrix(const pData: PSingle): HResult; virtual; stdcall; abstract;
  1653.     function GetMatrix(pData: PSingle): HResult; virtual; stdcall; abstract;
  1654.  
  1655.     function SetMatrixPointerArray(const ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
  1656.     function GetMatrixPointerArray(out ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
  1657.  
  1658.     function SetMatrixArray(const pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1659.     function GetMatrixArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1660.  
  1661.     function SetMatrixTranspose(pData: PSingle): HResult; virtual; stdcall; abstract;
  1662.     function GetMatrixTranspose(pData: PSingle): HResult; virtual; stdcall; abstract;
  1663.  
  1664.     function SetMatrixTransposeArray(const pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1665.     function GetMatrixTransposeArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1666.  
  1667.     function SetMatrixTransposePointerArray(const ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
  1668.     function GetMatrixTransposePointerArray(out ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
  1669.   end;
  1670.  
  1671. //////////////////////////////////////////////////////////////////////////////
  1672. // ID3DX11EffectStringVariable ////////////////////////////////////////////////
  1673. //////////////////////////////////////////////////////////////////////////////
  1674.  
  1675. // {F355C818-01BE-4653-A7CC-60FFFEDDC76D}
  1676. //DEFINE_GUID(IID_ID3DX11EffectStringVariable,
  1677. //0xf355c818, 0x01be, 0x4653, 0xa7, 0xcc, 0x60, 0xff, 0xfe, 0xdd, 0xc7, 0x6d);
  1678.  
  1679.   {$EXTERNALSYM ID3DX11EffectStringVariable}
  1680.   ID3DX11EffectStringVariable = class(ID3DX11EffectVariable)
  1681.     function GetString(ppString: LPCSTR): HResult; virtual; stdcall; abstract;
  1682.     function GetStringArray(ppStrings: LPCSTR; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1683.   end;
  1684.  
  1685. //////////////////////////////////////////////////////////////////////////////
  1686. // ID3DX11EffectClassInstanceVariable ////////////////////////////////////////
  1687. //////////////////////////////////////////////////////////////////////////////
  1688.  
  1689. // {926A8053-2A39-4DB4-9BDE-CF649ADEBDC1}
  1690. //DEFINE_GUID(IID_ID3DX11EffectClassInstanceVariable,
  1691. //0x926a8053, 0x2a39, 0x4db4, 0x9b, 0xde, 0xcf, 0x64, 0x9a, 0xde, 0xbd, 0xc1);
  1692.  
  1693.   {$EXTERNALSYM ID3DX11EffectClassInstanceVariable}
  1694.   ID3DX11EffectClassInstanceVariable = class(ID3DX11EffectVariable)
  1695.     function GetClassInstance(out ppClassInstance: ID3D11ClassInstance): HResult; virtual; stdcall; abstract;
  1696.   end;
  1697.  
  1698. //////////////////////////////////////////////////////////////////////////////
  1699. // ID3DX11EffectInterfaceVariable ////////////////////////////////////////
  1700. //////////////////////////////////////////////////////////////////////////////
  1701.  
  1702. // {516C8CD8-1C80-40A4-B19B-0688792F11A5}
  1703. //DEFINE_GUID(IID_ID3DX11EffectInterfaceVariable,
  1704. //0x516c8cd8, 0x1c80, 0x40a4, 0xb1, 0x9b, 0x06, 0x88, 0x79, 0x2f, 0x11, 0xa5);
  1705.  
  1706.   {$EXTERNALSYM ID3DX11EffectInterfaceVariable}
  1707.   ID3DX11EffectInterfaceVariable = class(ID3DX11EffectVariable)
  1708.     function SetClassInstance(pEffectClassInstance: ID3DX11EffectClassInstanceVariable): HResult; virtual; stdcall; abstract;
  1709.     function GetClassInstance(out ppEffectClassInstance: ID3DX11EffectClassInstanceVariable): HResult; virtual; stdcall; abstract;
  1710.   end;
  1711.  
  1712. //////////////////////////////////////////////////////////////////////////////
  1713. // ID3DX11EffectShaderResourceVariable ////////////////////////////////////////
  1714. //////////////////////////////////////////////////////////////////////////////
  1715.  
  1716. // {350DB233-BBE0-485C-9BFE-C0026B844F89}
  1717. //DEFINE_GUID(IID_ID3DX11EffectShaderResourceVariable,
  1718. //0x350db233, 0xbbe0, 0x485c, 0x9b, 0xfe, 0xc0, 0x02, 0x6b, 0x84, 0x4f, 0x89);
  1719.  
  1720.   PID3D11ShaderResourceView = ^ID3D11ShaderResourceView;
  1721.   {$EXTERNALSYM ID3DX11EffectShaderResourceVariable}
  1722.   ID3DX11EffectShaderResourceVariable = class(ID3DX11EffectVariable)
  1723.     function SetResource(const pResource: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
  1724.     function GetResource(out ppResource: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
  1725.  
  1726.     function SetResourceArray(const ppResources: PID3D11ShaderResourceView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1727.     function GetResourceArray(ppResources: PID3D11ShaderResourceView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1728.   end;
  1729.  
  1730. //////////////////////////////////////////////////////////////////////////////
  1731. // ID3DX11EffectUnorderedAccessViewVariable ////////////////////////////////////////
  1732. //////////////////////////////////////////////////////////////////////////////
  1733.  
  1734. // {79B4AC8C-870A-47D2-B05A-8BD5CC3EE6C9}
  1735. //DEFINE_GUID(IID_ID3DX11EffectUnorderedAccessViewVariable,
  1736. //0x79b4ac8c, 0x870a, 0x47d2, 0xb0, 0x5a, 0x8b, 0xd5, 0xcc, 0x3e, 0xe6, 0xc9);
  1737.  
  1738.   PID3D11UnorderedAccessView = ^ID3D11UnorderedAccessView;
  1739.   {$EXTERNALSYM ID3DX11EffectUnorderedAccessViewVariable}
  1740.   ID3DX11EffectUnorderedAccessViewVariable = class(ID3DX11EffectVariable)
  1741.     function SetUnorderedAccessView(const pResource: ID3D11UnorderedAccessView): HResult; virtual; stdcall; abstract;
  1742.     function GetUnorderedAccessView(out ppResource: ID3D11UnorderedAccessView): HResult; virtual; stdcall; abstract;
  1743.  
  1744.     function SetUnorderedAccessViewArray(const ppResources: PID3D11UnorderedAccessView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1745.     function GetUnorderedAccessViewArray(ppResources: PID3D11UnorderedAccessView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1746.   end;
  1747.  
  1748. //////////////////////////////////////////////////////////////////////////////
  1749. // ID3DX11EffectRenderTargetViewVariable //////////////////////////////////////
  1750. //////////////////////////////////////////////////////////////////////////////
  1751.  
  1752. // {D5066909-F40C-43F8-9DB5-057C2A208552}
  1753. //DEFINE_GUID(IID_ID3DX11EffectRenderTargetViewVariable,
  1754. //0xd5066909, 0xf40c, 0x43f8, 0x9d, 0xb5, 0x05, 0x7c, 0x2a, 0x20, 0x85, 0x52);
  1755.  
  1756.   PID3D11RenderTargetView = ^ID3D11RenderTargetView;
  1757.   {$EXTERNALSYM ID3DX11EffectRenderTargetViewVariable}
  1758.   ID3DX11EffectRenderTargetViewVariable = class(ID3DX11EffectVariable)
  1759.     function SetRenderTarget(const pResource: ID3D11RenderTargetView): HResult; virtual; stdcall; abstract;
  1760.     function GetRenderTarget(out ppResource: ID3D11RenderTargetView): HResult; virtual; stdcall; abstract;
  1761.  
  1762.     function SetRenderTargetArray(const ppResources: PID3D11RenderTargetView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1763.     function GetRenderTargetArray(ppResources: PID3D11RenderTargetView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1764.   end;
  1765.  
  1766. //////////////////////////////////////////////////////////////////////////////
  1767. // ID3DX11EffectDepthStencilViewVariable //////////////////////////////////////
  1768. //////////////////////////////////////////////////////////////////////////////
  1769.  
  1770. // {33C648AC-2E9E-4A2E-9CD6-DE31ACC5B347}
  1771. //DEFINE_GUID(IID_ID3DX11EffectDepthStencilViewVariable,
  1772. //0x33c648ac, 0x2e9e, 0x4a2e, 0x9c, 0xd6, 0xde, 0x31, 0xac, 0xc5, 0xb3, 0x47);
  1773.  
  1774.   PID3D11DepthStencilView = ^ID3D11DepthStencilView;
  1775.   {$EXTERNALSYM ID3DX11EffectDepthStencilViewVariable}
  1776.   ID3DX11EffectDepthStencilViewVariable = class(ID3DX11EffectVariable)
  1777.     function SetDepthStencil(const pResource: ID3D11DepthStencilView): HResult; virtual; stdcall; abstract;
  1778.     function GetDepthStencil(out ppResource: ID3D11DepthStencilView): HResult; virtual; stdcall; abstract;
  1779.  
  1780.     function SetDepthStencilArray(const ppResources: PID3D11DepthStencilView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1781.     function GetDepthStencilArray(ppResources: PID3D11DepthStencilView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
  1782.   end;
  1783.  
  1784. //////////////////////////////////////////////////////////////////////////////
  1785. // ID3DX11EffectConstantBuffer ////////////////////////////////////////////////
  1786. //////////////////////////////////////////////////////////////////////////////
  1787.  
  1788. // {2CB6C733-82D2-4000-B3DA-6219D9A99BF2}
  1789. //DEFINE_GUID(IID_ID3DX11EffectConstantBuffer,
  1790. //0x2cb6c733, 0x82d2, 0x4000, 0xb3, 0xda, 0x62, 0x19, 0xd9, 0xa9, 0x9b, 0xf2);
  1791.  
  1792.   {$EXTERNALSYM ID3DX11EffectConstantBuffer}
  1793.   ID3DX11EffectConstantBuffer = class(ID3DX11EffectVariable)
  1794.     function SetConstantBuffer(const pConstantBuffer: ID3D11Buffer): HResult; virtual; stdcall; abstract;
  1795.     function UndoSetConstantBuffer: HResult; virtual; stdcall; abstract;
  1796.     function GetConstantBuffer(out ppConstantBuffer: ID3D11Buffer): HResult; virtual; stdcall; abstract;
  1797.  
  1798.     function SetTextureBuffer(const pTextureBuffer: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
  1799.     function UndoSetTextureBuffer: HResult; virtual; stdcall; abstract;
  1800.     function GetTextureBuffer(out ppTextureBuffer: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
  1801.   end;
  1802.  
  1803. //////////////////////////////////////////////////////////////////////////////
  1804. // ID3DX11EffectShaderVariable ////////////////////////////////////////////////
  1805. //////////////////////////////////////////////////////////////////////////////
  1806.  
  1807. //----------------------------------------------------------------------------
  1808. // D3DX11_EFFECT_SHADER_DESC:
  1809. //
  1810. // Retrieved by ID3DX11EffectShaderVariable::GetShaderDesc()
  1811. //----------------------------------------------------------------------------
  1812.  
  1813.   PD3DX11_EffectShaderDesc = ^TD3DX11_EffectShaderDesc;
  1814.   D3DX11_EFFECT_SHADER_DESC = record
  1815.     pInputSignature: PByte;         // Passed into CreateInputLayout,
  1816.                                     // valid on VS and GS only
  1817.  
  1818.     IsInline: BOOL;                 // Is this an anonymous shader variable
  1819.                                     // resulting from an inline shader assignment?
  1820.  
  1821.  
  1822.     // -- The following fields are not valid after Optimize() --
  1823.     pBytecode: PByte;               // Shader bytecode
  1824.     BytecodeLength: UINT;
  1825.  
  1826.     SODecls: array[0..D3D11_SO_STREAM_COUNT-1] of LPCSTR; // Stream out declaration string (for GS with SO)
  1827.     RasterizedStream: UINT;
  1828.  
  1829.     NumInputSignatureEntries: UINT;  // Number of entries in the input signature
  1830.     NumOutputSignatureEntries: UINT; // Number of entries in the output signature
  1831.     NumPatchConstantSignatureEntries: UINT; // Number of entries in the patch constant signature
  1832.   end;
  1833.   {$EXTERNALSYM D3DX11_EFFECT_SHADER_DESC}
  1834.   TD3DX11_EffectShaderDesc = D3DX11_EFFECT_SHADER_DESC;
  1835.  
  1836. // {7508B344-020A-4EC7-9118-62CDD36C88D7}
  1837. //DEFINE_GUID(IID_ID3DX11EffectShaderVariable,
  1838. //0x7508b344, 0x020a, 0x4ec7, 0x91, 0x18, 0x62, 0xcd, 0xd3, 0x6c, 0x88, 0xd7);
  1839.  
  1840.   {$EXTERNALSYM ID3DX11EffectShaderVariable}
  1841.   ID3DX11EffectShaderVariable = class(ID3DX11EffectVariable)
  1842.     function GetShaderDesc(ShaderIndex: UINT; out pDesc: TD3DX11_EffectShaderDesc): HResult; virtual; stdcall; abstract;
  1843.  
  1844.     function GetVertexShader(ShaderIndex: UINT; out ppVS: ID3D11VertexShader): HResult; virtual; stdcall; abstract;
  1845.     function GetGeometryShader(ShaderIndex: UINT; out ppGS: ID3D11GeometryShader): HResult; virtual; stdcall; abstract;
  1846.     function GetPixelShader(ShaderIndex: UINT; out ppPS: ID3D11PixelShader): HResult; virtual; stdcall; abstract;
  1847.     function GetHullShader(ShaderIndex: UINT; out ppHS: ID3D11HullShader): HResult; virtual; stdcall; abstract;
  1848.     function GetDomainShader(ShaderIndex: UINT; out ppDS: ID3D11DomainShader): HResult; virtual; stdcall; abstract;
  1849.     function GetComputeShader(ShaderIndex: UINT; out ppCS: ID3D11ComputeShader): HResult; virtual; stdcall; abstract;
  1850.  
  1851.     function GetInputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D11SignatureParameterDesc): HResult; virtual; stdcall; abstract;
  1852.     function GetOutputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D11SignatureParameterDesc): HResult; virtual; stdcall; abstract;
  1853.     function GetPatchConstantSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D11SignatureParameterDesc): HResult; virtual; stdcall; abstract;
  1854.   end;
  1855.  
  1856. //////////////////////////////////////////////////////////////////////////////
  1857. // ID3DX11EffectBlendVariable /////////////////////////////////////////////////
  1858. //////////////////////////////////////////////////////////////////////////////
  1859.  
  1860. // {D664F4D7-3B81-4805-B277-C1DF58C39F53}
  1861. //DEFINE_GUID(IID_ID3DX11EffectBlendVariable,
  1862. //0xd664f4d7, 0x3b81, 0x4805, 0xb2, 0x77, 0xc1, 0xdf, 0x58, 0xc3, 0x9f, 0x53);
  1863.  
  1864.   {$EXTERNALSYM ID3DX11EffectBlendVariable}
  1865.   ID3DX11EffectBlendVariable = class(ID3DX11EffectVariable)
  1866.     function GetBlendState(Index: UINT; out ppBlendState: ID3D11BlendState): HResult; virtual; stdcall; abstract;
  1867.     function SetBlendState(Index: UINT; const pBlendState: ID3D11BlendState): HResult; virtual; stdcall; abstract;
  1868.     function UndoSetBlendState(Index: UINT): HResult; virtual; stdcall; abstract;
  1869.     function GetBackingStore(Index: UINT; out pBlendDesc: D3D11_BLEND_DESC): HResult; virtual; stdcall; abstract;
  1870.   end;
  1871.  
  1872. //////////////////////////////////////////////////////////////////////////////
  1873. // ID3DX11EffectDepthStencilVariable //////////////////////////////////////////
  1874. //////////////////////////////////////////////////////////////////////////////
  1875. ///
  1876. // {69B5751B-61A5-48E5-BD41-D93988111563}
  1877. //DEFINE_GUID(IID_ID3DX11EffectDepthStencilVariable,
  1878. //0x69b5751b, 0x61a5, 0x48e5, 0xbd, 0x41, 0xd9, 0x39, 0x88, 0x11, 0x15, 0x63);
  1879.  
  1880.   {$EXTERNALSYM ID3DX11EffectDepthStencilVariable}
  1881.   ID3DX11EffectDepthStencilVariable = class(ID3DX11EffectVariable)
  1882.     function GetDepthStencilState(Index: UINT; out ppDepthStencilState: ID3D11DepthStencilState): HResult; virtual; stdcall; abstract;
  1883.     function SetDepthStencilState(Index: UINT; const ppDepthStencilState: ID3D11DepthStencilState): HResult; virtual; stdcall; abstract;
  1884.     function UndoSetDepthStencilState(Index: UINT): HResult; virtual; stdcall; abstract;
  1885.     function GetBackingStore(Index: UINT; out pDepthStencilDesc: D3D11_DEPTH_STENCIL_DESC): HResult; virtual; stdcall; abstract;
  1886.   end;
  1887.  
  1888. //////////////////////////////////////////////////////////////////////////////
  1889. // ID3DX11EffectRasterizerVariable ////////////////////////////////////////////
  1890. //////////////////////////////////////////////////////////////////////////////
  1891.  
  1892. // {53A262F6-5F74-4151-A132-E3DD19A62C9D}
  1893. //DEFINE_GUID(IID_ID3DX11EffectRasterizerVariable,
  1894. //0x53a262f6, 0x5f74, 0x4151, 0xa1, 0x32, 0xe3, 0xdd, 0x19, 0xa6, 0x2c, 0x9d);
  1895.  
  1896.   {$EXTERNALSYM ID3DX11EffectRasterizerVariable}
  1897.   ID3DX11EffectRasterizerVariable = class(ID3DX11EffectVariable)
  1898.     function GetRasterizerState(Index: UINT; out ppRasterizerState: ID3D11RasterizerState): HResult; virtual; stdcall; abstract;
  1899.     function SetRasterizerState(Index: UINT; const pRasterizerState: ID3D11RasterizerState): HResult; virtual; stdcall; abstract;
  1900.     function UndoSetRasterizerState(Index: UINT): HResult; virtual; stdcall; abstract;
  1901.     function GetBackingStore(Index: UINT; out pRasterizerDesc: D3D11_RASTERIZER_DESC): HResult; virtual; stdcall; abstract;
  1902.   end;
  1903.  
  1904.  
  1905. //////////////////////////////////////////////////////////////////////////////
  1906. // ID3DX11EffectSamplerVariable ///////////////////////////////////////////////
  1907. //////////////////////////////////////////////////////////////////////////////
  1908.  
  1909. // {C6402E55-1095-4D95-8931-F92660513DD9}
  1910. //DEFINE_GUID(IID_ID3DX11EffectSamplerVariable,
  1911. //0xc6402e55, 0x1095, 0x4d95, 0x89, 0x31, 0xf9, 0x26, 0x60, 0x51, 0x3d, 0xd9);
  1912.  
  1913.   {$EXTERNALSYM ID3DX11EffectSamplerVariable}
  1914.   ID3DX11EffectSamplerVariable = class(ID3DX11EffectVariable)
  1915.     function GetSampler(Index: UINT; out ppSampler: ID3D11SamplerState): HResult; virtual; stdcall; abstract;
  1916.     function SetSampler(Index: UINT; const pSampler: ID3D11SamplerState): HResult; virtual; stdcall; abstract;
  1917.     function UndoSetSampler(Index: UINT): HResult; virtual; stdcall; abstract;
  1918.     function GetBackingStore(Index: UINT; out pSamplerDesc: D3D11_SAMPLER_DESC): HResult; virtual; stdcall; abstract;
  1919.   end;
  1920.  
  1921. //////////////////////////////////////////////////////////////////////////////
  1922. // ID3DX11EffectPass //////////////////////////////////////////////////////////
  1923. //////////////////////////////////////////////////////////////////////////////
  1924.  
  1925. //----------------------------------------------------------------------------
  1926. // D3DX11_PASS_DESC:
  1927. //
  1928. // Retrieved by ID3DX11EffectPass::GetDesc()
  1929. //----------------------------------------------------------------------------
  1930.  
  1931.   PD3DX11_PassDesc = ^TD3DX11_PassDesc;
  1932.   D3DX11_PASS_DESC = record
  1933.     Name: LPCSTR;                // Name of this pass (NULL if not anonymous)
  1934.     Annotations: UINT;          // Number of annotations on this pass
  1935.  
  1936.     pIAInputSignature: PByte;       // Signature from VS or GS (if there is no VS)
  1937.                                     // or NULL if neither exists
  1938.     IAInputSignatureSize: SIZE_T;   // Singature size in bytes
  1939.  
  1940.     StencilRef: UINT;           // Specified in SetDepthStencilState()
  1941.     SampleMask: UINT;           // Specified in SetBlendState()
  1942.     BlendFactor: TFourSingleArray;       // Specified in SetBlendState()
  1943.   end;
  1944.   {$EXTERNALSYM D3DX11_PASS_DESC}
  1945.   TD3DX11_PassDesc = D3DX11_PASS_DESC;
  1946.  
  1947. //----------------------------------------------------------------------------
  1948. // D3DX11_PASS_SHADER_DESC:
  1949. //
  1950. // Retrieved by ID3DX11EffectPass::Get**ShaderDesc()
  1951. //----------------------------------------------------------------------------
  1952.  
  1953.   PD3DX11_PassShaderDesc = ^TD3DX11_PassShaderDesc;
  1954.   D3DX11_PASS_SHADER_DESC = record
  1955.     pShaderVariable: ID3DX11EffectShaderVariable;   // The variable that this shader came from.
  1956.                                                     // If this is an inline shader assignment,
  1957.                                                     //   the returned interface will be an
  1958.                                                     //   anonymous shader variable, which is
  1959.                                                     //   not retrievable any other way.  It's
  1960.                                                     //   name in the variable description will
  1961.                                                     //   be "$Anonymous".
  1962.                                                     // If there is no assignment of this type in
  1963.                                                     //   the pass block, pShaderVariable != NULL,
  1964.                                                     //   but pShaderVariable->IsValid() == FALSE.
  1965.  
  1966.     ShaderIndex:                        UINT;       // The element of pShaderVariable (if an array)
  1967.                                                     // or 0 if not applicable
  1968.   end;
  1969.   {$EXTERNALSYM D3DX11_PASS_SHADER_DESC}
  1970.   TD3DX11_PassShaderDesc = D3DX11_PASS_SHADER_DESC;
  1971.  
  1972. // {3437CEC4-4AC1-4D87-8916-F4BD5A41380C}
  1973. //DEFINE_GUID(IID_ID3DX11EffectPass,
  1974. //0x3437cec4, 0x4ac1, 0x4d87, 0x89, 0x16, 0xf4, 0xbd, 0x5a, 0x41, 0x38, 0x0c);
  1975.  
  1976.   {$EXTERNALSYM ID3DX11EffectPass}
  1977.   ID3DX11EffectPass = class(ID3DX11IUnknown)
  1978.     function IsValid(): BOOL; virtual; stdcall; abstract;
  1979.     function GetDesc(out pDesc: TD3DX11_PassDesc): HResult; virtual; stdcall; abstract;
  1980.  
  1981.     function GetVertexShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
  1982.     function GetGeometryShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
  1983.     function GetPixelShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
  1984.     function GetHullShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
  1985.     function GetDomainShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
  1986.     function GetComputeShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
  1987.  
  1988.     function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1989.     function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
  1990.  
  1991.     function Apply(Flags: UINT; pContext: ID3D11DeviceContext): HResult; virtual; stdcall; abstract;
  1992.  
  1993.     function ComputeStateBlockMask(out pStateBlockMask: TD3DX11_StateBlockMask): HResult; virtual; stdcall; abstract;
  1994.   end;
  1995.  
  1996. //////////////////////////////////////////////////////////////////////////////
  1997. // ID3DX11EffectTechnique /////////////////////////////////////////////////////
  1998. //////////////////////////////////////////////////////////////////////////////
  1999.  
  2000. //----------------------------------------------------------------------------
  2001. // D3DX11_TECHNIQUE_DESC:
  2002. //
  2003. // Retrieved by ID3DX11EffectTechnique::GetDesc()
  2004. //----------------------------------------------------------------------------
  2005.  
  2006.   PD3DX11_TechniqueDesc = ^TD3DX11_TechniqueDesc;
  2007.   D3DX11_TECHNIQUE_DESC = record
  2008.     Name: LPCSTR;          // Name of this technique (NULL if not anonymous)
  2009.     Passes: UINT;         // Number of passes contained within
  2010.     Annotations: UINT;    // Number of annotations on this technique
  2011.   end;
  2012.   {$EXTERNALSYM D3DX11_TECHNIQUE_DESC}
  2013.   TD3DX11_TechniqueDesc = D3DX11_TECHNIQUE_DESC;
  2014.  
  2015. // {51198831-1F1D-4F47-BD76-41CB0835B1DE}
  2016. //DEFINE_GUID(IID_ID3DX11EffectTechnique,
  2017. //0x51198831, 0x1f1d, 0x4f47, 0xbd, 0x76, 0x41, 0xcb, 0x08, 0x35, 0xb1, 0xde);
  2018.  
  2019.   {$EXTERNALSYM ID3DX11EffectTechnique}
  2020.   ID3DX11EffectTechnique = class(ID3DX11IUnknown)
  2021.     function IsValid(): BOOL; virtual; stdcall; abstract;
  2022.     function GetDesc(out pDesc: TD3DX11_TechniqueDesc): HResult; virtual; stdcall; abstract;
  2023.  
  2024.     function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
  2025.     function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
  2026.  
  2027.     function GetPassByIndex(Index: UINT): ID3DX11EffectPass; virtual; stdcall; abstract;
  2028.     function GetPassByName(Name: LPCSTR): ID3DX11EffectPass; virtual; stdcall; abstract;
  2029.  
  2030.     function ComputeStateBlockMask(out pStateBlockMask: TD3DX11_StateBlockMask): HResult; virtual; stdcall; abstract;
  2031.   end;
  2032.  
  2033. //////////////////////////////////////////////////////////////////////////////
  2034. // ID3DX11EffectTechnique /////////////////////////////////////////////////////
  2035. //////////////////////////////////////////////////////////////////////////////
  2036.  
  2037. //----------------------------------------------------------------------------
  2038. // D3DX11_GROUP_DESC:
  2039. //
  2040. // Retrieved by ID3DX11EffectTechnique::GetDesc()
  2041. //----------------------------------------------------------------------------
  2042.  
  2043.   PD3DX11_GroupDesc = ^TD3DX11_GroupDesc;
  2044.   D3DX11_GROUP_DESC = record
  2045.     Name: LPCSTR;         // Name of this group (only nullptr if global
  2046.     Techniques: UINT;     // Number of techniques contained within
  2047.     Annotations: UINT;    // Number of annotations on this group
  2048.   end;
  2049.   {$EXTERNALSYM D3DX11_GROUP_DESC}
  2050.   TD3DX11_GroupDesc = D3DX11_GROUP_DESC;
  2051.  
  2052. // {03074acf-97de-485f-b201-cb775264afd6}
  2053. //DEFINE_GUID(IID_ID3DX11EffectGroup,
  2054. //0x03074acf, 0x97de, 0x485f, 0xb2, 0x01, 0xcb, 0x77, 0x52, 0x64, 0xaf, 0xd6);
  2055.  
  2056.   {$EXTERNALSYM ID3DX11EffectGroup}
  2057.   ID3DX11EffectGroup = class(ID3DX11IUnknown)
  2058.     function IsValid(): BOOL; virtual; stdcall; abstract;
  2059.     function GetDesc(out pDesc: TD3DX11_GroupDesc): HResult; virtual; stdcall; abstract;
  2060.  
  2061.     function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
  2062.     function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
  2063.  
  2064.     function GetTechniqueByIndex(Index: UINT): ID3DX11EffectPass; virtual; stdcall; abstract;
  2065.     function GetTechniqueByName(Name: LPCSTR): ID3DX11EffectPass; virtual; stdcall; abstract;
  2066.   end;
  2067.  
  2068. //////////////////////////////////////////////////////////////////////////////
  2069. // ID3DX11Effect //////////////////////////////////////////////////////////////
  2070. //////////////////////////////////////////////////////////////////////////////
  2071.  
  2072. //----------------------------------------------------------------------------
  2073. // D3DX11_EFFECT_DESC:
  2074. //
  2075. // Retrieved by ID3DX11Effect::GetDesc()
  2076. //----------------------------------------------------------------------------
  2077.  
  2078.   PD3DX11_EffectDesc = ^TD3DX11_EffectDesc;
  2079.   D3DX11_EFFECT_DESC = record
  2080.     ConstantBuffers: UINT;    // Number of constant buffers in this effect
  2081.     GlobalVariables: UINT;    // Number of global variables in this effect
  2082.     InterfaceVariables: UINT; // Number of global interfaces in this effect
  2083.     Techniques: UINT;         // Number of techniques in this effect
  2084.     Groups: UINT;             // Number of groups in this effect
  2085.   end;
  2086.   {$EXTERNALSYM D3DX11_EFFECT_DESC}
  2087.   TD3DX11_EffectDesc = D3DX11_EFFECT_DESC;
  2088.  
  2089. // {FA61CA24-E4BA-4262-9DB8-B132E8CAE319}
  2090. //DEFINE_GUID(IID_ID3DX11Effect,
  2091. //0xfa61ca24, 0xe4ba, 0x4262, 0x9d, 0xb8, 0xb1, 0x32, 0xe8, 0xca, 0xe3, 0x19);
  2092.  
  2093.   {$EXTERNALSYM ID3DX11Effect}
  2094.   ID3DX11Effect = interface (IUnknown)
  2095.   ['{FA61CA24-E4BA-4262-9DB8-B132E8CAE319}']
  2096.     function IsValid(): BOOL; stdcall;
  2097.  
  2098.     function GetDevice(out ppDevice: ID3D11Device): HResult; stdcall;
  2099.  
  2100.     function GetDesc(out pDesc: TD3DX11_EffectDesc): HResult; stdcall;
  2101.  
  2102.     function GetConstantBufferByIndex(Index: UINT): ID3DX11EffectConstantBuffer; stdcall;
  2103.     function GetConstantBufferByName(Name: LPCSTR): ID3DX11EffectConstantBuffer; stdcall;
  2104.  
  2105.     function GetVariableByIndex(Index: UINT): ID3DX11EffectVariable; stdcall;
  2106.     function GetVariableByName(Name: LPCSTR): ID3DX11EffectVariable; stdcall;
  2107.     function GetVariableBySemantic(Semantic: LPCSTR): ID3DX11EffectVariable; stdcall;
  2108.  
  2109.     function GetGroupByIndex(Index: UINT): ID3DX11EffectGroup; stdcall;
  2110.     function GetGroupByName(Name: LPCSTR): ID3DX11EffectGroup; stdcall;
  2111.  
  2112.     function GetTechniqueByIndex(Index: UINT): ID3DX11EffectTechnique; stdcall;
  2113.     function GetTechniqueByName(Name: LPCSTR): ID3DX11EffectTechnique; stdcall;
  2114.  
  2115.     function GetClassLinkage: Pointer {ID3D11ClassLinkage;} stdcall; experimental; //C++ returns in RAX
  2116.     function CloneEffect(Flags: UINT32; out ppClonedEffect: ID3DX11Effect): HResult; stdcall;
  2117.     function Optimize(): HResult; stdcall;
  2118.     function IsOptimized(): BOOL; stdcall;
  2119.   end;
  2120.  
  2121.  
  2122. //////////////////////////////////////////////////////////////////////////////
  2123. // APIs //////////////////////////////////////////////////////////////////////
  2124. //////////////////////////////////////////////////////////////////////////////
  2125.  
  2126. //----------------------------------------------------------------------------
  2127. // D3DX11CreateEffectFromMemory
  2128. //
  2129. // Creates an effect instance from a compiled effect in memory
  2130. //
  2131. // Parameters:
  2132. //
  2133. // [in]
  2134. //
  2135. //  pData
  2136. //      Blob of compiled effect data
  2137. //  DataLength
  2138. //      Length of the data blob
  2139. //  FXFlags
  2140. //      Flags pertaining to Effect creation
  2141. //  pDevice
  2142. //      Pointer to the D3D11 device on which to create Effect resources
  2143. //  srcName [optional]
  2144. //      ASCII string to use for debug object naming
  2145. //
  2146. // [out]
  2147. //
  2148. //  ppEffect
  2149. //      Address of the newly created Effect interface
  2150. //
  2151. //----------------------------------------------------------------------------
  2152.  
  2153. function D3DX11CreateEffectFromMemory(
  2154.   pData: Pointer;
  2155.   DataLength: SIZE_T;
  2156.   FXFlags: UINT;
  2157.   const pDevice: ID3D11Device;
  2158.   out ppEffect: ID3DX11Effect;
  2159.   srcName: LPCSTR = nil): HResult; stdcall; external d3fx11dll delayed;
  2160. {$EXTERNALSYM D3DX11CreateEffectFromMemory}
  2161.  
  2162. //----------------------------------------------------------------------------
  2163. // D3DX11CreateEffectFromFile
  2164. //
  2165. // Creates an effect instance from a compiled effect data file
  2166. //
  2167. // Parameters:
  2168. //
  2169. // [in]
  2170. //
  2171. //  pFileName
  2172. //      Compiled effect file
  2173. //  FXFlags
  2174. //      Flags pertaining to Effect creation
  2175. //  pDevice
  2176. //      Pointer to the D3D11 device on which to create Effect resources
  2177. //
  2178. // [out]
  2179. //
  2180. //  ppEffect
  2181. //      Address of the newly created Effect interface
  2182. //
  2183. //----------------------------------------------------------------------------
  2184.  
  2185. function D3DX11CreateEffectFromFile(
  2186.   pFileName: LPWSTR;
  2187.   FXFlags: UINT;
  2188.   const pDevice: ID3D11Device;
  2189.   out ppEffect: ID3DX11Effect): HResult; stdcall; external d3fx11dll delayed;
  2190. {$EXTERNALSYM D3DX11CreateEffectFromFile}
  2191.  
  2192. //----------------------------------------------------------------------------
  2193. // D3DX11CompileEffectFromMemory
  2194. //
  2195. // Complies an effect shader source file in memory and then creates an effect instance
  2196. //
  2197. // Parameters:
  2198. //
  2199. // [in]
  2200. //
  2201. //  pData
  2202. //      Pointer to FX shader as an ASCII string
  2203. //  DataLength
  2204. //      Length of the FX shader ASCII string
  2205. //  srcName [optional]
  2206. //      ASCII string to use for debug object naming
  2207. //  pDefines [optional]
  2208. //      A NULL-terminated array of shader macros
  2209. //  pInclude [optional]
  2210. //      A pointer to an include interface
  2211. //  HLSLFlags
  2212. //     HLSL compile options (see D3DCOMPILE flags)
  2213. //  FXFlags
  2214. //      Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags)
  2215. //  pDevice
  2216. //      Pointer to the D3D11 device on which to create Effect resources
  2217. //
  2218. // [out]
  2219. //
  2220. //  ppEffect
  2221. //      Address of the newly created Effect interface
  2222. //
  2223. //----------------------------------------------------------------------------
  2224.  
  2225. function D3DX11CompileEffectFromMemory(
  2226.   pData: Pointer;
  2227.   DataLength: SIZE_T;
  2228.   srcName: LPSTR;
  2229.   pDefines: LPD3D_SHADER_MACRO;
  2230.   pInclude: ID3DInclude;
  2231.   HLSLFlags, FXFlags: UINT;
  2232.   const pDevice: ID3D11Device;
  2233.   out ppEffect: ID3DX11Effect;
  2234.   ppErrors: PID3DBlob = nil): HResult; stdcall; external d3fx11dll delayed;
  2235. {$EXTERNALSYM D3DX11CreateEffectFromMemory}
  2236.  
  2237. //----------------------------------------------------------------------------
  2238. // D3DX11CompileEffectFromFile
  2239. //
  2240. // Complies an effect shader source file and then creates an effect instance
  2241. //
  2242. // Parameters:
  2243. //
  2244. // [in]
  2245. //
  2246. //  pFileName
  2247. //      FX shader source file
  2248. //  pDefines [optional]
  2249. //      A NULL-terminated array of shader macros
  2250. //  pInclude [optional]
  2251. //      A pointer to an include interface
  2252. //  HLSLFlags
  2253. //     HLSL compile options (see D3DCOMPILE flags)
  2254. //  FXFlags
  2255. //      Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags)
  2256. //  pDevice
  2257. //      Pointer to the D3D11 device on which to create Effect resources
  2258. //
  2259. // [out]
  2260. //
  2261. //  ppEffect
  2262. //      Address of the newly created Effect interface
  2263. //
  2264. //----------------------------------------------------------------------------
  2265.  
  2266. function D3DX11CompileEffectFromFile(
  2267.   pFileName: LPWSTR;
  2268.   pDefines: LPD3D_SHADER_MACRO;
  2269.   pInclude: ID3DInclude;
  2270.   HLSLFlags, FXFlags: UINT;
  2271.   const pDevice: ID3D11Device;
  2272.   out ppEffect: ID3DX11Effect;
  2273.   ppErrors: PID3DBlob = nil): HResult; stdcall; external d3fx11dll delayed;
  2274. {$EXTERNALSYM D3DX11CompileEffectFromFile}
  2275.  
  2276.   {$ENDREGION}
  2277.  
  2278. implementation
  2279.  
  2280. {$REGION 'DX11'}
  2281. //////////////////////////////////////////////////////////////////////////////
  2282. //
  2283. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  2284. //
  2285. //  File:       d3dx11.h
  2286. //  Content:    D3DX11 utility library
  2287. //
  2288. //////////////////////////////////////////////////////////////////////////////
  2289.  
  2290. // #define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
  2291. function MAKE_DDHRESULT(Code: DWord): DWord;
  2292. begin
  2293.   Result:= DWord((1 shl 31) or (_FACDD shl 16)) or Code;
  2294. end;
  2295.  
  2296. ///////////////////////////////////////////////////////////////////////////
  2297. //
  2298. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  2299. //
  2300. //  File:       d3dx11core.h
  2301. //  Content:    D3DX11 core types and functions
  2302. //
  2303. ///////////////////////////////////////////////////////////////////////////
  2304.  
  2305. // #define MAKE_D3DHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )
  2306. function MAKE_D3DHRESULT(Code: DWord): DWord;
  2307. begin
  2308.   Result:= DWord((1 shl 31) or (_FACD3D shl 16)) or Code;
  2309. end;
  2310.  
  2311. // #define MAKE_D3DSTATUS( code )  MAKE_HRESULT( 0, _FACD3D, code )
  2312. function MAKE_D3DSTATUS(Code: DWord): DWord;
  2313. begin
  2314.   Result:= DWord((0 shl 31) or (_FACD3D shl 16)) or Code;
  2315. end;
  2316. {$ENDREGION}
  2317.  
  2318. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement