Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {******************************************************************************}
- {* *}
- {* Copyright (C) Microsoft Corporation. All Rights Reserved. *}
- {* *}
- {* Files: D3DX11.h *}
- {* Content: D3DX11 include files *}
- {* *}
- {* DirectX Delphi / FreePascal adaptation by Alexey Barkovoy *}
- {* E-Mail: directx@clootie.ru *}
- {* *}
- {* Latest version can be downloaded from: *}
- {* http://www.clootie.ru *}
- {* http://sourceforge.net/projects/delphi-dx9sdk *}
- {* *}
- {*----------------------------------------------------------------------------*}
- {* $Id: $ }
- {******************************************************************************}
- // Original source contained in "Winapi.D3DX11.par"
- unit Winapi.D3DX11;
- {$ALIGN ON}
- {$MINENUMSIZE 4}
- {$WEAKPACKAGEUNIT}
- {$WARN SYMBOL_PLATFORM OFF}
- interface
- {$HPPEMIT '#include "D3DX10.h"'}
- {$HPPEMIT '#include "D3DX11.h"'}
- {$HPPEMIT '#include "d3dtypes.h"'}
- {$HPPEMIT '#include "d3dcommon.h"'}
- {$HPPEMIT '#include "d3d11shader.h"'}
- uses
- Winapi.Windows,Winapi.DxgiFormat, Winapi.D3D11, Winapi.D3DCommon, Winapi.D3D11Shader;
- type
- PHResult = ^HRESULT;
- {$REGION 'DX11'}
- const
- //////////// DLL export definitions ///////////////////////////////////////
- d3dx11_retail_DLL = 'd3dx11_43.dll';
- d3dx11_debug_DLL = 'd3dx11d_43.dll';
- d3dx11dll = d3dx11_retail_DLL;
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright (C) Microsoft Corporation. All Rights Reserved.
- //
- // File: d3dx11.h
- // Content: D3DX11 utility library
- //
- //////////////////////////////////////////////////////////////////////////////
- // Defines
- const
- D3DX11_DEFAULT = -1;
- {$EXTERNALSYM D3DX11_DEFAULT}
- D3DX11_FROM_FILE = -3;
- {$EXTERNALSYM D3DX11_FROM_FILE}
- DXGI_FORMAT_FROM_FILE = DXGI_FORMAT(-3);
- {$EXTERNALSYM DXGI_FORMAT_FROM_FILE}
- // Errors
- const
- _FACDD = $876;
- {$EXTERNALSYM _FACDD}
- // #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
- function MAKE_DDHRESULT(Code: DWord): DWord; inline;
- {$EXTERNALSYM MAKE_DDHRESULT}
- type
- _D3DX11_ERR = DWORD;
- {$EXTERNALSYM _D3DX11_ERR}
- const
- MAKE_DDHRESULT_R = (1 shl 31) or (_FACDD shl 16);
- const
- D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = HResult(MAKE_DDHRESULT_R or 2900);
- {$EXTERNALSYM D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER}
- D3DX11_ERR_INVALID_MESH = HResult(MAKE_DDHRESULT_R or 2901);
- {$EXTERNALSYM D3DX11_ERR_INVALID_MESH}
- D3DX11_ERR_CANNOT_ATTR_SORT = HResult(MAKE_DDHRESULT_R or 2902);
- {$EXTERNALSYM D3DX11_ERR_CANNOT_ATTR_SORT}
- D3DX11_ERR_SKINNING_NOT_SUPPORTED = HResult(MAKE_DDHRESULT_R or 2903);
- {$EXTERNALSYM D3DX11_ERR_SKINNING_NOT_SUPPORTED}
- D3DX11_ERR_TOO_MANY_INFLUENCES = HResult(MAKE_DDHRESULT_R or 2904);
- {$EXTERNALSYM D3DX11_ERR_TOO_MANY_INFLUENCES}
- D3DX11_ERR_INVALID_DATA = HResult(MAKE_DDHRESULT_R or 2905);
- {$EXTERNALSYM D3DX11_ERR_INVALID_DATA}
- D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = HResult(MAKE_DDHRESULT_R or 2906);
- {$EXTERNALSYM D3DX11_ERR_LOADED_MESH_HAS_NO_DATA}
- D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = HResult(MAKE_DDHRESULT_R or 2907);
- {$EXTERNALSYM D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT}
- D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = HResult(MAKE_DDHRESULT_R or 2908);
- {$EXTERNALSYM D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM}
- ///////////////////////////////////////////////////////////////////////////
- //
- // Copyright (C) Microsoft Corporation. All Rights Reserved.
- //
- // File: d3dx11core.h
- // Content: D3DX11 core types and functions
- //
- ///////////////////////////////////////////////////////////////////////////
- // Current name of the DLL shipped in the same SDK as this header.
- const
- D3DX11_DLL_W = d3dx11_retail_DLL;
- {$EXTERNALSYM D3DX11_DLL_W}
- D3DX11_DLL_A = d3dx11_retail_DLL;
- {$EXTERNALSYM D3DX11_DLL_A}
- D3DX11_DLL = d3dx11_retail_DLL;
- {$EXTERNALSYM D3DX11_DLL}
- ///////////////////////////////////////////////////////////////////////////
- // D3DX11_SDK_VERSION:
- // -----------------
- // This identifier is passed to D3DX11CheckVersion in order to ensure that an
- // application was built against the correct header files and lib files.
- // This number is incremented whenever a header (or other) change would
- // require applications to be rebuilt. If the version doesn't match,
- // D3DX11CreateVersion will return FALSE. (The number itself has no meaning.)
- ///////////////////////////////////////////////////////////////////////////
- const
- D3DX11_SDK_VERSION = 43;
- {$EXTERNALSYM D3DX11_SDK_VERSION}
- function D3DX11CheckVersion(D3DSdkVersion: UINT; D3DX11SdkVersion: UINT): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CheckVersion}
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11ThreadPump:
- //////////////////////////////////////////////////////////////////////////////
- type
- {$EXTERNALSYM ID3DX11DataLoader}
- ID3DX11DataLoader = class
- function Load(): HResult; virtual; stdcall; abstract;
- function Decompress(ppData: PPointer; pcBytes: PSIZE_T): HResult; virtual; stdcall; abstract;
- {$WARNINGS OFF}
- function Destroy(): HResult; virtual; stdcall; abstract;
- {$WARNINGS ON}
- end;
- {$EXTERNALSYM ID3DX11DataProcessor}
- ID3DX11DataProcessor = class
- function Process(pData: Pointer; cBytes: SIZE_T): HResult; virtual; stdcall; abstract;
- function CreateDeviceObject(out ppDataObject: Pointer): HResult; virtual; stdcall; abstract;
- {$WARNINGS OFF}
- function Destroy(): HResult; virtual; stdcall; abstract;
- {$WARNINGS ON}
- end;
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DX11ThreadPump);'}
- {$EXTERNALSYM ID3DX11ThreadPump}
- ID3DX11ThreadPump = interface (IUnknown)
- ['{C93FECFA-6967-478a-ABBC-402D90621FCB}']
- // ID3DX11ThreadPump
- function AddWorkItem(const pDataLoader: ID3DX11DataLoader; const pDataProcessor: ID3DX11DataProcessor; pHResult: PHRESULT; ppDeviceObject: PPointer): HResult; stdcall;
- function GetWorkItemCount(): UINT; stdcall;
- function WaitForAllItems(): HResult; stdcall;
- function ProcessDeviceWorkItems(iWorkItemCount: UINT): HResult; stdcall;
- function PurgeAllItems(): HResult; stdcall;
- function GetQueueStatus(pIoQueue: PUINT; pProcessQueue: PUINT; pDeviceQueue: PUINT): HResult; stdcall;
- end;
- function D3DX11CreateThreadPump(cIoThreads: UINT; cProcThreads: UINT; out ppThreadPump: ID3DX11ThreadPump): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateThreadPump}
- const
- _FACD3D = $876;
- {$EXTERNALSYM _FACD3D}
- // #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
- function MAKE_D3DHRESULT(Code: DWord): DWord;
- {$EXTERNALSYM MAKE_D3DHRESULT}
- // #define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
- function MAKE_D3DSTATUS(Code: DWord): DWord;
- {$EXTERNALSYM MAKE_D3DSTATUS}
- const
- MAKE_D3DHRESULT_R = (1 shl 31) or (_FACD3D shl 16);
- {$EXTERNALSYM MAKE_D3DHRESULT_R}
- const
- D3DERR_INVALIDCALL = HResult(MAKE_D3DHRESULT_R or 2156);
- {$EXTERNALSYM D3DERR_INVALIDCALL}
- D3DERR_WASSTILLDRAWING = HResult(MAKE_D3DHRESULT_R or 540);
- {$EXTERNALSYM D3DERR_WASSTILLDRAWING}
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright (C) Microsoft Corporation. All Rights Reserved.
- //
- // File: d3dx11tex.h
- // Content: D3DX11 texturing APIs
- //
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_FILTER flags:
- // ------------------
- //
- // A valid filter must contain one of these values:
- //
- // D3DX11_FILTER_NONE
- // No scaling or filtering will take place. Pixels outside the bounds
- // of the source image are assumed to be transparent black.
- // D3DX11_FILTER_POINT
- // Each destination pixel is computed by sampling the nearest pixel
- // from the source image.
- // D3DX11_FILTER_LINEAR
- // Each destination pixel is computed by linearly interpolating between
- // the nearest pixels in the source image. This filter works best
- // when the scale on each axis is less than 2.
- // D3DX11_FILTER_TRIANGLE
- // Every pixel in the source image contributes equally to the
- // destination image. This is the slowest of all the filters.
- // D3DX11_FILTER_BOX
- // Each pixel is computed by averaging a 2x2(x2) box pixels from
- // the source image. Only works when the dimensions of the
- // destination are half those of the source. (as with mip maps)
- //
- // And can be OR'd with any of these optional flags:
- //
- // D3DX11_FILTER_MIRROR_U
- // Indicates that pixels off the edge of the texture on the U-axis
- // should be mirrored, not wraped.
- // D3DX11_FILTER_MIRROR_V
- // Indicates that pixels off the edge of the texture on the V-axis
- // should be mirrored, not wraped.
- // D3DX11_FILTER_MIRROR_W
- // Indicates that pixels off the edge of the texture on the W-axis
- // should be mirrored, not wraped.
- // D3DX11_FILTER_MIRROR
- // Same as specifying D3DX11_FILTER_MIRROR_U | D3DX11_FILTER_MIRROR_V |
- // D3DX11_FILTER_MIRROR_V
- // D3DX11_FILTER_DITHER
- // Dithers the resulting image using a 4x4 order dither pattern.
- // D3DX11_FILTER_SRGB_IN
- // Denotes that the input data is in sRGB (gamma 2.2) colorspace.
- // D3DX11_FILTER_SRGB_OUT
- // Denotes that the output data is in sRGB (gamma 2.2) colorspace.
- // D3DX11_FILTER_SRGB
- // Same as specifying D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT
- //
- //----------------------------------------------------------------------------
- type
- D3DX11_FILTER_FLAG = Cardinal;
- {$EXTERNALSYM D3DX11_FILTER_FLAG}
- const
- D3DX11_FILTER_NONE = (1 shl 0);
- {$EXTERNALSYM D3DX11_FILTER_NONE}
- D3DX11_FILTER_POINT = (2 shl 0);
- {$EXTERNALSYM D3DX11_FILTER_POINT}
- D3DX11_FILTER_LINEAR = (3 shl 0);
- {$EXTERNALSYM D3DX11_FILTER_LINEAR}
- D3DX11_FILTER_TRIANGLE = (4 shl 0);
- {$EXTERNALSYM D3DX11_FILTER_TRIANGLE}
- D3DX11_FILTER_BOX = (5 shl 0);
- {$EXTERNALSYM D3DX11_FILTER_BOX}
- D3DX11_FILTER_MIRROR_U = (1 shl 16);
- {$EXTERNALSYM D3DX11_FILTER_MIRROR_U}
- D3DX11_FILTER_MIRROR_V = (2 shl 16);
- {$EXTERNALSYM D3DX11_FILTER_MIRROR_V}
- D3DX11_FILTER_MIRROR_W = (4 shl 16);
- {$EXTERNALSYM D3DX11_FILTER_MIRROR_W}
- D3DX11_FILTER_MIRROR = (7 shl 16);
- {$EXTERNALSYM D3DX11_FILTER_MIRROR}
- D3DX11_FILTER_DITHER = (1 shl 19);
- {$EXTERNALSYM D3DX11_FILTER_DITHER}
- D3DX11_FILTER_DITHER_DIFFUSION= (2 shl 19);
- {$EXTERNALSYM D3DX11_FILTER_DITHER_DIFFUSION}
- D3DX11_FILTER_SRGB_IN = (1 shl 21);
- {$EXTERNALSYM D3DX11_FILTER_SRGB_IN}
- D3DX11_FILTER_SRGB_OUT = (2 shl 21);
- {$EXTERNALSYM D3DX11_FILTER_SRGB_OUT}
- D3DX11_FILTER_SRGB = (3 shl 21);
- {$EXTERNALSYM D3DX11_FILTER_SRGB}
- //----------------------------------------------------------------------------
- // D3DX11_NORMALMAP flags:
- // ---------------------
- // These flags are used to control how D3DX11ComputeNormalMap generates normal
- // maps. Any number of these flags may be OR'd together in any combination.
- //
- // D3DX11_NORMALMAP_MIRROR_U
- // Indicates that pixels off the edge of the texture on the U-axis
- // should be mirrored, not wraped.
- // D3DX11_NORMALMAP_MIRROR_V
- // Indicates that pixels off the edge of the texture on the V-axis
- // should be mirrored, not wraped.
- // D3DX11_NORMALMAP_MIRROR
- // Same as specifying D3DX11_NORMALMAP_MIRROR_U | D3DX11_NORMALMAP_MIRROR_V
- // D3DX11_NORMALMAP_INVERTSIGN
- // Inverts the direction of each normal
- // D3DX11_NORMALMAP_COMPUTE_OCCLUSION
- // Compute the per pixel Occlusion term and encodes it into the alpha.
- // An Alpha of 1 means that the pixel is not obscured in anyway, and
- // an alpha of 0 would mean that the pixel is completly obscured.
- //
- //----------------------------------------------------------------------------
- type
- D3DX11_NORMALMAP_FLAG = Cardinal;
- {$EXTERNALSYM D3DX11_NORMALMAP_FLAG}
- const
- D3DX11_NORMALMAP_MIRROR_U = (1 shl 16);
- {$EXTERNALSYM D3DX11_NORMALMAP_MIRROR_U}
- D3DX11_NORMALMAP_MIRROR_V = (2 shl 16);
- {$EXTERNALSYM D3DX11_NORMALMAP_MIRROR_V}
- D3DX11_NORMALMAP_MIRROR = (3 shl 16);
- {$EXTERNALSYM D3DX11_NORMALMAP_MIRROR}
- D3DX11_NORMALMAP_INVERTSIGN = (8 shl 16);
- {$EXTERNALSYM D3DX11_NORMALMAP_INVERTSIGN}
- D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 shl 16);
- {$EXTERNALSYM D3DX11_NORMALMAP_COMPUTE_OCCLUSION}
- //----------------------------------------------------------------------------
- // D3DX11_CHANNEL flags:
- // -------------------
- // These flags are used by functions which operate on or more channels
- // in a texture.
- //
- // D3DX11_CHANNEL_RED
- // Indicates the red channel should be used
- // D3DX11_CHANNEL_BLUE
- // Indicates the blue channel should be used
- // D3DX11_CHANNEL_GREEN
- // Indicates the green channel should be used
- // D3DX11_CHANNEL_ALPHA
- // Indicates the alpha channel should be used
- // D3DX11_CHANNEL_LUMINANCE
- // Indicates the luminaces of the red green and blue channels should be
- // used.
- //
- //----------------------------------------------------------------------------
- type
- D3DX11_CHANNEL_FLAG = Cardinal;
- {$EXTERNALSYM D3DX11_CHANNEL_FLAG}
- const
- D3DX11_CHANNEL_RED = (1 shl 0);
- {$EXTERNALSYM D3DX11_CHANNEL_RED}
- D3DX11_CHANNEL_BLUE = (1 shl 1);
- {$EXTERNALSYM D3DX11_CHANNEL_BLUE}
- D3DX11_CHANNEL_GREEN = (1 shl 2);
- {$EXTERNALSYM D3DX11_CHANNEL_GREEN}
- D3DX11_CHANNEL_ALPHA = (1 shl 3);
- {$EXTERNALSYM D3DX11_CHANNEL_ALPHA}
- D3DX11_CHANNEL_LUMINANCE = (1 shl 4);
- {$EXTERNALSYM D3DX11_CHANNEL_LUMINANCE}
- //----------------------------------------------------------------------------
- // D3DX11_IMAGE_FILE_FORMAT:
- // ---------------------
- // This enum is used to describe supported image file formats.
- //
- //----------------------------------------------------------------------------
- type
- PD3DX11ImageFileFormat = ^TD3DX11ImageFileFormat;
- D3DX11_IMAGE_FILE_FORMAT =
- (
- D3DX11_IFF_BMP = 0,
- D3DX11_IFF_JPG = 1,
- D3DX11_IFF_PNG = 3,
- D3DX11_IFF_DDS = 4,
- D3DX11_IFF_TIFF = 10,
- D3DX11_IFF_GIF = 11,
- D3DX11_IFF_WMP = 12,
- D3DX11_IFF_FORCE_DWORD = $7fffffff
- );
- {$EXTERNALSYM D3DX11_IMAGE_FILE_FORMAT}
- TD3DX11ImageFileFormat = D3DX11_IMAGE_FILE_FORMAT;
- //----------------------------------------------------------------------------
- // D3DX11_SAVE_TEXTURE_FLAG:
- // ---------------------
- // This enum is used to support texture saving options.
- //
- //----------------------------------------------------------------------------
- type
- D3DX11_SAVE_TEXTURE_FLAG = Cardinal;
- {$EXTERNALSYM D3DX11_SAVE_TEXTURE_FLAG}
- const
- D3DX11_STF_USEINPUTBLOB = $0001;
- {$EXTERNALSYM D3DX11_STF_USEINPUTBLOB}
- //----------------------------------------------------------------------------
- // D3DX11_IMAGE_INFO:
- // ---------------
- // This structure is used to return a rough description of what the
- // the original contents of an image file looked like.
- //
- // Width
- // Width of original image in pixels
- // Height
- // Height of original image in pixels
- // Depth
- // Depth of original image in pixels
- // ArraySize
- // Array size in textures
- // MipLevels
- // Number of mip levels in original image
- // MiscFlags
- // Miscellaneous flags
- // Format
- // D3D format which most closely describes the data in original image
- // ResourceDimension
- // D3D11_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
- // D3D11_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
- // ImageFileFormat
- // D3DX11_IMAGE_FILE_FORMAT representing the format of the image file.
- //----------------------------------------------------------------------------
- type
- PD3DX11ImageInfo = ^TD3DX11ImageInfo;
- D3DX11_IMAGE_INFO = record
- Width: UINT;
- Height: UINT;
- Depth: UINT;
- ArraySize: UINT;
- MipLevels: UINT;
- MiscFlags: UINT;
- Format: DXGI_FORMAT;
- ResourceDimension: D3D11_RESOURCE_DIMENSION;
- ImageFileFormat: D3DX11_IMAGE_FILE_FORMAT;
- end;
- {$EXTERNALSYM D3DX11_IMAGE_INFO}
- TD3DX11ImageInfo = D3DX11_IMAGE_INFO;
- //////////////////////////////////////////////////////////////////////////////
- // Image File APIs ///////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_IMAGE_LOAD_INFO:
- // ---------------
- // This structure can be optionally passed in to texture loader APIs to
- // control how textures get loaded. Pass in D3DX11_DEFAULT for any of these
- // to have D3DX automatically pick defaults based on the source file.
- //
- // Width
- // Rescale texture to Width texels wide
- // Height
- // Rescale texture to Height texels high
- // Depth
- // Rescale texture to Depth texels deep
- // FirstMipLevel
- // First mip level to load
- // MipLevels
- // Number of mip levels to load after the first level
- // Usage
- // D3D11_USAGE flag for the new texture
- // BindFlags
- // D3D11 Bind flags for the new texture
- // CpuAccessFlags
- // D3D11 CPU Access flags for the new texture
- // MiscFlags
- // Reserved. Must be 0
- // Format
- // Resample texture to the specified format
- // Filter
- // Filter the texture using the specified filter (only when resampling)
- // MipFilter
- // Filter the texture mip levels using the specified filter (only if
- // generating mips)
- // pSrcInfo
- // (optional) pointer to a D3DX11_IMAGE_INFO structure that will get
- // populated with source image information
- //----------------------------------------------------------------------------
- type
- PD3DX11ImageLoadInfo = ^TD3DX11ImageLoadInfo;
- D3DX11_IMAGE_LOAD_INFO = record
- Width: UINT;
- Height: UINT;
- Depth: UINT;
- FirstMipLevel: UINT;
- MipLevels: UINT;
- Usage: D3D11_USAGE;
- BindFlags: UINT;
- CpuAccessFlags: UINT;
- MiscFlags: UINT;
- Format: DXGI_FORMAT;
- Filter: UINT;
- MipFilter: UINT;
- pSrcInfo: PD3DX11ImageInfo;
- end;
- {$EXTERNALSYM D3DX11_IMAGE_LOAD_INFO}
- TD3DX11ImageLoadInfo = D3DX11_IMAGE_LOAD_INFO;
- const
- D3DX11_IMAGE_LOAD_INFO_default : TD3DX11ImageLoadInfo =
- (
- Width : UINT(D3DX11_DEFAULT);
- Height : UINT(D3DX11_DEFAULT);
- Depth : UINT(D3DX11_DEFAULT);
- FirstMipLevel : UINT(D3DX11_DEFAULT);
- MipLevels : UINT(D3DX11_DEFAULT);
- Usage : D3D11_USAGE(D3DX11_DEFAULT);
- BindFlags : UINT(D3DX11_DEFAULT);
- CpuAccessFlags: UINT(D3DX11_DEFAULT);
- MiscFlags : UINT(D3DX11_DEFAULT);
- Format : DXGI_FORMAT_FROM_FILE;
- Filter : UINT(D3DX11_DEFAULT);
- MipFilter : UINT(D3DX11_DEFAULT);
- pSrcInfo : nil;
- );
- //-------------------------------------------------------------------------------
- // GetImageInfoFromFile/Resource/Memory:
- // ------------------------------
- // Fills in a D3DX11_IMAGE_INFO struct with information about an image file.
- //
- // Parameters:
- // pSrcFile
- // File name of the source image.
- // pSrcModule
- // Module where resource is located, or NULL for module associated
- // with image the os used to create the current process.
- // pSrcResource
- // Resource name.
- // pSrcData
- // Pointer to file in memory.
- // SrcDataSize
- // Size in bytes of file in memory.
- // pPump
- // Optional pointer to a thread pump object to use.
- // pSrcInfo
- // Pointer to a D3DX11_IMAGE_INFO structure to be filled in with the
- // description of the data in the source image file.
- // pHResult
- // Pointer to a memory location to receive the return value upon completion.
- // Maybe NULL if not needed.
- // If pPump != NULL, pHResult must be a valid memory location until the
- // the asynchronous execution completes.
- //-------------------------------------------------------------------------------
- function D3DX11GetImageInfoFromFile(
- pSrcFile: LPCWSTR;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: PD3DX11ImageInfo;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromFileW' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromFile}
- function D3DX11GetImageInfoFromFileA(
- pSrcFile: LPCSTR;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: PD3DX11ImageInfo;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromFileA' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromFileA}
- function D3DX11GetImageInfoFromFileW(
- pSrcFile: LPCWSTR;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: PD3DX11ImageInfo;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromFileW' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromFileW}
- function D3DX11GetImageInfoFromResource(
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: D3DX11_IMAGE_INFO;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromResourceW' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromResource}
- function D3DX11GetImageInfoFromResourceA(
- hSrcModule: HMODULE;
- pSrcResource: LPCSTR;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: D3DX11_IMAGE_INFO;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromResourceA' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromResourceA}
- function D3DX11GetImageInfoFromResourceW(
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: D3DX11_IMAGE_INFO;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromResourceW' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromResourceW}
- function D3DX11GetImageInfoFromMemory(
- pSrcData: Pointer;
- SrcDataSize: SIZE_T;
- pPump: ID3DX11ThreadPump;
- pSrcInfo: D3DX11_IMAGE_INFO;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11GetImageInfoFromMemory' delayed;
- {$EXTERNALSYM D3DX11GetImageInfoFromMemory}
- //////////////////////////////////////////////////////////////////////////////
- // Create/Save Texture APIs //////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11CreateTextureFromFile/Resource/Memory:
- // D3DX11CreateShaderResourceViewFromFile/Resource/Memory:
- // -----------------------------------
- // Create a texture object from a file or resource.
- //
- // Parameters:
- //
- // pDevice
- // The D3D device with which the texture is going to be used.
- // pSrcFile
- // File name.
- // hSrcModule
- // Module handle. if NULL, current module will be used.
- // pSrcResource
- // Resource name in module
- // pvSrcData
- // Pointer to file in memory.
- // SrcDataSize
- // Size in bytes of file in memory.
- // pLoadInfo
- // Optional pointer to a D3DX11_IMAGE_LOAD_INFO structure that
- // contains additional loader parameters.
- // pPump
- // Optional pointer to a thread pump object to use.
- // ppTexture
- // [out] Created texture object.
- // ppShaderResourceView
- // [out] Shader resource view object created.
- // pHResult
- // Pointer to a memory location to receive the return value upon completion.
- // Maybe NULL if not needed.
- // If pPump != NULL, pHResult must be a valid memory location until the
- // the asynchronous execution completes.
- //
- //----------------------------------------------------------------------------
- // FromFile
- function D3DX11CreateShaderResourceViewFromFile(
- const pDevice: ID3D11Device;
- pSrcFile: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromFileW' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromFile}
- function D3DX11CreateShaderResourceViewFromFileA(
- const pDevice: ID3D11Device;
- pSrcFile: LPCSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromFileA' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromFileA}
- function D3DX11CreateShaderResourceViewFromFileW(
- const pDevice: ID3D11Device;
- pSrcFile: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromFileW' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromFileW}
- function D3DX11CreateTextureFromFile(
- const pDevice: ID3D11Device;
- pSrcFile: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromFileW' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromFile}
- function D3DX11CreateTextureFromFileA(
- const pDevice: ID3D11Device;
- pSrcFile: LPCSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromFileA' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromFileA}
- function D3DX11CreateTextureFromFileW(
- const pDevice: ID3D11Device;
- pSrcFile: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromFileW' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromFileW}
- // FromResource (resources in dll/exes)
- function D3DX11CreateShaderResourceViewFromResource(
- const pDevice: ID3D11Device;
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromResourceW' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromResource}
- function D3DX11CreateShaderResourceViewFromResourceA(
- const pDevice: ID3D11Device;
- hSrcModule: HMODULE;
- pSrcResource: LPCSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromResourceA' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromResourceA}
- function D3DX11CreateShaderResourceViewFromResourceW(
- const pDevice: ID3D11Device;
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromResourceW' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromResourceW}
- function D3DX11CreateTextureFromResource(
- const pDevice: ID3D11Device;
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromResourceW' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromResource}
- function D3DX11CreateTextureFromResourceA(
- const pDevice: ID3D11Device;
- hSrcModule: HMODULE;
- pSrcResource: LPCSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromResourceA' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromResourceA}
- function D3DX11CreateTextureFromResourceW(
- const pDevice: ID3D11Device;
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromResourceW' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromResourceW}
- // FromFileInMemory
- function D3DX11CreateShaderResourceViewFromMemory(
- const pDevice: ID3D11Device;
- pSrcData: Pointer;
- SrcDataSize: SIZE_T;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppShaderResourceView: ID3D11ShaderResourceView;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateShaderResourceViewFromMemory' delayed;
- {$EXTERNALSYM D3DX11CreateShaderResourceViewFromMemory}
- function D3DX11CreateTextureFromMemory(
- const pDevice: ID3D11Device;
- pSrcData: Pointer;
- SrcDataSize: SIZE_T;
- pLoadInfo: PD3DX11ImageLoadInfo;
- pPump: ID3DX11ThreadPump;
- out ppTexture: ID3D11Resource;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CreateTextureFromMemory' delayed;
- {$EXTERNALSYM D3DX11CreateTextureFromMemory}
- //////////////////////////////////////////////////////////////////////////////
- // Misc Texture APIs /////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_TEXTURE_LOAD_INFO:
- // ------------------------
- //
- //----------------------------------------------------------------------------
- type
- PD3DX11_TextureLoadInfo = ^TD3DX11_TextureLoadInfo;
- _D3DX11_TEXTURE_LOAD_INFO = record
- pSrcBox: PD3D11_Box;
- pDstBox: PD3D11_Box;
- SrcFirstMip: UINT;
- DstFirstMip: UINT;
- NumMips: UINT;
- SrcFirstElement: UINT;
- DstFirstElement: UINT;
- NumElements: UINT;
- Filter: UINT;
- MipFilter: UINT;
- end;
- {$EXTERNALSYM _D3DX11_TEXTURE_LOAD_INFO}
- D3DX11_TEXTURE_LOAD_INFO = _D3DX11_TEXTURE_LOAD_INFO;
- {$EXTERNALSYM D3DX11_TEXTURE_LOAD_INFO}
- TD3DX11_TextureLoadInfo = _D3DX11_TEXTURE_LOAD_INFO;
- const
- D3DX11_TEXTURE_LOAD_INFO_default : TD3DX11_TextureLoadInfo =
- (
- pSrcBox : nil;
- pDstBox : nil;
- SrcFirstMip : 0;
- DstFirstMip : 0;
- NumMips : UINT(D3DX11_DEFAULT);
- SrcFirstElement : 0;
- DstFirstElement : 0;
- NumElements : UINT(D3DX11_DEFAULT);
- Filter : UINT(D3DX11_DEFAULT);
- MipFilter : UINT(D3DX11_DEFAULT);
- );
- //----------------------------------------------------------------------------
- // D3DX11LoadTextureFromTexture:
- // ----------------------------
- // Load a texture from a texture.
- //
- // Parameters:
- //
- //----------------------------------------------------------------------------
- function D3DX11LoadTextureFromTexture(
- pContext: ID3D11DeviceContext;
- pSrcTexture: ID3D11Resource;
- pLoadInfo: PD3DX11_TextureLoadInfo;
- pDstTexture: ID3D11Resource): HResult; stdcall; external d3dx11dll name 'D3DX11LoadTextureFromTexture' delayed;
- {$EXTERNALSYM D3DX11LoadTextureFromTexture}
- //----------------------------------------------------------------------------
- // D3DX11FilterTexture:
- // ------------------
- // Filters mipmaps levels of a texture.
- //
- // Parameters:
- // pBaseTexture
- // The texture object to be filtered
- // SrcLevel
- // The level whose image is used to generate the subsequent levels.
- // MipFilter
- // D3DX11_FILTER flags controlling how each miplevel is filtered.
- // Or D3DX11_DEFAULT for D3DX11_FILTER_BOX,
- //
- //----------------------------------------------------------------------------
- function D3DX11FilterTexture(
- pContext: ID3D11DeviceContext;
- pTexture: ID3D11Resource;
- SrcLevel: UINT;
- MipFilter: UINT): HResult; stdcall; external d3dx11dll name 'D3DX11FilterTexture' delayed;
- {$EXTERNALSYM D3DX11FilterTexture}
- //----------------------------------------------------------------------------
- // D3DX11SaveTextureToFile:
- // ----------------------
- // Save a texture to a file.
- //
- // Parameters:
- // pDestFile
- // File name of the destination file
- // DestFormat
- // D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
- // pSrcTexture
- // Source texture, containing the image to be saved
- //
- //----------------------------------------------------------------------------
- function D3DX11SaveTextureToFile(
- pContext: ID3D11DeviceContext;
- pSrcTexture: ID3D11Resource;
- DestFormat: D3DX11_IMAGE_FILE_FORMAT;
- pDestFile: LPCWSTR): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToFileW' delayed;
- {$EXTERNALSYM D3DX11SaveTextureToFile}
- function D3DX11SaveTextureToFileA(
- pContext: ID3D11DeviceContext;
- pSrcTexture: ID3D11Resource;
- DestFormat: D3DX11_IMAGE_FILE_FORMAT;
- pDestFile: LPCSTR): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToFileA' delayed;
- {$EXTERNALSYM D3DX11SaveTextureToFileA}
- function D3DX11SaveTextureToFileW(
- pContext: ID3D11DeviceContext;
- pSrcTexture: ID3D11Resource;
- DestFormat: D3DX11_IMAGE_FILE_FORMAT;
- pDestFile: LPCWSTR): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToFileW' delayed;
- {$EXTERNALSYM D3DX11SaveTextureToFileW}
- //----------------------------------------------------------------------------
- // D3DX11SaveTextureToMemory:
- // ----------------------
- // Save a texture to a blob.
- //
- // Parameters:
- // pSrcTexture
- // Source texture, containing the image to be saved
- // DestFormat
- // D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
- // ppDestBuf
- // address of a d3dxbuffer pointer to return the image data
- // Flags
- // optional flags
- //----------------------------------------------------------------------------
- function D3DX11SaveTextureToMemory(
- pContext: ID3D11DeviceContext;
- pSrcTexture: ID3D11Resource;
- DestFormat: D3DX11_IMAGE_FILE_FORMAT;
- out ppDestBuf: ID3DBlob;
- Flags: UINT): HResult; stdcall; external d3dx11dll name 'D3DX11SaveTextureToMemory' delayed;
- {$EXTERNALSYM D3DX11SaveTextureToMemory}
- //----------------------------------------------------------------------------
- // D3DX11ComputeNormalMap:
- // ---------------------
- // Converts a height map into a normal map. The (x,y,z) components of each
- // normal are mapped to the (r,g,b) channels of the output texture.
- //
- // Parameters
- // pSrcTexture
- // Pointer to the source heightmap texture
- // Flags
- // D3DX11_NORMALMAP flags
- // Channel
- // D3DX11_CHANNEL specifying source of height information
- // Amplitude
- // The constant value which the height information is multiplied by.
- // pDestTexture
- // Pointer to the destination texture
- //---------------------------------------------------------------------------
- function D3DX11ComputeNormalMap(
- pContext: ID3D11DeviceContext;
- pSrcTexture: ID3D11Texture2D;
- Flags: UINT;
- Channel: UINT;
- Amplitude: Single;
- pDestTexture: ID3D11Texture2D): HResult; stdcall; external d3dx11dll name 'D3DX11ComputeNormalMap' delayed;
- {$EXTERNALSYM D3DX11ComputeNormalMap}
- //----------------------------------------------------------------------------
- // D3DX11SHProjectCubeMap:
- // ----------------------
- // Projects a function represented in a cube map into spherical harmonics.
- //
- // Parameters:
- // Order
- // Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
- // pCubeMap
- // CubeMap that is going to be projected into spherical harmonics
- // pROut
- // Output SH vector for Red.
- // pGOut
- // Output SH vector for Green
- // pBOut
- // Output SH vector for Blue
- //
- //---------------------------------------------------------------------------
- function D3DX11SHProjectCubeMap(
- pContext: ID3D11DeviceContext;
- Order: UINT;
- pCubeMap: ID3D11Texture2D;
- pROut: PSingle;
- pGOut: PSingle;
- pBOut: PSingle): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11SHProjectCubeMap}
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //
- // File: D3DX11Async.h
- // Content: D3DX11 Asynchronous Shader loaders / compilers
- //
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11Compile:
- // ------------------
- // Compiles an effect or shader.
- //
- // Parameters:
- // pSrcFile
- // Source file name.
- // hSrcModule
- // Module handle. if NULL, current module will be used.
- // pSrcResource
- // Resource name in module.
- // pSrcData
- // Pointer to source code.
- // SrcDataLen
- // Size of source code, in bytes.
- // pDefines
- // Optional NULL-terminated array of preprocessor macro definitions.
- // pInclude
- // Optional interface pointer to use for handling #include directives.
- // If this parameter is NULL, #includes will be honored when compiling
- // from file, and will error when compiling from resource or memory.
- // pFunctionName
- // Name of the entrypoint function where execution should begin.
- // pProfile
- // Instruction set to be used when generating code. Currently supported
- // profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
- // "vs_3_sw", "vs_4_0", "vs_4_1",
- // "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
- // "ps_3_sw", "ps_4_0", "ps_4_1",
- // "gs_4_0", "gs_4_1",
- // "tx_1_0",
- // "fx_4_0", "fx_4_1"
- // Note that this entrypoint does not compile fx_2_0 targets, for that
- // you need to use the D3DX9 function.
- // Flags1
- // See D3D10_SHADER_xxx flags.
- // Flags2
- // See D3D10_EFFECT_xxx flags.
- // ppShader
- // Returns a buffer containing the created shader. This buffer contains
- // the compiled shader code, as well as any embedded debug and symbol
- // table info. (See D3D10GetShaderConstantTable)
- // ppErrorMsgs
- // Returns a buffer containing a listing of errors and warnings that were
- // encountered during the compile. If you are running in a debugger,
- // these are the same messages you will see in your debug output.
- // pHResult
- // Pointer to a memory location to receive the return value upon completion.
- // Maybe NULL if not needed.
- // If pPump != NULL, pHResult must be a valid memory location until the
- // the asynchronous execution completes.
- //----------------------------------------------------------------------------
- function D3DX11CompileFromFile(
- pSrcFile: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromFileW' delayed;
- {$EXTERNALSYM D3DX11CompileFromFile}
- function D3DX11CompileFromFileA(
- pSrcFile: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromFileA' delayed;
- {$EXTERNALSYM D3DX11CompileFromFileA}
- function D3DX11CompileFromFileW(
- pSrcFile: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromFileW' delayed;
- {$EXTERNALSYM D3DX11CompileFromFileW}
- function D3DX11CompileFromResource(
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pSrcFileName: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromResourceW' delayed;
- {$EXTERNALSYM D3DX11CompileFromResource}
- function D3DX11CompileFromResourceA(
- hSrcModule: HMODULE;
- pSrcResource: LPCSTR;
- pSrcFileName: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromResourceA' delayed;
- {$EXTERNALSYM D3DX11CompileFromResourceA}
- function D3DX11CompileFromResourceW(
- hSrcModule: HMODULE;
- pSrcResource: LPCWSTR;
- pSrcFileName: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11CompileFromResourceW' delayed;
- {$EXTERNALSYM D3DX11CompileFromResourceW}
- function D3DX11CompileFromMemory(
- pSrcData: LPCSTR;
- SrcDataLen: SIZE_T;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- pPump: ID3DX11ThreadPump;
- out ppShader: ID3DBlob;
- ppErrorMsgs: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CompileFromMemory}
- function D3DX11PreprocessShaderFromFile(
- pFileName: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromFileW' delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromFile}
- function D3DX11PreprocessShaderFromFileA(
- pFileName: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromFileA' delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromFileA}
- function D3DX11PreprocessShaderFromFileW(
- pFileName: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromFileW' delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromFileW}
- function D3DX11PreprocessShaderFromMemory(
- pSrcData: LPCSTR;
- SrcDataSize: SIZE_T;
- pFileName: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromMemory}
- function D3DX11PreprocessShaderFromResource(
- hModule: HMODULE;
- pResourceName: LPCWSTR;
- pSrcFileName: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromResourceW' delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromResource}
- function D3DX11PreprocessShaderFromResourceA(
- hModule: HMODULE;
- pResourceName: LPCSTR;
- pSrcFileName: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromResourceA' delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromResourceA}
- function D3DX11PreprocessShaderFromResourceW(
- hModule: HMODULE;
- pResourceName: LPCWSTR;
- pSrcFileName: LPCWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pPump: ID3DX11ThreadPump;
- out ppShaderText: ID3DBlob;
- ppErrors: PID3DBlob;
- pHResult: PHResult): HResult; stdcall; external d3dx11dll name 'D3DX11PreprocessShaderFromResourceW' delayed;
- {$EXTERNALSYM D3DX11PreprocessShaderFromResourceW}
- //----------------------------------------------------------------------------
- // Async processors
- //----------------------------------------------------------------------------
- function D3DX11CreateAsyncCompilerProcessor(
- pFileName: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- pFunctionName: LPCSTR;
- pProfile: LPCSTR;
- Flags1, Flags2: UINT;
- out ppCompiledShader: ID3DBlob;
- ppErrorBuffer: PID3DBlob;
- out ppProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateAsyncCompilerProcessor}
- function D3DX11CreateAsyncShaderPreprocessProcessor(
- pFileName: LPCSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- out ppShaderText: ID3DBlob;
- ppErrorBuffer: PID3DBlob;
- out ppProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateAsyncShaderPreprocessProcessor}
- //----------------------------------------------------------------------------
- // D3DX11 Asynchronous texture I/O (advanced mode)
- //----------------------------------------------------------------------------
- function D3DX11CreateAsyncFileLoader(pFileName: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncFileLoaderW' delayed;
- {$EXTERNALSYM D3DX11CreateAsyncFileLoader}
- function D3DX11CreateAsyncFileLoaderA(pFileName: LPCSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncFileLoaderA' delayed;
- {$EXTERNALSYM D3DX11CreateAsyncFileLoaderA}
- function D3DX11CreateAsyncFileLoaderW(pFileName: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncFileLoaderW' delayed;
- {$EXTERNALSYM D3DX11CreateAsyncFileLoaderW}
- function D3DX11CreateAsyncMemoryLoader(pData: Pointer; cbData: SIZE_T; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateAsyncMemoryLoader}
- function D3DX11CreateAsyncResourceLoader(hSrcModule: HMODULE; pSrcResource: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncResourceLoaderW' delayed;
- {$EXTERNALSYM D3DX11CreateAsyncResourceLoaderA}
- function D3DX11CreateAsyncResourceLoaderA(hSrcModule: HMODULE; pSrcResource: LPCSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncResourceLoaderA' delayed;
- {$EXTERNALSYM D3DX11CreateAsyncResourceLoaderA}
- function D3DX11CreateAsyncResourceLoaderW(hSrcModule: HMODULE; pSrcResource: LPCWSTR; out ppDataLoader: ID3DX11DataLoader): HResult; stdcall; external d3dx11dll name 'D3DX11CreateAsyncResourceLoaderW' delayed;
- {$EXTERNALSYM D3DX11CreateAsyncResourceLoaderA}
- function D3DX11CreateAsyncTextureProcessor(pDevice: ID3D11Device; pLoadInfo: PD3DX11ImageLoadInfo; out ppDataProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateAsyncTextureProcessor}
- function D3DX11CreateAsyncTextureInfoProcessor(pImageInfo: PD3DX11ImageLoadInfo; out ppDataProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateAsyncTextureInfoProcessor}
- function D3DX11CreateAsyncShaderResourceViewProcessor(pDevice: ID3D11Device; pLoadInfo: PD3DX11ImageLoadInfo; out ppDataProcessor: ID3DX11DataProcessor): HResult; stdcall; external d3dx11dll delayed;
- {$EXTERNALSYM D3DX11CreateAsyncShaderResourceViewProcessor}
- {$ENDREGION}
- {$REGION 'FX11'}
- const
- //////////// DLL export definitions ///////////////////////////////////////
- d3fx11dll = 'd3fx11.dll';
- type
- PD3DX11_StateBlockMask = ^TD3DX11_StateBlockMask;
- D3DX11_STATE_BLOCK_MASK = record
- VS: Byte;
- VSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
- VSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- VSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
- VSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
- HS: Byte;
- HSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
- HSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- HSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
- HSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
- DS: Byte;
- DSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
- DSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- DSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
- DSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
- GS: Byte;
- GSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
- GSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- GSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
- GSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
- PS: Byte;
- PSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
- PSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- PSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
- PSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
- PSUnorderedAccessViews: Byte;
- CS: Byte;
- CSSamplers: array[0..((D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 7) div 8) - 1] of Byte;
- CSShaderResources: array[0..((D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- CSConstantBuffers: array[0..((D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 7) div 8) - 1] of Byte;
- CSInterfaces: array[0..((D3D11_SHADER_MAX_INTERFACES + 7) div 8) - 1] of Byte;
- CSUnorderedAccessViews: Byte;
- IAVertexBuffers: array[0..((D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + 7) div 8) - 1] of Byte;
- IAIndexBuffer: Byte;
- IAInputLayout: Byte;
- IAPrimitiveTopology: Byte;
- OMRenderTargets: Byte;
- OMDepthStencilState: Byte;
- OMBlendState: Byte;
- RSViewports: Byte;
- RSScissorRects: Byte;
- RSRasterizerState: Byte;
- SOBuffers: Byte;
- Predication: Byte;
- end;
- {$EXTERNALSYM D3DX11_STATE_BLOCK_MASK}
- TD3DX11_StateBlockMask = D3DX11_STATE_BLOCK_MASK;
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT flags:
- // -------------------------------------
- //
- // These flags are passed in when creating an effect, and affect
- // the runtime effect behavior:
- //
- // (Currently none)
- //
- //
- // These flags are set by the effect runtime:
- //
- // D3DX11_EFFECT_OPTIMIZED
- // This effect has been optimized. Reflection functions that rely on
- // names/semantics/strings should fail. This is set when Optimize() is
- // called, but CEffect::IsOptimized() should be used to test for this.
- //
- // D3DX11_EFFECT_CLONE
- // This effect is a clone of another effect. Single CBs will never be
- // updated when internal variable values are changed.
- // This flag is not set when the D3DX11_EFFECT_CLONE_FORCE_NONSINGLE flag
- // is used in cloning.
- //
- //----------------------------------------------------------------------------
- const
- D3DX11_EFFECT_OPTIMIZED = (1 shl 21);
- {$EXTERNALSYM D3DX11_EFFECT_OPTIMIZED}
- D3DX11_EFFECT_CLONE = (1 shl 22);
- {$EXTERNALSYM D3DX11_EFFECT_CLONE}
- // Mask of valid D3DCOMPILE_EFFECT flags for D3DX11CreateEffect*
- D3DX11_EFFECT_RUNTIME_VALID_FLAGS = (0);
- {$EXTERNALSYM D3DX11_EFFECT_RUNTIME_VALID_FLAGS}
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT_VARIABLE flags:
- // ----------------------------
- //
- // These flags describe an effect variable (global or annotation),
- // and are returned in D3DX11_EFFECT_VARIABLE_DESC::Flags.
- //
- // D3DX11_EFFECT_VARIABLE_ANNOTATION
- // Indicates that this is an annotation on a technique, pass, or global
- // variable. Otherwise, this is a global variable. Annotations cannot
- // be shared.
- //
- // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
- // Indicates that the variable has been explicitly bound using the
- // register keyword.
- //----------------------------------------------------------------------------
- D3DX11_EFFECT_VARIABLE_ANNOTATION = (1 shl 1);
- {$EXTERNALSYM D3DX11_EFFECT_VARIABLE_ANNOTATION}
- D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT = (1 shl 2);
- {$EXTERNALSYM D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT}
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT_CLONE flags:
- // ----------------------------
- //
- // These flags modify the effect cloning process and are passed into Clone.
- //
- // D3DX11_EFFECT_CLONE_FORCE_NONSINGLE
- // Ignore all "single" qualifiers on cbuffers. All cbuffers will have their
- // own ID3D11Buffer's created in the cloned effect.
- //----------------------------------------------------------------------------
- D3DX11_EFFECT_CLONE_FORCE_NONSINGLE = (1 shl 0);
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectType //////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT_TYPE_DESC:
- //
- // Retrieved by ID3DX11EffectType::GetDesc()
- //----------------------------------------------------------------------------
- type
- PD3DX11_EffectTypeDesc = ^TD3DX11_EffectTypeDesc;
- D3DX11_EFFECT_TYPE_DESC = record
- TypeName: LPCSTR; // Name of the type
- // (e.g. "float4" or "MyStruct")
- Class_: TD3D_SHADER_VARIABLE_CLASS; // (e.g. scalar, vector, object, etc.)
- Type_: TD3D_SHADER_VARIABLE_TYPE; // (e.g. float, texture, vertexshader, etc.)
- Elements: UINT; // Number of elements in this type
- // (0 if not an array)
- Members: UINT; // Number of members
- // (0 if not a structure)
- Rows: UINT; // Number of rows in this type
- // (0 if not a numeric primitive)
- Columns: UINT; // Number of columns in this type
- // (0 if not a numeric primitive)
- PackedSize: UINT; // Number of bytes required to represent
- // this data type, when tightly packed
- UnpackedSize: UINT; // Number of bytes occupied by this data
- // type, when laid out in a constant buffer
- Stride: UINT; // Number of bytes to seek between elements,
- // when laid out in a constant buffer
- end;
- {$EXTERNALSYM D3DX11_EFFECT_TYPE_DESC}
- TD3DX11_EffectTypeDesc = D3DX11_EFFECT_TYPE_DESC;
- const
- IID_ID3DX11EffectType: TGUID = '{4250D721-D5E5-491F-B62B-587C43186285}';
- {$EXTERNALSYM IID_ID3DX11EffectType}
- type
- ID3DX11IUnknown = class
- function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; abstract;
- function _AddRef: Integer; virtual; stdcall; abstract;
- function _Release: Integer; virtual; stdcall; abstract;
- end;
- {$EXTERNALSYM ID3DX11EffectType}
- ID3DX11EffectType = class(ID3DX11IUnknown)
- function IsValid(): BOOL; virtual; stdcall; abstract;
- function GetDesc(out pDesc: TD3DX11_EffectTypeDesc): HResult; virtual; stdcall; abstract;
- function GetMemberTypeByIndex(Index: UINT): ID3DX11EffectType; virtual; stdcall; abstract;
- function GetMemberTypeByName(Name: LPCSTR): ID3DX11EffectType; virtual; stdcall; abstract;
- function GetMemberTypeBySemantic(Semantic: LPCSTR): ID3DX11EffectType; virtual; stdcall; abstract;
- function GetMemberName(Index: UINT): LPCSTR; virtual; stdcall; abstract;
- function GetMemberSemantic(Index: UINT): LPCSTR; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectVariable //////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT_VARIABLE_DESC:
- //
- // Retrieved by ID3DX11EffectVariable::GetDesc()
- //----------------------------------------------------------------------------
- PD3DX11_EffectVariableDesc = ^TD3DX11_EffectVariableDesc;
- D3DX11_EFFECT_VARIABLE_DESC = record
- Name: LPCSTR; // Name of this variable, annotation,
- // or structure member
- Semantic: LPCSTR; // Semantic string of this variable
- // or structure member (NULL for
- // annotations or if not present)
- Flags: UINT; // D3DX11_EFFECT_VARIABLE_* flags
- Annotations: UINT; // Number of annotations on this variable
- // (always 0 for annotations)
- BufferOffset: UINT; // Offset into containing cbuffer or tbuffer
- // (always 0 for annotations or variables
- // not in constant buffers)
- ExplicitBindPoint: UINT; // Used if the variable has been explicitly bound
- // using the register keyword. Check Flags for
- // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT;
- end;
- {$EXTERNALSYM D3DX11_EFFECT_VARIABLE_DESC}
- TD3DX11_EffectVariableDesc = D3DX11_EFFECT_VARIABLE_DESC;
- const
- IID_ID3DX11EffectVariable: TGUID = '{036A777D-B56E-4B25-B313-CC3DDAB71873}';
- {$EXTERNALSYM IID_ID3DX11EffectVariable}
- type
- ID3DX11EffectScalarVariable = class;
- ID3DX11EffectVectorVariable = class;
- ID3DX11EffectMatrixVariable = class;
- ID3DX11EffectStringVariable = class;
- ID3DX11EffectClassInstanceVariable = class;
- ID3DX11EffectInterfaceVariable = class;
- ID3DX11EffectShaderResourceVariable = class;
- ID3DX11EffectUnorderedAccessViewVariable = class;
- ID3DX11EffectRenderTargetViewVariable = class;
- ID3DX11EffectDepthStencilViewVariable = class;
- ID3DX11EffectConstantBuffer = class;
- ID3DX11EffectShaderVariable = class;
- ID3DX11EffectBlendVariable = class;
- ID3DX11EffectDepthStencilVariable = class;
- ID3DX11EffectRasterizerVariable = class;
- ID3DX11EffectSamplerVariable = class;
- {$EXTERNALSYM ID3DX11EffectVariable}
- ID3DX11EffectVariable = class(ID3DX11IUnknown)
- function IsValid(): BOOL; virtual; stdcall; abstract;
- function GetType(): ID3DX11EffectType; virtual; stdcall; abstract;
- function GetDesc(out pDesc: TD3DX11_EffectVariableDesc): HResult; virtual; stdcall; abstract;
- function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetMemberByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetMemberByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetMemberBySemantic(Semantic: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetElement(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetParentConstantBuffer(): ID3DX11EffectConstantBuffer; virtual; stdcall; abstract;
- function AsScalar(): ID3DX11EffectScalarVariable; virtual; stdcall; abstract;
- function AsVector(): ID3DX11EffectVectorVariable; virtual; stdcall; abstract;
- function AsMatrix(): ID3DX11EffectMatrixVariable; virtual; stdcall; abstract;
- function AsString(): ID3DX11EffectStringVariable; virtual; stdcall; abstract;
- function AsClassInstance(): ID3DX11EffectClassInstanceVariable; virtual; stdcall; abstract;
- function AsInterface(): ID3DX11EffectInterfaceVariable; virtual; stdcall; abstract;
- function AsShaderResource(): ID3DX11EffectShaderResourceVariable; virtual; stdcall; abstract;
- function AsUnorderedAccessView(): ID3DX11EffectShaderResourceVariable; virtual; stdcall; abstract;
- function AsRenderTargetView(): ID3DX11EffectRenderTargetViewVariable; virtual; stdcall; abstract;
- function AsDepthStencilView(): ID3DX11EffectDepthStencilViewVariable; virtual; stdcall; abstract;
- function AsConstantBuffer(): ID3DX11EffectConstantBuffer; virtual; stdcall; abstract;
- function AsShader(): ID3DX11EffectShaderVariable; virtual; stdcall; abstract;
- function AsBlend(): ID3DX11EffectBlendVariable; virtual; stdcall; abstract;
- function AsDepthStencil(): ID3DX11EffectDepthStencilVariable; virtual; stdcall; abstract;
- function AsRasterizer(): ID3DX11EffectRasterizerVariable; virtual; stdcall; abstract;
- function AsSampler(): ID3DX11EffectSamplerVariable; virtual; stdcall; abstract;
- function SetRawValue(const pData: Pointer; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetRawValue(pData: Pointer; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectScalarVariable ////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {921EF2E5-A65D-4E92-9FC6-4E9CC09A4ADE}
- //DEFINE_GUID(IID_ID3DX11EffectScalarVariable,
- //0x921ef2e5, 0xa65d, 0x4e92, 0x9f, 0xc6, 0x4e, 0x9c, 0xc0, 0x9a, 0x4a, 0xde);
- {$EXTERNALSYM ID3DX11EffectScalarVariable}
- ID3DX11EffectScalarVariable = class(ID3DX11EffectVariable)
- function SetFloat(Value: Single): HResult; virtual; stdcall; abstract;
- function GetFloat(out pValue: Single): HResult; virtual; stdcall; abstract;
- function SetFloatArray(const pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetFloatArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function SetInt(Value: Integer): HResult; virtual; stdcall; abstract;
- function GetInt(out pValue: Integer): HResult; virtual; stdcall; abstract;
- function SetIntArray(const pData: PInteger; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetIntArray(pData: PInteger; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function SetBool(Value: BOOL): HResult; virtual; stdcall; abstract;
- function GetBool(out pValue: BOOL): HResult; virtual; stdcall; abstract;
- function SetBoolArray(const pData: PBOOL; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetBoolArray(pData: PBOOL; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectVectorVariable ////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {5E785D4A-D87B-48D8-B6E6-0F8CA7E7467A}
- //DEFINE_GUID(IID_ID3DX11EffectVectorVariable,
- //0x5e785d4a, 0xd87b, 0x48d8, 0xb6, 0xe6, 0x0f, 0x8c, 0xa7, 0xe7, 0x46, 0x7a);
- {$EXTERNALSYM ID3DX11EffectVectorVariable}
- ID3DX11EffectVectorVariable = class(ID3DX11EffectVariable)
- procedure SetBoolVector(const pData: PBOOL); virtual; stdcall; abstract;
- procedure SetIntVector(const pData: PInteger); virtual; stdcall; abstract;
- function SetFloatVector(const pData: PSingle): HResult; virtual; stdcall; abstract;
- procedure GetBoolVector(pData: PBOOL); virtual; stdcall; abstract;
- procedure GetIntVector(pData: PInteger); virtual; stdcall; abstract;
- function GetFloatVector(pData: PSingle): HResult; virtual; stdcall; abstract;
- procedure SetBoolVectorArray(const pData: PBOOL; Offset, Count: UINT); virtual; stdcall; abstract;
- procedure SetIntVectorArray(const pData: PInteger; Offset, Count: UINT); virtual; stdcall; abstract;
- function SetFloatVectorArray(const pData: PSingle; Offset: UINT; Count: UINT): HResult; virtual; stdcall; abstract;
- procedure GetBoolVectorArray(pData: PBOOL; Offset, Count: UINT); virtual; stdcall; abstract;
- procedure GetIntVectorArray(pData: PInteger; Offset, Count: UINT); virtual; stdcall; abstract;
- function GetFloatVectorArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectMatrixVariable ////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {E1096CF4-C027-419A-8D86-D29173DC803E}
- //DEFINE_GUID(IID_ID3DX11EffectMatrixVariable,
- //0xe1096cf4, 0xc027, 0x419a, 0x8d, 0x86, 0xd2, 0x91, 0x73, 0xdc, 0x80, 0x3e);
- {$EXTERNALSYM ID3DX11EffectMatrixVariable}
- ID3DX11EffectMatrixVariable = class(ID3DX11EffectVariable)
- function SetMatrix(const pData: PSingle): HResult; virtual; stdcall; abstract;
- function GetMatrix(pData: PSingle): HResult; virtual; stdcall; abstract;
- function SetMatrixPointerArray(const ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
- function GetMatrixPointerArray(out ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
- function SetMatrixArray(const pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetMatrixArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function SetMatrixTranspose(pData: PSingle): HResult; virtual; stdcall; abstract;
- function GetMatrixTranspose(pData: PSingle): HResult; virtual; stdcall; abstract;
- function SetMatrixTransposeArray(const pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetMatrixTransposeArray(pData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function SetMatrixTransposePointerArray(const ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
- function GetMatrixTransposePointerArray(out ppData: PSingle; Offset, Count: UINT): HResult; virtual; stdcall; abstract; //experimental; debug required
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectStringVariable ////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {F355C818-01BE-4653-A7CC-60FFFEDDC76D}
- //DEFINE_GUID(IID_ID3DX11EffectStringVariable,
- //0xf355c818, 0x01be, 0x4653, 0xa7, 0xcc, 0x60, 0xff, 0xfe, 0xdd, 0xc7, 0x6d);
- {$EXTERNALSYM ID3DX11EffectStringVariable}
- ID3DX11EffectStringVariable = class(ID3DX11EffectVariable)
- function GetString(ppString: LPCSTR): HResult; virtual; stdcall; abstract;
- function GetStringArray(ppStrings: LPCSTR; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectClassInstanceVariable ////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {926A8053-2A39-4DB4-9BDE-CF649ADEBDC1}
- //DEFINE_GUID(IID_ID3DX11EffectClassInstanceVariable,
- //0x926a8053, 0x2a39, 0x4db4, 0x9b, 0xde, 0xcf, 0x64, 0x9a, 0xde, 0xbd, 0xc1);
- {$EXTERNALSYM ID3DX11EffectClassInstanceVariable}
- ID3DX11EffectClassInstanceVariable = class(ID3DX11EffectVariable)
- function GetClassInstance(out ppClassInstance: ID3D11ClassInstance): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectInterfaceVariable ////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {516C8CD8-1C80-40A4-B19B-0688792F11A5}
- //DEFINE_GUID(IID_ID3DX11EffectInterfaceVariable,
- //0x516c8cd8, 0x1c80, 0x40a4, 0xb1, 0x9b, 0x06, 0x88, 0x79, 0x2f, 0x11, 0xa5);
- {$EXTERNALSYM ID3DX11EffectInterfaceVariable}
- ID3DX11EffectInterfaceVariable = class(ID3DX11EffectVariable)
- function SetClassInstance(pEffectClassInstance: ID3DX11EffectClassInstanceVariable): HResult; virtual; stdcall; abstract;
- function GetClassInstance(out ppEffectClassInstance: ID3DX11EffectClassInstanceVariable): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectShaderResourceVariable ////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {350DB233-BBE0-485C-9BFE-C0026B844F89}
- //DEFINE_GUID(IID_ID3DX11EffectShaderResourceVariable,
- //0x350db233, 0xbbe0, 0x485c, 0x9b, 0xfe, 0xc0, 0x02, 0x6b, 0x84, 0x4f, 0x89);
- PID3D11ShaderResourceView = ^ID3D11ShaderResourceView;
- {$EXTERNALSYM ID3DX11EffectShaderResourceVariable}
- ID3DX11EffectShaderResourceVariable = class(ID3DX11EffectVariable)
- function SetResource(const pResource: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
- function GetResource(out ppResource: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
- function SetResourceArray(const ppResources: PID3D11ShaderResourceView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetResourceArray(ppResources: PID3D11ShaderResourceView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectUnorderedAccessViewVariable ////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {79B4AC8C-870A-47D2-B05A-8BD5CC3EE6C9}
- //DEFINE_GUID(IID_ID3DX11EffectUnorderedAccessViewVariable,
- //0x79b4ac8c, 0x870a, 0x47d2, 0xb0, 0x5a, 0x8b, 0xd5, 0xcc, 0x3e, 0xe6, 0xc9);
- PID3D11UnorderedAccessView = ^ID3D11UnorderedAccessView;
- {$EXTERNALSYM ID3DX11EffectUnorderedAccessViewVariable}
- ID3DX11EffectUnorderedAccessViewVariable = class(ID3DX11EffectVariable)
- function SetUnorderedAccessView(const pResource: ID3D11UnorderedAccessView): HResult; virtual; stdcall; abstract;
- function GetUnorderedAccessView(out ppResource: ID3D11UnorderedAccessView): HResult; virtual; stdcall; abstract;
- function SetUnorderedAccessViewArray(const ppResources: PID3D11UnorderedAccessView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetUnorderedAccessViewArray(ppResources: PID3D11UnorderedAccessView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectRenderTargetViewVariable //////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {D5066909-F40C-43F8-9DB5-057C2A208552}
- //DEFINE_GUID(IID_ID3DX11EffectRenderTargetViewVariable,
- //0xd5066909, 0xf40c, 0x43f8, 0x9d, 0xb5, 0x05, 0x7c, 0x2a, 0x20, 0x85, 0x52);
- PID3D11RenderTargetView = ^ID3D11RenderTargetView;
- {$EXTERNALSYM ID3DX11EffectRenderTargetViewVariable}
- ID3DX11EffectRenderTargetViewVariable = class(ID3DX11EffectVariable)
- function SetRenderTarget(const pResource: ID3D11RenderTargetView): HResult; virtual; stdcall; abstract;
- function GetRenderTarget(out ppResource: ID3D11RenderTargetView): HResult; virtual; stdcall; abstract;
- function SetRenderTargetArray(const ppResources: PID3D11RenderTargetView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetRenderTargetArray(ppResources: PID3D11RenderTargetView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectDepthStencilViewVariable //////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {33C648AC-2E9E-4A2E-9CD6-DE31ACC5B347}
- //DEFINE_GUID(IID_ID3DX11EffectDepthStencilViewVariable,
- //0x33c648ac, 0x2e9e, 0x4a2e, 0x9c, 0xd6, 0xde, 0x31, 0xac, 0xc5, 0xb3, 0x47);
- PID3D11DepthStencilView = ^ID3D11DepthStencilView;
- {$EXTERNALSYM ID3DX11EffectDepthStencilViewVariable}
- ID3DX11EffectDepthStencilViewVariable = class(ID3DX11EffectVariable)
- function SetDepthStencil(const pResource: ID3D11DepthStencilView): HResult; virtual; stdcall; abstract;
- function GetDepthStencil(out ppResource: ID3D11DepthStencilView): HResult; virtual; stdcall; abstract;
- function SetDepthStencilArray(const ppResources: PID3D11DepthStencilView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- function GetDepthStencilArray(ppResources: PID3D11DepthStencilView; Offset, Count: UINT): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectConstantBuffer ////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {2CB6C733-82D2-4000-B3DA-6219D9A99BF2}
- //DEFINE_GUID(IID_ID3DX11EffectConstantBuffer,
- //0x2cb6c733, 0x82d2, 0x4000, 0xb3, 0xda, 0x62, 0x19, 0xd9, 0xa9, 0x9b, 0xf2);
- {$EXTERNALSYM ID3DX11EffectConstantBuffer}
- ID3DX11EffectConstantBuffer = class(ID3DX11EffectVariable)
- function SetConstantBuffer(const pConstantBuffer: ID3D11Buffer): HResult; virtual; stdcall; abstract;
- function UndoSetConstantBuffer: HResult; virtual; stdcall; abstract;
- function GetConstantBuffer(out ppConstantBuffer: ID3D11Buffer): HResult; virtual; stdcall; abstract;
- function SetTextureBuffer(const pTextureBuffer: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
- function UndoSetTextureBuffer: HResult; virtual; stdcall; abstract;
- function GetTextureBuffer(out ppTextureBuffer: ID3D11ShaderResourceView): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectShaderVariable ////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT_SHADER_DESC:
- //
- // Retrieved by ID3DX11EffectShaderVariable::GetShaderDesc()
- //----------------------------------------------------------------------------
- PD3DX11_EffectShaderDesc = ^TD3DX11_EffectShaderDesc;
- D3DX11_EFFECT_SHADER_DESC = record
- pInputSignature: PByte; // Passed into CreateInputLayout,
- // valid on VS and GS only
- IsInline: BOOL; // Is this an anonymous shader variable
- // resulting from an inline shader assignment?
- // -- The following fields are not valid after Optimize() --
- pBytecode: PByte; // Shader bytecode
- BytecodeLength: UINT;
- SODecls: array[0..D3D11_SO_STREAM_COUNT-1] of LPCSTR; // Stream out declaration string (for GS with SO)
- RasterizedStream: UINT;
- NumInputSignatureEntries: UINT; // Number of entries in the input signature
- NumOutputSignatureEntries: UINT; // Number of entries in the output signature
- NumPatchConstantSignatureEntries: UINT; // Number of entries in the patch constant signature
- end;
- {$EXTERNALSYM D3DX11_EFFECT_SHADER_DESC}
- TD3DX11_EffectShaderDesc = D3DX11_EFFECT_SHADER_DESC;
- // {7508B344-020A-4EC7-9118-62CDD36C88D7}
- //DEFINE_GUID(IID_ID3DX11EffectShaderVariable,
- //0x7508b344, 0x020a, 0x4ec7, 0x91, 0x18, 0x62, 0xcd, 0xd3, 0x6c, 0x88, 0xd7);
- {$EXTERNALSYM ID3DX11EffectShaderVariable}
- ID3DX11EffectShaderVariable = class(ID3DX11EffectVariable)
- function GetShaderDesc(ShaderIndex: UINT; out pDesc: TD3DX11_EffectShaderDesc): HResult; virtual; stdcall; abstract;
- function GetVertexShader(ShaderIndex: UINT; out ppVS: ID3D11VertexShader): HResult; virtual; stdcall; abstract;
- function GetGeometryShader(ShaderIndex: UINT; out ppGS: ID3D11GeometryShader): HResult; virtual; stdcall; abstract;
- function GetPixelShader(ShaderIndex: UINT; out ppPS: ID3D11PixelShader): HResult; virtual; stdcall; abstract;
- function GetHullShader(ShaderIndex: UINT; out ppHS: ID3D11HullShader): HResult; virtual; stdcall; abstract;
- function GetDomainShader(ShaderIndex: UINT; out ppDS: ID3D11DomainShader): HResult; virtual; stdcall; abstract;
- function GetComputeShader(ShaderIndex: UINT; out ppCS: ID3D11ComputeShader): HResult; virtual; stdcall; abstract;
- function GetInputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D11SignatureParameterDesc): HResult; virtual; stdcall; abstract;
- function GetOutputSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D11SignatureParameterDesc): HResult; virtual; stdcall; abstract;
- function GetPatchConstantSignatureElementDesc(ShaderIndex: UINT; Element: UINT; out pDesc: TD3D11SignatureParameterDesc): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectBlendVariable /////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {D664F4D7-3B81-4805-B277-C1DF58C39F53}
- //DEFINE_GUID(IID_ID3DX11EffectBlendVariable,
- //0xd664f4d7, 0x3b81, 0x4805, 0xb2, 0x77, 0xc1, 0xdf, 0x58, 0xc3, 0x9f, 0x53);
- {$EXTERNALSYM ID3DX11EffectBlendVariable}
- ID3DX11EffectBlendVariable = class(ID3DX11EffectVariable)
- function GetBlendState(Index: UINT; out ppBlendState: ID3D11BlendState): HResult; virtual; stdcall; abstract;
- function SetBlendState(Index: UINT; const pBlendState: ID3D11BlendState): HResult; virtual; stdcall; abstract;
- function UndoSetBlendState(Index: UINT): HResult; virtual; stdcall; abstract;
- function GetBackingStore(Index: UINT; out pBlendDesc: D3D11_BLEND_DESC): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectDepthStencilVariable //////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- ///
- // {69B5751B-61A5-48E5-BD41-D93988111563}
- //DEFINE_GUID(IID_ID3DX11EffectDepthStencilVariable,
- //0x69b5751b, 0x61a5, 0x48e5, 0xbd, 0x41, 0xd9, 0x39, 0x88, 0x11, 0x15, 0x63);
- {$EXTERNALSYM ID3DX11EffectDepthStencilVariable}
- ID3DX11EffectDepthStencilVariable = class(ID3DX11EffectVariable)
- function GetDepthStencilState(Index: UINT; out ppDepthStencilState: ID3D11DepthStencilState): HResult; virtual; stdcall; abstract;
- function SetDepthStencilState(Index: UINT; const ppDepthStencilState: ID3D11DepthStencilState): HResult; virtual; stdcall; abstract;
- function UndoSetDepthStencilState(Index: UINT): HResult; virtual; stdcall; abstract;
- function GetBackingStore(Index: UINT; out pDepthStencilDesc: D3D11_DEPTH_STENCIL_DESC): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectRasterizerVariable ////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {53A262F6-5F74-4151-A132-E3DD19A62C9D}
- //DEFINE_GUID(IID_ID3DX11EffectRasterizerVariable,
- //0x53a262f6, 0x5f74, 0x4151, 0xa1, 0x32, 0xe3, 0xdd, 0x19, 0xa6, 0x2c, 0x9d);
- {$EXTERNALSYM ID3DX11EffectRasterizerVariable}
- ID3DX11EffectRasterizerVariable = class(ID3DX11EffectVariable)
- function GetRasterizerState(Index: UINT; out ppRasterizerState: ID3D11RasterizerState): HResult; virtual; stdcall; abstract;
- function SetRasterizerState(Index: UINT; const pRasterizerState: ID3D11RasterizerState): HResult; virtual; stdcall; abstract;
- function UndoSetRasterizerState(Index: UINT): HResult; virtual; stdcall; abstract;
- function GetBackingStore(Index: UINT; out pRasterizerDesc: D3D11_RASTERIZER_DESC): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectSamplerVariable ///////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // {C6402E55-1095-4D95-8931-F92660513DD9}
- //DEFINE_GUID(IID_ID3DX11EffectSamplerVariable,
- //0xc6402e55, 0x1095, 0x4d95, 0x89, 0x31, 0xf9, 0x26, 0x60, 0x51, 0x3d, 0xd9);
- {$EXTERNALSYM ID3DX11EffectSamplerVariable}
- ID3DX11EffectSamplerVariable = class(ID3DX11EffectVariable)
- function GetSampler(Index: UINT; out ppSampler: ID3D11SamplerState): HResult; virtual; stdcall; abstract;
- function SetSampler(Index: UINT; const pSampler: ID3D11SamplerState): HResult; virtual; stdcall; abstract;
- function UndoSetSampler(Index: UINT): HResult; virtual; stdcall; abstract;
- function GetBackingStore(Index: UINT; out pSamplerDesc: D3D11_SAMPLER_DESC): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectPass //////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_PASS_DESC:
- //
- // Retrieved by ID3DX11EffectPass::GetDesc()
- //----------------------------------------------------------------------------
- PD3DX11_PassDesc = ^TD3DX11_PassDesc;
- D3DX11_PASS_DESC = record
- Name: LPCSTR; // Name of this pass (NULL if not anonymous)
- Annotations: UINT; // Number of annotations on this pass
- pIAInputSignature: PByte; // Signature from VS or GS (if there is no VS)
- // or NULL if neither exists
- IAInputSignatureSize: SIZE_T; // Singature size in bytes
- StencilRef: UINT; // Specified in SetDepthStencilState()
- SampleMask: UINT; // Specified in SetBlendState()
- BlendFactor: TFourSingleArray; // Specified in SetBlendState()
- end;
- {$EXTERNALSYM D3DX11_PASS_DESC}
- TD3DX11_PassDesc = D3DX11_PASS_DESC;
- //----------------------------------------------------------------------------
- // D3DX11_PASS_SHADER_DESC:
- //
- // Retrieved by ID3DX11EffectPass::Get**ShaderDesc()
- //----------------------------------------------------------------------------
- PD3DX11_PassShaderDesc = ^TD3DX11_PassShaderDesc;
- D3DX11_PASS_SHADER_DESC = record
- pShaderVariable: ID3DX11EffectShaderVariable; // The variable that this shader came from.
- // If this is an inline shader assignment,
- // the returned interface will be an
- // anonymous shader variable, which is
- // not retrievable any other way. It's
- // name in the variable description will
- // be "$Anonymous".
- // If there is no assignment of this type in
- // the pass block, pShaderVariable != NULL,
- // but pShaderVariable->IsValid() == FALSE.
- ShaderIndex: UINT; // The element of pShaderVariable (if an array)
- // or 0 if not applicable
- end;
- {$EXTERNALSYM D3DX11_PASS_SHADER_DESC}
- TD3DX11_PassShaderDesc = D3DX11_PASS_SHADER_DESC;
- // {3437CEC4-4AC1-4D87-8916-F4BD5A41380C}
- //DEFINE_GUID(IID_ID3DX11EffectPass,
- //0x3437cec4, 0x4ac1, 0x4d87, 0x89, 0x16, 0xf4, 0xbd, 0x5a, 0x41, 0x38, 0x0c);
- {$EXTERNALSYM ID3DX11EffectPass}
- ID3DX11EffectPass = class(ID3DX11IUnknown)
- function IsValid(): BOOL; virtual; stdcall; abstract;
- function GetDesc(out pDesc: TD3DX11_PassDesc): HResult; virtual; stdcall; abstract;
- function GetVertexShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
- function GetGeometryShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
- function GetPixelShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
- function GetHullShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
- function GetDomainShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
- function GetComputeShaderDesc(out pDesc: TD3DX11_PassShaderDesc): HResult; virtual; stdcall; abstract;
- function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function Apply(Flags: UINT; pContext: ID3D11DeviceContext): HResult; virtual; stdcall; abstract;
- function ComputeStateBlockMask(out pStateBlockMask: TD3DX11_StateBlockMask): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectTechnique /////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_TECHNIQUE_DESC:
- //
- // Retrieved by ID3DX11EffectTechnique::GetDesc()
- //----------------------------------------------------------------------------
- PD3DX11_TechniqueDesc = ^TD3DX11_TechniqueDesc;
- D3DX11_TECHNIQUE_DESC = record
- Name: LPCSTR; // Name of this technique (NULL if not anonymous)
- Passes: UINT; // Number of passes contained within
- Annotations: UINT; // Number of annotations on this technique
- end;
- {$EXTERNALSYM D3DX11_TECHNIQUE_DESC}
- TD3DX11_TechniqueDesc = D3DX11_TECHNIQUE_DESC;
- // {51198831-1F1D-4F47-BD76-41CB0835B1DE}
- //DEFINE_GUID(IID_ID3DX11EffectTechnique,
- //0x51198831, 0x1f1d, 0x4f47, 0xbd, 0x76, 0x41, 0xcb, 0x08, 0x35, 0xb1, 0xde);
- {$EXTERNALSYM ID3DX11EffectTechnique}
- ID3DX11EffectTechnique = class(ID3DX11IUnknown)
- function IsValid(): BOOL; virtual; stdcall; abstract;
- function GetDesc(out pDesc: TD3DX11_TechniqueDesc): HResult; virtual; stdcall; abstract;
- function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetPassByIndex(Index: UINT): ID3DX11EffectPass; virtual; stdcall; abstract;
- function GetPassByName(Name: LPCSTR): ID3DX11EffectPass; virtual; stdcall; abstract;
- function ComputeStateBlockMask(out pStateBlockMask: TD3DX11_StateBlockMask): HResult; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11EffectTechnique /////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_GROUP_DESC:
- //
- // Retrieved by ID3DX11EffectTechnique::GetDesc()
- //----------------------------------------------------------------------------
- PD3DX11_GroupDesc = ^TD3DX11_GroupDesc;
- D3DX11_GROUP_DESC = record
- Name: LPCSTR; // Name of this group (only nullptr if global
- Techniques: UINT; // Number of techniques contained within
- Annotations: UINT; // Number of annotations on this group
- end;
- {$EXTERNALSYM D3DX11_GROUP_DESC}
- TD3DX11_GroupDesc = D3DX11_GROUP_DESC;
- // {03074acf-97de-485f-b201-cb775264afd6}
- //DEFINE_GUID(IID_ID3DX11EffectGroup,
- //0x03074acf, 0x97de, 0x485f, 0xb2, 0x01, 0xcb, 0x77, 0x52, 0x64, 0xaf, 0xd6);
- {$EXTERNALSYM ID3DX11EffectGroup}
- ID3DX11EffectGroup = class(ID3DX11IUnknown)
- function IsValid(): BOOL; virtual; stdcall; abstract;
- function GetDesc(out pDesc: TD3DX11_GroupDesc): HResult; virtual; stdcall; abstract;
- function GetAnnotationByIndex(Index: UINT): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetAnnotationByName(Name: LPCSTR): ID3DX11EffectVariable; virtual; stdcall; abstract;
- function GetTechniqueByIndex(Index: UINT): ID3DX11EffectPass; virtual; stdcall; abstract;
- function GetTechniqueByName(Name: LPCSTR): ID3DX11EffectPass; virtual; stdcall; abstract;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // ID3DX11Effect //////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11_EFFECT_DESC:
- //
- // Retrieved by ID3DX11Effect::GetDesc()
- //----------------------------------------------------------------------------
- PD3DX11_EffectDesc = ^TD3DX11_EffectDesc;
- D3DX11_EFFECT_DESC = record
- ConstantBuffers: UINT; // Number of constant buffers in this effect
- GlobalVariables: UINT; // Number of global variables in this effect
- InterfaceVariables: UINT; // Number of global interfaces in this effect
- Techniques: UINT; // Number of techniques in this effect
- Groups: UINT; // Number of groups in this effect
- end;
- {$EXTERNALSYM D3DX11_EFFECT_DESC}
- TD3DX11_EffectDesc = D3DX11_EFFECT_DESC;
- // {FA61CA24-E4BA-4262-9DB8-B132E8CAE319}
- //DEFINE_GUID(IID_ID3DX11Effect,
- //0xfa61ca24, 0xe4ba, 0x4262, 0x9d, 0xb8, 0xb1, 0x32, 0xe8, 0xca, 0xe3, 0x19);
- {$EXTERNALSYM ID3DX11Effect}
- ID3DX11Effect = interface (IUnknown)
- ['{FA61CA24-E4BA-4262-9DB8-B132E8CAE319}']
- function IsValid(): BOOL; stdcall;
- function GetDevice(out ppDevice: ID3D11Device): HResult; stdcall;
- function GetDesc(out pDesc: TD3DX11_EffectDesc): HResult; stdcall;
- function GetConstantBufferByIndex(Index: UINT): ID3DX11EffectConstantBuffer; stdcall;
- function GetConstantBufferByName(Name: LPCSTR): ID3DX11EffectConstantBuffer; stdcall;
- function GetVariableByIndex(Index: UINT): ID3DX11EffectVariable; stdcall;
- function GetVariableByName(Name: LPCSTR): ID3DX11EffectVariable; stdcall;
- function GetVariableBySemantic(Semantic: LPCSTR): ID3DX11EffectVariable; stdcall;
- function GetGroupByIndex(Index: UINT): ID3DX11EffectGroup; stdcall;
- function GetGroupByName(Name: LPCSTR): ID3DX11EffectGroup; stdcall;
- function GetTechniqueByIndex(Index: UINT): ID3DX11EffectTechnique; stdcall;
- function GetTechniqueByName(Name: LPCSTR): ID3DX11EffectTechnique; stdcall;
- function GetClassLinkage: Pointer {ID3D11ClassLinkage;} stdcall; experimental; //C++ returns in RAX
- function CloneEffect(Flags: UINT32; out ppClonedEffect: ID3DX11Effect): HResult; stdcall;
- function Optimize(): HResult; stdcall;
- function IsOptimized(): BOOL; stdcall;
- end;
- //////////////////////////////////////////////////////////////////////////////
- // APIs //////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DX11CreateEffectFromMemory
- //
- // Creates an effect instance from a compiled effect in memory
- //
- // Parameters:
- //
- // [in]
- //
- // pData
- // Blob of compiled effect data
- // DataLength
- // Length of the data blob
- // FXFlags
- // Flags pertaining to Effect creation
- // pDevice
- // Pointer to the D3D11 device on which to create Effect resources
- // srcName [optional]
- // ASCII string to use for debug object naming
- //
- // [out]
- //
- // ppEffect
- // Address of the newly created Effect interface
- //
- //----------------------------------------------------------------------------
- function D3DX11CreateEffectFromMemory(
- pData: Pointer;
- DataLength: SIZE_T;
- FXFlags: UINT;
- const pDevice: ID3D11Device;
- out ppEffect: ID3DX11Effect;
- srcName: LPCSTR = nil): HResult; stdcall; external d3fx11dll delayed;
- {$EXTERNALSYM D3DX11CreateEffectFromMemory}
- //----------------------------------------------------------------------------
- // D3DX11CreateEffectFromFile
- //
- // Creates an effect instance from a compiled effect data file
- //
- // Parameters:
- //
- // [in]
- //
- // pFileName
- // Compiled effect file
- // FXFlags
- // Flags pertaining to Effect creation
- // pDevice
- // Pointer to the D3D11 device on which to create Effect resources
- //
- // [out]
- //
- // ppEffect
- // Address of the newly created Effect interface
- //
- //----------------------------------------------------------------------------
- function D3DX11CreateEffectFromFile(
- pFileName: LPWSTR;
- FXFlags: UINT;
- const pDevice: ID3D11Device;
- out ppEffect: ID3DX11Effect): HResult; stdcall; external d3fx11dll delayed;
- {$EXTERNALSYM D3DX11CreateEffectFromFile}
- //----------------------------------------------------------------------------
- // D3DX11CompileEffectFromMemory
- //
- // Complies an effect shader source file in memory and then creates an effect instance
- //
- // Parameters:
- //
- // [in]
- //
- // pData
- // Pointer to FX shader as an ASCII string
- // DataLength
- // Length of the FX shader ASCII string
- // srcName [optional]
- // ASCII string to use for debug object naming
- // pDefines [optional]
- // A NULL-terminated array of shader macros
- // pInclude [optional]
- // A pointer to an include interface
- // HLSLFlags
- // HLSL compile options (see D3DCOMPILE flags)
- // FXFlags
- // Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags)
- // pDevice
- // Pointer to the D3D11 device on which to create Effect resources
- //
- // [out]
- //
- // ppEffect
- // Address of the newly created Effect interface
- //
- //----------------------------------------------------------------------------
- function D3DX11CompileEffectFromMemory(
- pData: Pointer;
- DataLength: SIZE_T;
- srcName: LPSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- HLSLFlags, FXFlags: UINT;
- const pDevice: ID3D11Device;
- out ppEffect: ID3DX11Effect;
- ppErrors: PID3DBlob = nil): HResult; stdcall; external d3fx11dll delayed;
- {$EXTERNALSYM D3DX11CreateEffectFromMemory}
- //----------------------------------------------------------------------------
- // D3DX11CompileEffectFromFile
- //
- // Complies an effect shader source file and then creates an effect instance
- //
- // Parameters:
- //
- // [in]
- //
- // pFileName
- // FX shader source file
- // pDefines [optional]
- // A NULL-terminated array of shader macros
- // pInclude [optional]
- // A pointer to an include interface
- // HLSLFlags
- // HLSL compile options (see D3DCOMPILE flags)
- // FXFlags
- // Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags)
- // pDevice
- // Pointer to the D3D11 device on which to create Effect resources
- //
- // [out]
- //
- // ppEffect
- // Address of the newly created Effect interface
- //
- //----------------------------------------------------------------------------
- function D3DX11CompileEffectFromFile(
- pFileName: LPWSTR;
- pDefines: LPD3D_SHADER_MACRO;
- pInclude: ID3DInclude;
- HLSLFlags, FXFlags: UINT;
- const pDevice: ID3D11Device;
- out ppEffect: ID3DX11Effect;
- ppErrors: PID3DBlob = nil): HResult; stdcall; external d3fx11dll delayed;
- {$EXTERNALSYM D3DX11CompileEffectFromFile}
- {$ENDREGION}
- implementation
- {$REGION 'DX11'}
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright (C) Microsoft Corporation. All Rights Reserved.
- //
- // File: d3dx11.h
- // Content: D3DX11 utility library
- //
- //////////////////////////////////////////////////////////////////////////////
- // #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
- function MAKE_DDHRESULT(Code: DWord): DWord;
- begin
- Result:= DWord((1 shl 31) or (_FACDD shl 16)) or Code;
- end;
- ///////////////////////////////////////////////////////////////////////////
- //
- // Copyright (C) Microsoft Corporation. All Rights Reserved.
- //
- // File: d3dx11core.h
- // Content: D3DX11 core types and functions
- //
- ///////////////////////////////////////////////////////////////////////////
- // #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
- function MAKE_D3DHRESULT(Code: DWord): DWord;
- begin
- Result:= DWord((1 shl 31) or (_FACD3D shl 16)) or Code;
- end;
- // #define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
- function MAKE_D3DSTATUS(Code: DWord): DWord;
- begin
- Result:= DWord((0 shl 31) or (_FACD3D shl 16)) or Code;
- end;
- {$ENDREGION}
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement