Add include/dxsdk

This commit is contained in:
twinaphex 2018-01-23 23:40:17 +01:00
parent 6bbfcdd069
commit d387cfbfbe
93 changed files with 149493 additions and 0 deletions

View File

@ -1216,6 +1216,10 @@ ifeq ($(findstring 1, $(HAVE_VULKAN) $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),
INCLUDE_DIRS += -Igfx/include
endif
ifeq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),1)
INCLUDE_DIRS += -Igfx/include/dxsdk
endif
ifeq ($(WANT_WGL), 1)
OBJ += gfx/drivers_context/wgl_ctx.o
LIBS += -lcomctl32

View File

@ -0,0 +1,263 @@
/***************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: audiodefs.h
* Content: Basic constants and data types for audio work.
*
* Remarks: This header file defines all of the audio format constants and
* structures required for XAudio2 and XACT work. Providing these
* in a single location avoids certain dependency problems in the
* legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h).
*
* NOTE: Including the legacy headers after this one may cause a
* compilation error, because they define some of the same types
* defined here without preprocessor guards to avoid multiple
* definitions. If a source file needs one of the old headers,
* it must include it before including audiodefs.h.
*
***************************************************************************/
#ifndef __AUDIODEFS_INCLUDED__
#define __AUDIODEFS_INCLUDED__
#include <windef.h> // For WORD, DWORD, etc.
#pragma pack(push, 1) // Pack structures to 1-byte boundaries
/**************************************************************************
*
* WAVEFORMATEX: Base structure for many audio formats. Format-specific
* extensions can be defined for particular formats by using a non-zero
* cbSize value and adding extra fields to the end of this structure.
*
***************************************************************************/
#ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_
typedef struct tWAVEFORMATEX
{
WORD wFormatTag; // Integer identifier of the format
WORD nChannels; // Number of audio channels
DWORD nSamplesPerSec; // Audio sample rate
DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate)
WORD nBlockAlign; // Size in bytes of a sample block (all channels)
WORD wBitsPerSample; // Size in bits of a single per-channel sample
WORD cbSize; // Bytes of extra data appended to this struct
} WAVEFORMATEX;
#endif
// Defining pointer types outside of the #if block to make sure they are
// defined even if mmreg.h or mmsystem.h is #included before this file
typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX;
/**************************************************************************
*
* WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be
* used as a basis for all new audio formats. The format tag is replaced
* with a GUID, allowing new formats to be defined without registering a
* format tag with Microsoft. There are also new fields that can be used
* to specify the spatial positions for each channel and the bit packing
* used for wide samples (e.g. 24-bit PCM samples in 32-bit containers).
*
***************************************************************************/
#ifndef _WAVEFORMATEXTENSIBLE_
#define _WAVEFORMATEXTENSIBLE_
typedef struct
{
WAVEFORMATEX Format; // Base WAVEFORMATEX data
union
{
WORD wValidBitsPerSample; // Valid bits in each sample container
WORD wSamplesPerBlock; // Samples per block of audio data; valid
// if wBitsPerSample=0 (but rarely used).
WORD wReserved; // Zero if neither case above applies.
} Samples;
DWORD dwChannelMask; // Positions of the audio channels
GUID SubFormat; // Format identifier GUID
} WAVEFORMATEXTENSIBLE;
#endif
typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE;
typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE;
/**************************************************************************
*
* Define the most common wave format tags used in WAVEFORMATEX formats.
*
***************************************************************************/
#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation
// If WAVE_FORMAT_PCM is not defined, we need to define some legacy types
// for compatibility with the Windows mmreg.h / mmsystem.h header files.
// Old general format structure (information common to all formats)
typedef struct waveformat_tag
{
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
} WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT;
// Specific format structure for PCM data
typedef struct pcmwaveformat_tag
{
WAVEFORMAT wf;
WORD wBitsPerSample;
} PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT;
#define WAVE_FORMAT_PCM 0x0001
#endif
#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM
// Replicate the Microsoft ADPCM type definitions from mmreg.h.
typedef struct adpcmcoef_tag
{
short iCoef1;
short iCoef2;
} ADPCMCOEFSET;
#pragma warning(push)
#pragma warning(disable:4200) // Disable zero-sized array warnings
typedef struct adpcmwaveformat_tag {
WAVEFORMATEX wfx;
WORD wSamplesPerBlock;
WORD wNumCoef;
ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM
} ADPCMWAVEFORMAT;
#pragma warning(pop)
#define WAVE_FORMAT_ADPCM 0x0002
#endif
// Other frequently used format tags
#ifndef WAVE_FORMAT_UNKNOWN
#define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag
#endif
#ifndef WAVE_FORMAT_IEEE_FLOAT
#define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point
#endif
#ifndef WAVE_FORMAT_MPEGLAYER3
#define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3
#endif
#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF
#endif
#ifndef WAVE_FORMAT_WMAUDIO2
#define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio
#endif
#ifndef WAVE_FORMAT_WMAUDIO3
#define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro
#endif
#ifndef WAVE_FORMAT_WMASPDIF
#define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF
#endif
#ifndef WAVE_FORMAT_EXTENSIBLE
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats
#endif
/**************************************************************************
*
* Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE
* formats. Note that including the Windows ksmedia.h header after this
* one will cause build problems; this cannot be avoided, since ksmedia.h
* defines these macros without preprocessor guards.
*
***************************************************************************/
#if defined(__cplusplus) && defined(_MSC_VER) // uuid() and __uuidof() are only available in C++
#ifndef KSDATAFORMAT_SUBTYPE_PCM
struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT;
#define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT)
#endif
#ifndef KSDATAFORMAT_SUBTYPE_ADPCM
struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT;
#define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT)
#endif
#ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT;
#define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT)
#endif
#endif
/**************************************************************************
*
* Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field.
*
***************************************************************************/
#ifndef SPEAKER_FRONT_LEFT
#define SPEAKER_FRONT_LEFT 0x00000001
#define SPEAKER_FRONT_RIGHT 0x00000002
#define SPEAKER_FRONT_CENTER 0x00000004
#define SPEAKER_LOW_FREQUENCY 0x00000008
#define SPEAKER_BACK_LEFT 0x00000010
#define SPEAKER_BACK_RIGHT 0x00000020
#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
#define SPEAKER_BACK_CENTER 0x00000100
#define SPEAKER_SIDE_LEFT 0x00000200
#define SPEAKER_SIDE_RIGHT 0x00000400
#define SPEAKER_TOP_CENTER 0x00000800
#define SPEAKER_TOP_FRONT_LEFT 0x00001000
#define SPEAKER_TOP_FRONT_CENTER 0x00002000
#define SPEAKER_TOP_FRONT_RIGHT 0x00004000
#define SPEAKER_TOP_BACK_LEFT 0x00008000
#define SPEAKER_TOP_BACK_CENTER 0x00010000
#define SPEAKER_TOP_BACK_RIGHT 0x00020000
#define SPEAKER_RESERVED 0x7FFC0000
#define SPEAKER_ALL 0x80000000
#define _SPEAKER_POSITIONS_
#endif
#ifndef SPEAKER_STEREO
#define SPEAKER_MONO (SPEAKER_FRONT_CENTER)
#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
#define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)
#define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
#define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
#define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
#define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
#define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
#define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
#endif
#pragma pack(pop)
#endif // #ifndef __AUDIODEFS_INCLUDED__

View File

@ -0,0 +1,59 @@
// comdecl.h: Macros to facilitate COM interface and GUID declarations.
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _COMDECL_H_
#define _COMDECL_H_
#ifndef _XBOX
#include <basetyps.h> // For standard COM interface macros
#else
#pragma warning(push)
#pragma warning(disable:4061)
#include <xtl.h> // Required by xobjbase.h
#include <xobjbase.h> // Special definitions for Xbox build
#pragma warning(pop)
#endif
// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to
// be declared and defined in such a way that clients can obtain the GUIDs using
// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names.
// If using the latter approach, the client can also choose whether to get the
// GUID definitions by defining the INITGUID preprocessor constant or by linking
// to a GUID library. This works in either C or C++.
#if defined(__cplusplus) && defined(_MSC_VER)
#define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
#ifdef INITGUID
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className)
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName)
#else // INITGUID
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
EXTERN_C const GUID CLSID_##className
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
EXTERN_C const GUID IID_##interfaceName
#endif // INITGUID
#else // __cplusplus
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#endif // __cplusplus
#endif // #ifndef _COMDECL_H_

3768
gfx/include/dxsdk/d2d1.h Normal file

File diff suppressed because it is too large Load Diff

2530
gfx/include/dxsdk/d2d1_1.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,924 @@
/*=========================================================================*\
Copyright (c) Microsoft Corporation. All rights reserved.
File: D2D1_1Helper.h
Module Name: D2D
Description: Helper files over the D2D interfaces and APIs.
\*=========================================================================*/
#pragma once
#ifndef _D2D1_1HELPER_H_
#define _D2D1_1HELPER_H_
#ifndef _D2D1_1_H_
#include <d2d1_1.h>
#endif // #ifndef _D2D1_H_
#ifndef D2D_USE_C_DEFINITIONS
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
namespace D2D1
{
template<>
struct TypeTraits<INT32>
{
typedef D2D1_POINT_2L Point;
typedef D2D1_RECT_L Rect;
};
template<>
struct TypeTraits<LONG>
{
typedef D2D1_POINT_2L Point;
typedef D2D1_RECT_L Rect;
};
class Matrix4x3F : public D2D1_MATRIX_4X3_F
{
public:
COM_DECLSPEC_NOTHROW
inline
Matrix4x3F(
FLOAT m11, FLOAT m12, FLOAT m13,
FLOAT m21, FLOAT m22, FLOAT m23,
FLOAT m31, FLOAT m32, FLOAT m33,
FLOAT m41, FLOAT m42, FLOAT m43
)
{
_11 = m11;
_12 = m12;
_13 = m13;
_21 = m21;
_22 = m22;
_23 = m23;
_31 = m31;
_32 = m32;
_33 = m33;
_41 = m41;
_42 = m42;
_43 = m43;
}
COM_DECLSPEC_NOTHROW
inline
Matrix4x3F()
{
_11 = 1;
_12 = 0;
_13 = 0;
_21 = 0;
_22 = 1;
_23 = 0;
_31 = 0;
_32 = 0;
_33 = 1;
_41 = 0;
_42 = 0;
_43 = 0;
}
};
class Matrix4x4F : public D2D1_MATRIX_4X4_F
{
public:
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F(
FLOAT m11, FLOAT m12, FLOAT m13, FLOAT m14,
FLOAT m21, FLOAT m22, FLOAT m23, FLOAT m24,
FLOAT m31, FLOAT m32, FLOAT m33, FLOAT m34,
FLOAT m41, FLOAT m42, FLOAT m43, FLOAT m44
)
{
_11 = m11;
_12 = m12;
_13 = m13;
_14 = m14;
_21 = m21;
_22 = m22;
_23 = m23;
_24 = m24;
_31 = m31;
_32 = m32;
_33 = m33;
_34 = m34;
_41 = m41;
_42 = m42;
_43 = m43;
_44 = m44;
}
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F()
{
_11 = 1;
_12 = 0;
_13 = 0;
_14 = 0;
_21 = 0;
_22 = 1;
_23 = 0;
_24 = 0;
_31 = 0;
_32 = 0;
_33 = 1;
_34 = 0;
_41 = 0;
_42 = 0;
_43 = 0;
_44 = 1;
}
COM_DECLSPEC_NOTHROW
inline
bool
operator==(
const Matrix4x4F& r
) const
{
return _11 == r._11 && _12 == r._12 && _13 == r._13 && _14 == r._14 &&
_21 == r._21 && _22 == r._22 && _23 == r._23 && _24 == r._24 &&
_31 == r._31 && _32 == r._32 && _33 == r._33 && _34 == r._34 &&
_41 == r._41 && _42 == r._42 && _43 == r._43 && _44 == r._44;
}
COM_DECLSPEC_NOTHROW
inline
bool
operator!=(
const Matrix4x4F& r
) const
{
return !(*this == r);
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
Translation(FLOAT x, FLOAT y, FLOAT z)
{
Matrix4x4F translation;
translation._11 = 1.0; translation._12 = 0.0; translation._13 = 0.0; translation._14 = 0.0;
translation._21 = 0.0; translation._22 = 1.0; translation._23 = 0.0; translation._24 = 0.0;
translation._31 = 0.0; translation._32 = 0.0; translation._33 = 1.0; translation._34 = 0.0;
translation._41 = x; translation._42 = y; translation._43 = z; translation._44 = 1.0;
return translation;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
Scale(FLOAT x, FLOAT y, FLOAT z)
{
Matrix4x4F scale;
scale._11 = x; scale._12 = 0.0; scale._13 = 0.0; scale._14 = 0.0;
scale._21 = 0.0; scale._22 = y; scale._23 = 0.0; scale._24 = 0.0;
scale._31 = 0.0; scale._32 = 0.0; scale._33 = z; scale._34 = 0.0;
scale._41 = 0.0; scale._42 = 0.0; scale._43 = 0.0; scale._44 = 1.0;
return scale;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
RotationX(FLOAT degreeX)
{
FLOAT angleInRadian = degreeX * (3.141592654f / 180.0f);
FLOAT sinAngle = 0.0;
FLOAT cosAngle = 0.0;
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
Matrix4x4F rotationX(
1, 0, 0, 0,
0, cosAngle, sinAngle, 0,
0, -sinAngle, cosAngle, 0,
0, 0, 0, 1
);
return rotationX;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
RotationY(FLOAT degreeY)
{
FLOAT angleInRadian = degreeY * (3.141592654f / 180.0f);
FLOAT sinAngle = 0.0;
FLOAT cosAngle = 0.0;
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
Matrix4x4F rotationY(
cosAngle, 0, -sinAngle, 0,
0, 1, 0, 0,
sinAngle, 0, cosAngle, 0,
0, 0, 0, 1
);
return rotationY;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
RotationZ(FLOAT degreeZ)
{
FLOAT angleInRadian = degreeZ * (3.141592654f / 180.0f);
FLOAT sinAngle = 0.0;
FLOAT cosAngle = 0.0;
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
Matrix4x4F rotationZ(
cosAngle, sinAngle, 0, 0,
-sinAngle, cosAngle, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
);
return rotationZ;
}
//
// 3D Rotation matrix for an arbitrary axis specified by x, y and z
//
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
RotationArbitraryAxis(FLOAT x, FLOAT y, FLOAT z, FLOAT degree)
{
// Normalize the vector represented by x, y, and z
FLOAT magnitude = D2D1Vec3Length(x, y, z);
x /= magnitude;
y /= magnitude;
z /= magnitude;
FLOAT angleInRadian = degree * (3.141592654f / 180.0f);
FLOAT sinAngle = 0.0;
FLOAT cosAngle = 0.0;
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
FLOAT oneMinusCosAngle = 1 - cosAngle;
Matrix4x4F rotationArb(
1 + oneMinusCosAngle * (x * x - 1),
z * sinAngle + oneMinusCosAngle * x * y,
-y * sinAngle + oneMinusCosAngle * x * z,
0,
-z * sinAngle + oneMinusCosAngle * y * x,
1 + oneMinusCosAngle * (y * y - 1),
x * sinAngle + oneMinusCosAngle * y * z,
0,
y * sinAngle + oneMinusCosAngle * z * x,
-x * sinAngle + oneMinusCosAngle * z * y,
1 + oneMinusCosAngle * (z * z - 1) ,
0,
0, 0, 0, 1
);
return rotationArb;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
SkewX(FLOAT degreeX)
{
FLOAT angleInRadian = degreeX * (3.141592654f / 180.0f);
FLOAT tanAngle = D2D1Tan(angleInRadian);
Matrix4x4F skewX(
1, 0, 0, 0,
tanAngle, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
);
return skewX;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
SkewY(FLOAT degreeY)
{
FLOAT angleInRadian = degreeY * (3.141592654f / 180.0f);
FLOAT tanAngle = D2D1Tan(angleInRadian);
Matrix4x4F skewY(
1, tanAngle, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
);
return skewY;
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
PerspectiveProjection(FLOAT depth)
{
float proj = 0;
if (depth > 0)
{
proj = -1/depth;
}
Matrix4x4F projection(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, proj,
0, 0, 0, 1
);
return projection;
}
//
// Functions for convertion from the base D2D1_MATRIX_4X4_f to
// this type without making a copy
//
static
COM_DECLSPEC_NOTHROW
inline
const Matrix4x4F*
ReinterpretBaseType(const D2D1_MATRIX_4X4_F *pMatrix)
{
return static_cast<const Matrix4x4F *>(pMatrix);
}
static
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F*
ReinterpretBaseType(D2D1_MATRIX_4X4_F *pMatrix)
{
return static_cast<Matrix4x4F *>(pMatrix);
}
COM_DECLSPEC_NOTHROW
inline
FLOAT
Determinant() const
{
FLOAT minor1 = _41 * (_12 * (_23 * _34 - _33 * _24) - _13 * (_22 * _34 - _24 * _32) + _14 * (_22 * _33 - _23 * _32));
FLOAT minor2 = _42 * (_11 * (_21 * _34 - _31 * _24) - _13 * (_21 * _34 - _24 * _31) + _14 * (_21 * _33 - _23 * _31));
FLOAT minor3 = _43 * (_11 * (_22 * _34 - _32 * _24) - _12 * (_21 * _34 - _24 * _31) + _14 * (_21 * _32 - _22 * _31));
FLOAT minor4 = _44 * (_11 * (_22 * _33 - _32 * _23) - _12 * (_21 * _33 - _23 * _31) + _13 * (_21 * _32 - _22 * _31));
return minor1 - minor2 + minor3 - minor4;
}
COM_DECLSPEC_NOTHROW
inline
bool
IsIdentity() const
{
return _11 == 1.f && _12 == 0.f && _13 == 0.f && _14 == 0.f
&& _21 == 0.f && _22 == 1.f && _23 == 0.f && _24 == 0.f
&& _31 == 0.f && _32 == 0.f && _33 == 1.f && _34 == 0.f
&& _41 == 0.f && _42 == 0.f && _43 == 0.f && _44 == 1.f;
}
COM_DECLSPEC_NOTHROW
inline
void
SetProduct(const Matrix4x4F &a, const Matrix4x4F &b)
{
_11 = a._11 * b._11 + a._12 * b._21 + a._13 * b._31 + a._14 * b._41;
_12 = a._11 * b._12 + a._12 * b._22 + a._13 * b._32 + a._14 * b._42;
_13 = a._11 * b._13 + a._12 * b._23 + a._13 * b._33 + a._14 * b._43;
_14 = a._11 * b._14 + a._12 * b._24 + a._13 * b._34 + a._14 * b._44;
_21 = a._21 * b._11 + a._22 * b._21 + a._23 * b._31 + a._24 * b._41;
_22 = a._21 * b._12 + a._22 * b._22 + a._23 * b._32 + a._24 * b._42;
_23 = a._21 * b._13 + a._22 * b._23 + a._23 * b._33 + a._24 * b._43;
_24 = a._21 * b._14 + a._22 * b._24 + a._23 * b._34 + a._24 * b._44;
_31 = a._31 * b._11 + a._32 * b._21 + a._33 * b._31 + a._34 * b._41;
_32 = a._31 * b._12 + a._32 * b._22 + a._33 * b._32 + a._34 * b._42;
_33 = a._31 * b._13 + a._32 * b._23 + a._33 * b._33 + a._34 * b._43;
_34 = a._31 * b._14 + a._32 * b._24 + a._33 * b._34 + a._34 * b._44;
_41 = a._41 * b._11 + a._42 * b._21 + a._43 * b._31 + a._44 * b._41;
_42 = a._41 * b._12 + a._42 * b._22 + a._43 * b._32 + a._44 * b._42;
_43 = a._41 * b._13 + a._42 * b._23 + a._43 * b._33 + a._44 * b._43;
_44 = a._41 * b._14 + a._42 * b._24 + a._43 * b._34 + a._44 * b._44;
}
COM_DECLSPEC_NOTHROW
inline
Matrix4x4F
operator*(const Matrix4x4F &matrix) const
{
Matrix4x4F result;
result.SetProduct(*this, matrix);
return result;
}
};
class Matrix5x4F : public D2D1_MATRIX_5X4_F
{
public:
COM_DECLSPEC_NOTHROW
inline
Matrix5x4F(
FLOAT m11, FLOAT m12, FLOAT m13, FLOAT m14,
FLOAT m21, FLOAT m22, FLOAT m23, FLOAT m24,
FLOAT m31, FLOAT m32, FLOAT m33, FLOAT m34,
FLOAT m41, FLOAT m42, FLOAT m43, FLOAT m44,
FLOAT m51, FLOAT m52, FLOAT m53, FLOAT m54
)
{
_11 = m11;
_12 = m12;
_13 = m13;
_14 = m14;
_21 = m21;
_22 = m22;
_23 = m23;
_24 = m24;
_31 = m31;
_32 = m32;
_33 = m33;
_34 = m34;
_41 = m41;
_42 = m42;
_43 = m43;
_44 = m44;
_51 = m51;
_52 = m52;
_53 = m53;
_54 = m54;
}
COM_DECLSPEC_NOTHROW
inline
Matrix5x4F()
{
_11 = 1;
_12 = 0;
_13 = 0;
_14 = 0;
_21 = 0;
_22 = 1;
_23 = 0;
_24 = 0;
_31 = 0;
_32 = 0;
_33 = 1;
_34 = 0;
_41 = 0;
_42 = 0;
_43 = 0;
_44 = 1;
_51 = 0;
_52 = 0;
_53 = 0;
_54 = 0;
}
};
COM_DECLSPEC_NOTHROW
inline
D2D1_COLOR_F
ConvertColorSpace(
D2D1_COLOR_SPACE sourceColorSpace,
D2D1_COLOR_SPACE destinationColorSpace,
const D2D1_COLOR_F& color
)
{
return D2D1ConvertColorSpace(
sourceColorSpace,
destinationColorSpace,
&color
);
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_DRAWING_STATE_DESCRIPTION1
DrawingStateDescription1(
D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT,
D2D1_TAG tag1 = 0,
D2D1_TAG tag2 = 0,
_In_ const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix(),
D2D1_PRIMITIVE_BLEND primitiveBlend = D2D1_PRIMITIVE_BLEND_SOURCE_OVER,
D2D1_UNIT_MODE unitMode = D2D1_UNIT_MODE_DIPS
)
{
D2D1_DRAWING_STATE_DESCRIPTION1 drawingStateDescription1;
drawingStateDescription1.antialiasMode = antialiasMode;
drawingStateDescription1.textAntialiasMode = textAntialiasMode;
drawingStateDescription1.tag1 = tag1;
drawingStateDescription1.tag2 = tag2;
drawingStateDescription1.transform = transform;
drawingStateDescription1.primitiveBlend = primitiveBlend;
drawingStateDescription1.unitMode = unitMode;
return drawingStateDescription1;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_DRAWING_STATE_DESCRIPTION1
DrawingStateDescription1(
_In_ const D2D1_DRAWING_STATE_DESCRIPTION &desc,
D2D1_PRIMITIVE_BLEND primitiveBlend = D2D1_PRIMITIVE_BLEND_SOURCE_OVER,
D2D1_UNIT_MODE unitMode = D2D1_UNIT_MODE_DIPS
)
{
D2D1_DRAWING_STATE_DESCRIPTION1 drawingStateDescription1;
drawingStateDescription1.antialiasMode = desc.antialiasMode;
drawingStateDescription1.textAntialiasMode = desc.textAntialiasMode;
drawingStateDescription1.tag1 = desc.tag1;
drawingStateDescription1.tag2 = desc.tag2;
drawingStateDescription1.transform = desc.transform;
drawingStateDescription1.primitiveBlend = primitiveBlend;
drawingStateDescription1.unitMode = unitMode;
return drawingStateDescription1;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_BITMAP_PROPERTIES1
BitmapProperties1(
D2D1_BITMAP_OPTIONS bitmapOptions = D2D1_BITMAP_OPTIONS_NONE,
_In_ CONST D2D1_PIXEL_FORMAT pixelFormat = D2D1::PixelFormat(),
FLOAT dpiX = 96.0f,
FLOAT dpiY = 96.0f,
_In_opt_ ID2D1ColorContext *colorContext = NULL
)
{
D2D1_BITMAP_PROPERTIES1 bitmapProperties =
{
pixelFormat,
dpiX, dpiY,
bitmapOptions,
colorContext
};
return bitmapProperties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_LAYER_PARAMETERS1
LayerParameters1(
_In_ CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
_In_opt_ ID2D1Geometry *geometricMask = NULL,
D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
FLOAT opacity = 1.0,
_In_opt_ ID2D1Brush *opacityBrush = NULL,
D2D1_LAYER_OPTIONS1 layerOptions = D2D1_LAYER_OPTIONS1_NONE
)
{
D2D1_LAYER_PARAMETERS1 layerParameters = { 0 };
layerParameters.contentBounds = contentBounds;
layerParameters.geometricMask = geometricMask;
layerParameters.maskAntialiasMode = maskAntialiasMode;
layerParameters.maskTransform = maskTransform;
layerParameters.opacity = opacity;
layerParameters.opacityBrush = opacityBrush;
layerParameters.layerOptions = layerOptions;
return layerParameters;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_STROKE_STYLE_PROPERTIES1
StrokeStyleProperties1(
D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT,
D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT,
D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT,
D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER,
FLOAT miterLimit = 10.0f,
D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID,
FLOAT dashOffset = 0.0f,
D2D1_STROKE_TRANSFORM_TYPE transformType = D2D1_STROKE_TRANSFORM_TYPE_NORMAL
)
{
D2D1_STROKE_STYLE_PROPERTIES1 strokeStyleProperties;
strokeStyleProperties.startCap = startCap;
strokeStyleProperties.endCap = endCap;
strokeStyleProperties.dashCap = dashCap;
strokeStyleProperties.lineJoin = lineJoin;
strokeStyleProperties.miterLimit = miterLimit;
strokeStyleProperties.dashStyle = dashStyle;
strokeStyleProperties.dashOffset = dashOffset;
strokeStyleProperties.transformType = transformType;
return strokeStyleProperties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_IMAGE_BRUSH_PROPERTIES
ImageBrushProperties(
D2D1_RECT_F sourceRectangle,
D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR
)
{
D2D1_IMAGE_BRUSH_PROPERTIES imageBrushProperties;
imageBrushProperties.extendModeX = extendModeX;
imageBrushProperties.extendModeY = extendModeY;
imageBrushProperties.interpolationMode = interpolationMode;
imageBrushProperties.sourceRectangle = sourceRectangle;
return imageBrushProperties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_BITMAP_BRUSH_PROPERTIES1
BitmapBrushProperties1(
D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR
)
{
D2D1_BITMAP_BRUSH_PROPERTIES1 bitmapBrush1Properties;
bitmapBrush1Properties.extendModeX = extendModeX;
bitmapBrush1Properties.extendModeY = extendModeY;
bitmapBrush1Properties.interpolationMode = interpolationMode;
return bitmapBrush1Properties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_PRINT_CONTROL_PROPERTIES
PrintControlProperties(
D2D1_PRINT_FONT_SUBSET_MODE fontSubsetMode = D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT,
FLOAT rasterDpi = 150.0f,
D2D1_COLOR_SPACE colorSpace = D2D1_COLOR_SPACE_SRGB
)
{
D2D1_PRINT_CONTROL_PROPERTIES printControlProps;
printControlProps.fontSubset = fontSubsetMode;
printControlProps.rasterDPI = rasterDpi;
printControlProps.colorSpace = colorSpace;
return printControlProps;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_RENDERING_CONTROLS
RenderingControls(
D2D1_BUFFER_PRECISION bufferPrecision,
D2D1_SIZE_U tileSize
)
{
D2D1_RENDERING_CONTROLS renderingControls;
renderingControls.bufferPrecision = bufferPrecision;
renderingControls.tileSize = tileSize;
return renderingControls;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_EFFECT_INPUT_DESCRIPTION
EffectInputDescription(
ID2D1Effect *effect,
UINT32 inputIndex,
D2D1_RECT_F inputRectangle
)
{
D2D1_EFFECT_INPUT_DESCRIPTION description;
description.effect = effect;
description.inputIndex = inputIndex;
description.inputRectangle = inputRectangle;
return description;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_CREATION_PROPERTIES
CreationProperties(
D2D1_THREADING_MODE threadingMode,
D2D1_DEBUG_LEVEL debugLevel,
D2D1_DEVICE_CONTEXT_OPTIONS options
)
{
D2D1_CREATION_PROPERTIES creationProperties;
creationProperties.threadingMode = threadingMode;
creationProperties.debugLevel = debugLevel;
creationProperties.options = options;
return creationProperties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_VECTOR_2F
Vector2F(
FLOAT x = 0.0f,
FLOAT y = 0.0f
)
{
D2D1_VECTOR_2F vec2 = {x, y};
return vec2;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_VECTOR_3F
Vector3F(
FLOAT x = 0.0f,
FLOAT y = 0.0f,
FLOAT z = 0.0f
)
{
D2D1_VECTOR_3F vec3 = {x, y, z};
return vec3;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_VECTOR_4F
Vector4F(
FLOAT x = 0.0f,
FLOAT y = 0.0f,
FLOAT z = 0.0f,
FLOAT w = 0.0f
)
{
D2D1_VECTOR_4F vec4 = {x, y, z, w};
return vec4;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_POINT_2L
Point2L(
INT32 x = 0,
INT32 y = 0
)
{
return Point2<INT32>(x, y);
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_RECT_L
RectL(
INT32 left = 0.f,
INT32 top = 0.f,
INT32 right = 0.f,
INT32 bottom = 0.f
)
{
return Rect<INT32>(left, top, right, bottom);
}
//
// Sets a bitmap as an effect input, while inserting a DPI compensation effect
// to preserve visual appearance as the device context's DPI changes.
//
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
HRESULT
SetDpiCompensatedEffectInput(
_In_ ID2D1DeviceContext *deviceContext,
_In_ ID2D1Effect *effect,
UINT32 inputIndex,
_In_opt_ ID2D1Bitmap *inputBitmap,
D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
D2D1_BORDER_MODE borderMode = D2D1_BORDER_MODE_HARD
)
{
HRESULT hr = S_OK;
ID2D1Effect *dpiCompensationEffect = NULL;
if (!inputBitmap)
{
effect->SetInput(inputIndex, NULL);
return hr;
}
hr = deviceContext->CreateEffect(CLSID_D2D1DpiCompensation, &dpiCompensationEffect);
if (SUCCEEDED(hr))
{
if (SUCCEEDED(hr))
{
dpiCompensationEffect->SetInput(0, inputBitmap);
D2D1_POINT_2F bitmapDpi;
inputBitmap->GetDpi(&bitmapDpi.x, &bitmapDpi.y);
hr = dpiCompensationEffect->SetValue(D2D1_DPICOMPENSATION_PROP_INPUT_DPI, bitmapDpi);
}
if (SUCCEEDED(hr))
{
hr = dpiCompensationEffect->SetValue(D2D1_DPICOMPENSATION_PROP_INTERPOLATION_MODE, interpolationMode);
}
if (SUCCEEDED(hr))
{
hr = dpiCompensationEffect->SetValue(D2D1_DPICOMPENSATION_PROP_BORDER_MODE, borderMode);
}
if (SUCCEEDED(hr))
{
effect->SetInputEffect(inputIndex, dpiCompensationEffect);
}
if (dpiCompensationEffect)
{
dpiCompensationEffect->Release();
}
}
return hr;
}
} // namespace D2D1
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#endif // #ifndef D2D_USE_C_DEFINITIONS
#endif // #ifndef _D2D1_HELPER_H_

204
gfx/include/dxsdk/d2d1_2.h Normal file
View File

@ -0,0 +1,204 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2D1_2.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_2_H_
#define _D2D1_2_H_
#ifndef _D2D1_1_H_
#include <d2d1_1.h>
#endif // #ifndef _D2D1_1_H_
#ifndef _D2D1_EFFECTS_1_
#include <d2d1effects_1.h>
#endif // #ifndef _D2D1_EFFECTS_1_
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
#ifndef D2D_USE_C_DEFINITIONS
interface ID2D1Device1;
#else
typedef interface ID2D1Device1 ID2D1Device1;
#endif
/// <summary>
/// Specifies the extent to which D2D will throttle work sent to the GPU.
/// </summary>
typedef enum D2D1_RENDERING_PRIORITY
{
D2D1_RENDERING_PRIORITY_NORMAL = 0,
D2D1_RENDERING_PRIORITY_LOW = 1,
D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff
} D2D1_RENDERING_PRIORITY;
EXTERN_C CONST IID IID_ID2D1GeometryRealization;
EXTERN_C CONST IID IID_ID2D1DeviceContext1;
EXTERN_C CONST IID IID_ID2D1Device1;
EXTERN_C CONST IID IID_ID2D1Factory2;
EXTERN_C CONST IID IID_ID2D1CommandSink1;
#ifndef D2D_USE_C_DEFINITIONS
/// <summary>
/// Encapsulates a device- and transform-dependent representation of a filled or
/// stroked geometry.
/// </summary>
interface DX_DECLARE_INTERFACE("a16907d7-bc02-4801-99e8-8cf7f485f774") ID2D1GeometryRealization : public ID2D1Resource
{
}; // interface ID2D1GeometryRealization
/// <summary>
/// Enables creation and drawing of geometry realization objects.
/// </summary>
interface DX_DECLARE_INTERFACE("d37f57e4-6908-459f-a199-e72f24f79987") ID2D1DeviceContext1 : public ID2D1DeviceContext
{
STDMETHOD(CreateFilledGeometryRealization)(
_In_ ID2D1Geometry *geometry,
FLOAT flatteningTolerance,
_COM_Outptr_ ID2D1GeometryRealization **geometryRealization
) PURE;
STDMETHOD(CreateStrokedGeometryRealization)(
_In_ ID2D1Geometry *geometry,
FLOAT flatteningTolerance,
FLOAT strokeWidth,
_In_opt_ ID2D1StrokeStyle *strokeStyle,
_COM_Outptr_ ID2D1GeometryRealization **geometryRealization
) PURE;
STDMETHOD_(void, DrawGeometryRealization)(
_In_ ID2D1GeometryRealization *geometryRealization,
_In_ ID2D1Brush *brush
) PURE;
}; // interface ID2D1DeviceContext1
/// <summary>
/// Represents a resource domain whose objects and device contexts can be used
/// together.
/// </summary>
interface DX_DECLARE_INTERFACE("d21768e1-23a4-4823-a14b-7c3eba85d658") ID2D1Device1 : public ID2D1Device
{
/// <summary>
/// Retrieves the rendering priority currently set on the device.
/// </summary>
STDMETHOD_(D2D1_RENDERING_PRIORITY, GetRenderingPriority)(
) PURE;
/// <summary>
/// Sets the rendering priority of the device.
/// </summary>
STDMETHOD_(void, SetRenderingPriority)(
D2D1_RENDERING_PRIORITY renderingPriority
) PURE;
/// <summary>
/// Creates a new device context with no initially assigned target.
/// </summary>
STDMETHOD(CreateDeviceContext)(
D2D1_DEVICE_CONTEXT_OPTIONS options,
_COM_Outptr_ ID2D1DeviceContext1 **deviceContext1
) PURE;
using ID2D1Device::CreateDeviceContext;
}; // interface ID2D1Device1
/// <summary>
/// Creates Direct2D resources. This interface also enables the creation of
/// ID2D1Device1 objects.
/// </summary>
interface DX_DECLARE_INTERFACE("94f81a73-9212-4376-9c58-b16a3a0d3992") ID2D1Factory2 : public ID2D1Factory1
{
/// <summary>
/// This creates a new Direct2D device from the given IDXGIDevice.
/// </summary>
STDMETHOD(CreateDevice)(
_In_ IDXGIDevice *dxgiDevice,
_COM_Outptr_ ID2D1Device1 **d2dDevice1
) PURE;
using ID2D1Factory1::CreateDevice;
}; // interface ID2D1Factory2
/// <summary>
/// This interface performs all the same functions as the existing ID2D1CommandSink
/// interface. It also enables access to the new primitive blend modes, MIN and ADD,
/// through its SetPrimitiveBlend1 method.
/// </summary>
interface DX_DECLARE_INTERFACE("9eb767fd-4269-4467-b8c2-eb30cb305743") ID2D1CommandSink1 : public ID2D1CommandSink
{
/// <summary>
/// This method is called if primitiveBlend value was added after Windows 8.
/// SetPrimitiveBlend method is used for Win8 values (_SOURCE_OVER and _COPY).
/// </summary>
STDMETHOD(SetPrimitiveBlend1)(
D2D1_PRIMITIVE_BLEND primitiveBlend
) PURE;
}; // interface ID2D1CommandSink1
#endif
#ifdef D2D_USE_C_DEFINITIONS
typedef interface ID2D1GeometryRealization ID2D1GeometryRealization;
typedef interface ID2D1DeviceContext1 ID2D1DeviceContext1;
typedef interface ID2D1Device1 ID2D1Device1;
typedef interface ID2D1Factory2 ID2D1Factory2;
typedef interface ID2D1CommandSink1 ID2D1CommandSink1;
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#if NTDDI_VERSION >= NTDDI_WINBLUE
FLOAT WINAPI
D2D1ComputeMaximumScaleFactor(
_In_ CONST D2D1_MATRIX_3X2_F *matrix
);
#endif // #if NTDDI_VERSION >= NTDDI_WINBLUE
#ifdef __cplusplus
}
#endif
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#include <d2d1_2helper.h>
#endif // #ifndef _D2D1_2_H_

View File

@ -0,0 +1,65 @@
/*=========================================================================*\
Copyright (c) Microsoft Corporation. All rights reserved.
File: D2D1_2Helper.h
Module Name: D2D
Description: Helper files over the D2D interfaces and APIs.
\*=========================================================================*/
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _D2D1_2HELPER_H_
#define _D2D1_2HELPER_H_
#if NTDDI_VERSION >= NTDDI_WINBLUE
#ifndef _D2D1_2_H_
#include <d2d1_2.h>
#endif // #ifndef _D2D1_2_H_
#ifndef D2D_USE_C_DEFINITIONS
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
namespace D2D1
{
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
FLOAT
ComputeFlatteningTolerance(
_In_ CONST D2D1_MATRIX_3X2_F &matrix,
FLOAT dpiX = 96.0f,
FLOAT dpiY = 96.0f,
FLOAT maxZoomFactor = 1.0f
)
{
D2D1_MATRIX_3X2_F dpiDependentTransform =
matrix * D2D1::Matrix3x2F::Scale(dpiX / 96.0f, dpiY / 96.0f);
FLOAT absMaxZoomFactor = (maxZoomFactor > 0) ? maxZoomFactor : -maxZoomFactor;
return D2D1_DEFAULT_FLATTENING_TOLERANCE /
(absMaxZoomFactor * D2D1ComputeMaximumScaleFactor(&dpiDependentTransform));
}
} // namespace D2D1
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#endif // #ifndef D2D_USE_C_DEFINITIONS
#endif // #if NTDDI_VERSION >= NTDDI_WINBLUE
#endif // #ifndef _D2D1_HELPER_H_

1860
gfx/include/dxsdk/d2d1_3.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,260 @@
/*=========================================================================*\
Copyright (c) Microsoft Corporation. All rights reserved.
File: D2D1_3Helper.h
Module Name: D2D
Description: Helper files over the D2D interfaces and APIs.
\*=========================================================================*/
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _D2D1_3HELPER_H_
#define _D2D1_3HELPER_H_
#if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
#ifndef _D2D1_3_H_
#include <d2d1_3.h>
#endif // #ifndef _D2D1_3_H_
#ifndef D2D_USE_C_DEFINITIONS
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
namespace D2D1
{
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_GRADIENT_MESH_PATCH
GradientMeshPatch(
D2D1_POINT_2F point00,
D2D1_POINT_2F point01,
D2D1_POINT_2F point02,
D2D1_POINT_2F point03,
D2D1_POINT_2F point10,
D2D1_POINT_2F point11,
D2D1_POINT_2F point12,
D2D1_POINT_2F point13,
D2D1_POINT_2F point20,
D2D1_POINT_2F point21,
D2D1_POINT_2F point22,
D2D1_POINT_2F point23,
D2D1_POINT_2F point30,
D2D1_POINT_2F point31,
D2D1_POINT_2F point32,
D2D1_POINT_2F point33,
D2D1_COLOR_F color00,
D2D1_COLOR_F color03,
D2D1_COLOR_F color30,
D2D1_COLOR_F color33,
D2D1_PATCH_EDGE_MODE topEdgeMode,
D2D1_PATCH_EDGE_MODE leftEdgeMode,
D2D1_PATCH_EDGE_MODE bottomEdgeMode,
D2D1_PATCH_EDGE_MODE rightEdgeMode
)
{
D2D1_GRADIENT_MESH_PATCH newPatch;
newPatch.point00 = point00;
newPatch.point01 = point01;
newPatch.point02 = point02;
newPatch.point03 = point03;
newPatch.point10 = point10;
newPatch.point11 = point11;
newPatch.point12 = point12;
newPatch.point13 = point13;
newPatch.point20 = point20;
newPatch.point21 = point21;
newPatch.point22 = point22;
newPatch.point23 = point23;
newPatch.point30 = point30;
newPatch.point31 = point31;
newPatch.point32 = point32;
newPatch.point33 = point33;
newPatch.color00 = color00;
newPatch.color03 = color03;
newPatch.color30 = color30;
newPatch.color33 = color33;
newPatch.topEdgeMode = topEdgeMode;
newPatch.leftEdgeMode = leftEdgeMode;
newPatch.bottomEdgeMode = bottomEdgeMode;
newPatch.rightEdgeMode = rightEdgeMode;
return newPatch;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_GRADIENT_MESH_PATCH
GradientMeshPatchFromCoonsPatch(
D2D1_POINT_2F point0,
D2D1_POINT_2F point1,
D2D1_POINT_2F point2,
D2D1_POINT_2F point3,
D2D1_POINT_2F point4,
D2D1_POINT_2F point5,
D2D1_POINT_2F point6,
D2D1_POINT_2F point7,
D2D1_POINT_2F point8,
D2D1_POINT_2F point9,
D2D1_POINT_2F point10,
D2D1_POINT_2F point11,
D2D1_COLOR_F color0,
D2D1_COLOR_F color1,
D2D1_COLOR_F color2,
D2D1_COLOR_F color3,
D2D1_PATCH_EDGE_MODE topEdgeMode,
D2D1_PATCH_EDGE_MODE leftEdgeMode,
D2D1_PATCH_EDGE_MODE bottomEdgeMode,
D2D1_PATCH_EDGE_MODE rightEdgeMode
)
{
D2D1_GRADIENT_MESH_PATCH newPatch;
newPatch.point00 = point0;
newPatch.point01 = point1;
newPatch.point02 = point2;
newPatch.point03 = point3;
newPatch.point13 = point4;
newPatch.point23 = point5;
newPatch.point33 = point6;
newPatch.point32 = point7;
newPatch.point31 = point8;
newPatch.point30 = point9;
newPatch.point20 = point10;
newPatch.point10 = point11;
D2D1GetGradientMeshInteriorPointsFromCoonsPatch(
&point0,
&point1,
&point2,
&point3,
&point4,
&point5,
&point6,
&point7,
&point8,
&point9,
&point10,
&point11,
&newPatch.point11,
&newPatch.point12,
&newPatch.point21,
&newPatch.point22
);
newPatch.color00 = color0;
newPatch.color03 = color1;
newPatch.color33 = color2;
newPatch.color30 = color3;
newPatch.topEdgeMode = topEdgeMode;
newPatch.leftEdgeMode = leftEdgeMode;
newPatch.bottomEdgeMode = bottomEdgeMode;
newPatch.rightEdgeMode = rightEdgeMode;
return newPatch;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_INK_POINT
InkPoint(
const D2D1_POINT_2F &point,
FLOAT radius
)
{
D2D1_INK_POINT inkPoint;
inkPoint.x = point.x;
inkPoint.y = point.y;
inkPoint.radius = radius;
return inkPoint;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_INK_BEZIER_SEGMENT
InkBezierSegment(
const D2D1_INK_POINT &point1,
const D2D1_INK_POINT &point2,
const D2D1_INK_POINT &point3
)
{
D2D1_INK_BEZIER_SEGMENT inkBezierSegment;
inkBezierSegment.point1 = point1;
inkBezierSegment.point2 = point2;
inkBezierSegment.point3 = point3;
return inkBezierSegment;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_INK_STYLE_PROPERTIES
InkStyleProperties(
D2D1_INK_NIB_SHAPE nibShape,
const D2D1_MATRIX_3X2_F &nibTransform
)
{
D2D1_INK_STYLE_PROPERTIES inkStyleProperties;
inkStyleProperties.nibShape = nibShape;
inkStyleProperties.nibTransform = nibTransform;
return inkStyleProperties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_RECT_U
InfiniteRectU()
{
D2D1_RECT_U rect = { 0u, 0u, UINT_MAX, UINT_MAX };
return rect;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_SIMPLE_COLOR_PROFILE
SimpleColorProfile(
const D2D1_POINT_2F &redPrimary,
const D2D1_POINT_2F &greenPrimary,
const D2D1_POINT_2F &bluePrimary,
const D2D1_GAMMA1 gamma,
const D2D1_POINT_2F &whitePointXZ
)
{
D2D1_SIMPLE_COLOR_PROFILE simpleColorProfile;
simpleColorProfile.redPrimary = redPrimary;
simpleColorProfile.greenPrimary = greenPrimary;
simpleColorProfile.bluePrimary = bluePrimary;
simpleColorProfile.gamma = gamma;
simpleColorProfile.whitePointXZ = whitePointXZ;
return simpleColorProfile;
}
} // namespace D2D1
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#endif // #ifndef D2D_USE_C_DEFINITIONS
#endif // #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
#endif // #ifndef _D2D1_HELPER_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,98 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2D1EffectAuthor_1.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_EFFECT_AUTHOR_1_H_
#define _D2D1_EFFECT_AUTHOR_1_H_
#ifndef _D2D1_3_H_
#include <d2d1_3.h>
#endif // #ifndef _D2D1_3_H_
#ifndef _D2D1_EFFECT_AUTHOR_H_
#include <d2d1effectauthor.h>
#endif // #ifndef _D2D1_EFFECT_AUTHOR_H_
EXTERN_C CONST IID IID_ID2D1EffectContext1;
EXTERN_C CONST IID IID_ID2D1EffectContext2;
#ifndef D2D_USE_C_DEFINITIONS
/// <summary>
/// The internal context handed to effect authors to create transforms from effects
/// and any other operation tied to context which is not useful to the application
/// facing API.
/// </summary>
interface DX_DECLARE_INTERFACE("84ab595a-fc81-4546-bacd-e8ef4d8abe7a") ID2D1EffectContext1 : public ID2D1EffectContext
{
/// <summary>
/// Creates a 3D lookup table for mapping a 3-channel input to a 3-channel output.
/// The table data must be provided in 4-channel format.
/// </summary>
STDMETHOD(CreateLookupTable3D)(
D2D1_BUFFER_PRECISION precision,
_In_reads_(3) CONST UINT32 *extents,
_In_reads_(dataCount) CONST BYTE *data,
UINT32 dataCount,
_In_reads_(2) CONST UINT32 *strides,
_COM_Outptr_ ID2D1LookupTable3D **lookupTable
) PURE;
}; // interface ID2D1EffectContext1
#if NTDDI_VERSION >= NTDDI_WIN10_RS2
/// <summary>
/// The internal context handed to effect authors to create transforms from effects
/// and any other operation tied to context which is not useful to the application
/// facing API.
/// </summary>
interface DX_DECLARE_INTERFACE("577ad2a0-9fc7-4dda-8b18-dab810140052") ID2D1EffectContext2 : public ID2D1EffectContext1
{
/// <summary>
/// Creates a color context from a DXGI color space type. It is only valid to use
/// this with the Color Management Effect in 'Best' mode.
/// </summary>
STDMETHOD(CreateColorContextFromDxgiColorSpace)(
DXGI_COLOR_SPACE_TYPE colorSpace,
_COM_Outptr_ ID2D1ColorContext1 **colorContext
) PURE;
/// <summary>
/// Creates a color context from a simple color profile. It is only valid to use
/// this with the Color Management Effect in 'Best' mode.
/// </summary>
STDMETHOD(CreateColorContextFromSimpleColorProfile)(
_In_ CONST D2D1_SIMPLE_COLOR_PROFILE *simpleProfile,
_COM_Outptr_ ID2D1ColorContext1 **colorContext
) PURE;
}; // interface ID2D1EffectContext2
#endif
#endif
#ifdef D2D_USE_C_DEFINITIONS
typedef interface ID2D1EffectContext1 ID2D1EffectContext1;
#if NTDDI_VERSION >= NTDDI_WIN10_RS2
typedef interface ID2D1EffectContext2 ID2D1EffectContext2;
#endif
#endif
#endif // #ifndef _D2D1_EFFECT_AUTHOR_1_H_

View File

@ -0,0 +1,410 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// D2D helper functions for effect authors.
//
// File name: D2D1EffectHelpers.h
//---------------------------------------------------------------------------
#pragma once
#ifndef _D2D1_EFFECT_HELPERS_H_
#define _D2D1_EFFECT_HELPERS_H_
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
#include <d2d1effectauthor.h>
//+-----------------------------------------------------------------------------
//
// Function:
// DeducingValueSetter
//
// Synopsis:
// Deduces the class and arguments and then calls a member-function property
// setter callback for a value-type property.
//
// This should not be called directly.
//
//--------------------------------------------------------------------------------
template<class C, typename P, typename I>
HRESULT DeducingValueSetter(
_In_ HRESULT (C::*callback)(P),
_In_ I *effect,
_In_reads_(dataSize) const BYTE *data,
UINT32 dataSize
)
{
// We must exactly match the value-type's size.
if (dataSize != sizeof(P))
{
return E_INVALIDARG;
}
return (static_cast<C *>(effect)->*callback)(*reinterpret_cast<const P *>(data));
}
//+-----------------------------------------------------------------------------
//
// Function:
// ValueSetter
//
// Synopsis:
// Calls a member-function property setter callback for a value-type property.
//
//--------------------------------------------------------------------------------
template<typename T, T P, typename I>
HRESULT CALLBACK ValueSetter(
_In_ IUnknown *effect,
_In_reads_(dataSize) const BYTE *data,
UINT32 dataSize
)
{
// Cast through I to resolve multiple-inheritance ambiguities.
return DeducingValueSetter(P, static_cast<I *>(effect), data, dataSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// DeducingValueGetter
//
// Synopsis:
// Deduces the class and arguments and then calls a member-function property
// getter callback for a value-type property.
//
// This should not be called directly.
//
//--------------------------------------------------------------------------------
template<class C, typename P, typename I>
HRESULT DeducingValueGetter(
_In_ P (C::*callback)() const,
_In_ const I *effect,
_Out_writes_opt_(dataSize) BYTE *data,
UINT32 dataSize,
_Out_opt_ UINT32 *actualSize
)
{
if (actualSize)
{
*actualSize = sizeof(P);
}
if (dataSize > 0 && data)
{
if (dataSize < sizeof(P))
{
return E_NOT_SUFFICIENT_BUFFER;
}
*reinterpret_cast<P *>(data) = (static_cast<const C *>(effect)->*callback)();
}
return S_OK;
}
//+-----------------------------------------------------------------------------
//
// Function:
// ValueGetter
//
// Synopsis:
// Calls a member-function property setter callback for a value-type property.
//
//--------------------------------------------------------------------------------
template<typename T, T P, typename I>
HRESULT CALLBACK ValueGetter(
_In_ const IUnknown *effect,
_Out_writes_opt_(dataSize) BYTE *data,
UINT32 dataSize,
_Out_opt_ UINT32 *actualSize
)
{
// Cast through I to resolve multiple-inheritance ambiguities.
return DeducingValueGetter(P, static_cast<const I *>(effect), data, dataSize, actualSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// DeducingBlobSetter
//
// Synopsis:
// Deduces the class and arguments and then calls a member-function property
// setter callback for a blob-type property.
//
// This should not be called directly.
//
//--------------------------------------------------------------------------------
template<class C, typename I>
HRESULT DeducingBlobSetter(
_In_ HRESULT (C::*callback)(const BYTE *, UINT32),
_In_ I *effect,
_In_reads_(dataSize) const BYTE *data,
UINT32 dataSize
)
{
return (static_cast<C *>(effect)->*callback)(data, dataSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// BlobSetter
//
// Synopsis:
// Calls a member-function property setter callback for a blob-type property.
//
//--------------------------------------------------------------------------------
template<typename T, T P, typename I>
HRESULT CALLBACK BlobSetter(
_In_ IUnknown *effect,
_In_reads_(dataSize) const BYTE *data,
UINT32 dataSize
)
{
// Cast through I to resolve multiple-inheritance ambiguities.
return DeducingBlobSetter(P, static_cast<I *>(effect), data, dataSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// DeducingBlobGetter
//
// Synopsis:
// Deduces the class and arguments and then calls a member-function property
// getter callback for a blob-type property.
//
// This should not be called directly.
//
//--------------------------------------------------------------------------------
template<class C, typename I>
HRESULT DeducingBlobGetter(
_In_ HRESULT (C::*callback)(BYTE *, UINT32, UINT32*) const,
_In_ const I *effect,
_Out_writes_opt_(dataSize) BYTE *data,
UINT32 dataSize,
_Out_opt_ UINT32 *actualSize
)
{
return (static_cast<const C *>(effect)->*callback)(data, dataSize, actualSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// BlobGetter
//
// Synopsis:
// Calls a member-function property getter callback for a blob-type property.
//
//--------------------------------------------------------------------------------
template<typename T, T P, typename I>
HRESULT CALLBACK BlobGetter(
_In_ const IUnknown *effect,
_Out_writes_opt_(dataSize) BYTE *data,
UINT32 dataSize,
_Out_opt_ UINT32 *actualSize
)
{
// Cast through I to resolve multiple-inheritance ambiguities.
return DeducingBlobGetter(P, static_cast<const I *>(effect), data, dataSize, actualSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// DeducingStringSetter
//
// Synopsis:
// Deduces the class and arguments and then calls a member-function property
// setter callback for a string-type property.
//
// This should not be called directly.
//
//--------------------------------------------------------------------------------
template<class C, typename I>
HRESULT DeducingStringSetter(
_In_ HRESULT (C::*callback)(PCWSTR string),
_In_ I *effect,
_In_reads_(dataSize) const BYTE *data,
UINT32 dataSize
)
{
dataSize;
return (static_cast<C *>(effect)->*callback)(reinterpret_cast<PCWSTR>(data));
}
//+-----------------------------------------------------------------------------
//
// Function:
// StringSetter
//
// Synopsis:
// Calls a member-function property setter callback for a string-type property.
//
//--------------------------------------------------------------------------------
template<typename T, T P, typename I>
HRESULT CALLBACK StringSetter(
_In_ IUnknown *effect,
_In_reads_(dataSize) const BYTE *data,
UINT32 dataSize
)
{
// Cast through I to resolve multiple-inheritance ambiguities.
return DeducingStringSetter(P, static_cast<I *>(effect), data, dataSize);
}
//+-----------------------------------------------------------------------------
//
// Function:
// DeducingStringGetter
//
// Synopsis:
// Deduces the class and arguments and then calls a member-function property
// getter callback for a string-type property.
//
// This should not be called directly.
//
//--------------------------------------------------------------------------------
template<class C, typename I>
HRESULT DeducingStringGetter(
_In_ HRESULT (C::*callback)(PWSTR, UINT32, UINT32*) const,
_In_ const I *effect,
_Out_writes_opt_(dataSize) BYTE *data,
UINT32 dataSize,
_Out_opt_ UINT32 *actualSize
)
{
UINT32 cchString = 0;
HRESULT hr = (static_cast<const C *>(effect)->*callback)(reinterpret_cast<PWSTR>(data), dataSize / sizeof(WCHAR), &cchString);
if ((SUCCEEDED(hr) || hr == E_NOT_SUFFICIENT_BUFFER) && actualSize)
{
*actualSize = cchString * sizeof(WCHAR);
}
return hr;
}
//+-----------------------------------------------------------------------------
//
// Function:
// StringGetter
//
// Synopsis:
// Calls a member-function property getter callback for a string-type property.
//
//--------------------------------------------------------------------------------
template<typename T, T P, typename I>
HRESULT CALLBACK StringGetter(
_In_ const IUnknown *effect,
_Out_writes_opt_(dataSize) BYTE *data,
UINT32 dataSize,
_Out_opt_ UINT32 *actualSize
)
{
// Cast through I to resolve multiple-inheritance ambiguities.
return DeducingStringGetter(P, static_cast<const I *>(effect), data, dataSize, actualSize);
}
//
// Simpler versions of the helpers can be declared if decltype is available:
//
#if _MSC_VER >= 1600
#define D2D1_SIMPLE_BINDING_MACROS
#endif
#ifdef D2D1_SIMPLE_BINDING_MACROS
//
// Helper to work around decltype issues:
//
template<typename T>
T GetType(T t) { return t; };
//
// Helper macros for declaring a D2D1_PROPERTY_BINDING for value, blob, or string callbacks.
//
#define D2D1_VALUE_TYPE_BINDING(NAME, SETTER, GETTER) \
{ NAME, &ValueSetter<decltype(GetType(SETTER)), SETTER, ID2D1EffectImpl>, &ValueGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> }
#define D2D1_BLOB_TYPE_BINDING(NAME, SETTER, GETTER) \
{ NAME, &BlobSetter<decltype(GetType(SETTER)), SETTER, ID2D1EffectImpl>, &BlobGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> }
#define D2D1_STRING_TYPE_BINDING(NAME, SETTER, GETTER) \
{ NAME, &StringSetter<decltype(GetType(SETTER)), SETTER, ID2D1EffectImpl>, &StringGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> }
//
// Read-only variants:
//
#define D2D1_READONLY_VALUE_TYPE_BINDING(NAME, GETTER) \
{ NAME, NULL, &ValueGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> }
#define D2D1_READONLY_BLOB_TYPE_BINDING(NAME, GETTER) \
{ NAME, NULL, &BlobGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> }
#define D2D1_READONLY_STRING_TYPE_BINDING(NAME, GETTER) \
{ NAME, NULL, &StringGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> }
#else // #ifdef D2D1_SIMPLE_BINDING_MACROS
//
// Helper macros for declaring a D2D1_PROPERTY_BINDING for value, blob, or string callbacks.
//
#define D2D1_VALUE_TYPE_BINDING(NAME, TYPE, CLASS, SETTER, GETTER) \
{ \
NAME, \
&ValueSetter<HRESULT (CLASS::*)(TYPE), SETTER, ID2D1EffectImpl>, \
&ValueGetter<TYPE (CLASS::*)() const, GETTER, ID2D1EffectImpl> \
}
#define D2D1_BLOB_TYPE_BINDING(NAME, CLASS, SETTER, GETTER) \
{ \
NAME, \
&BlobSetter<HRESULT (CLASS::*)(const BYTE *, UINT32), SETTER, ID2D1EffectImpl>, \
&BlobGetter<HRESULT (CLASS::*)(BYTE *, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \
}
#define D2D1_STRING_TYPE_BINDING(NAME, CLASS, SETTER, GETTER) \
{ \
NAME, \
&StringSetter<HRESULT (CLASS::*)(PCWSTR string), SETTER, ID2D1EffectImpl>, \
&StringGetter<HRESULT (CLASS::*)(PWSTR, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \
}
//
// Read-only variants:
//
#define D2D1_READONLY_VALUE_TYPE_BINDING(NAME, TYPE, CLASS, GETTER) \
{ \
NAME, \
NULL, \
&ValueGetter<TYPE (CLASS::*)() const, GETTER, ID2D1EffectImpl> \
}
#define D2D1_READONLY_BLOB_TYPE_BINDING(NAME, CLASS, GETTER) \
{ \
NAME, \
NULL, \
&BlobGetter<HRESULT (CLASS::*)(BYTE *, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \
}
#define D2D1_READONLY_STRING_TYPE_BINDING(NAME, CLASS, GETTER) \
{ \
NAME, \
NULL, \
&StringGetter<HRESULT (CLASS::*)(PWSTR, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \
}
#endif // #ifdef D2D1_SIMPLE_BINDING_MACROS
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#endif // #ifndef _D2D1_AUTHOR_H_

View File

@ -0,0 +1,316 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
//---------------------------------------------------------------------------
// File contents:
// - Helpers methods for authoring D2D Effect shader code.
// These are located at the end of the file (D2DGetInput, etc.).
// - The top portion contains definitions and initialization required by the helpers.
// These elements are prefaced with "__D2D" and can be safely ignored.
//
// To use these helpers, the following values must be defined before inclusion:
// D2D_INPUT_COUNT - The number of texture inputs to the effect.
// D2D_INPUT[N]_SIMPLE or D2D_INPUT[N]_COMPLEX - How the effect will sample each input. (If unspecificed, defaults to _COMPLEX.)
// D2D_ENTRY - The name of the entry point being compiled. This will usually be defined on the command line at compilation time.
//
// The following values can be optionally defined:
// D2D_FUNCTION - Compile the entry point as an export function. This will usually be defined on the command line at compilation time.
// D2D_FULL_SHADER - Compile the entry point as a full shader. This will usually be defined on the command line at compilation time.
// D2D_FULL_SHADER_ONLY - Only compile the in-scope entry points to full shaders, never to export functions.
//
#define __D2D_DEFINE_PS_GLOBALS(inputIndex) \
Texture2D<float4> InputTexture##inputIndex : register(t##inputIndex); \
SamplerState InputSampler##inputIndex : register(s##inputIndex); \
// Define a texture and sampler pair for each D2D effect input.
#if (D2D_INPUT_COUNT >= 1)
__D2D_DEFINE_PS_GLOBALS(0)
#endif
#if (D2D_INPUT_COUNT >= 2)
__D2D_DEFINE_PS_GLOBALS(1)
#endif
#if (D2D_INPUT_COUNT >= 3)
__D2D_DEFINE_PS_GLOBALS(2)
#endif
#if (D2D_INPUT_COUNT >= 4)
__D2D_DEFINE_PS_GLOBALS(3)
#endif
#if (D2D_INPUT_COUNT >= 5)
__D2D_DEFINE_PS_GLOBALS(4)
#endif
#if (D2D_INPUT_COUNT >= 6)
__D2D_DEFINE_PS_GLOBALS(5)
#endif
#if (D2D_INPUT_COUNT >= 7)
__D2D_DEFINE_PS_GLOBALS(6)
#endif
#if (D2D_INPUT_COUNT >= 8)
__D2D_DEFINE_PS_GLOBALS(7)
#endif
#define __D2D_MAXIMUM_INPUT_COUNT 8
// Validate that all required shader information has been defined.
#ifndef D2D_INPUT_COUNT
#error D2D_INPUT_COUNT is undefined.
#endif
#if (D2D_INPUT_COUNT > __D2D_MAXIMUM_INPUT_COUNT)
#error D2D_INPUT_COUNT exceeds the maximum input count.
#endif
// Define global statics to hold the values needed by intrinsic methods.
// These values are initialized by the entry point wrapper before calling into the
// effect's shader implementation.
#if !defined(D2D_FUNCTION) || defined(D2D_REQUIRES_SCENE_POSITION)
static float4 __d2dstatic_scenePos = float4(0, 0, 0, 0);
#endif
#define __D2D_DEFINE_INPUT_STATICS(inputIndex) \
static float4 __d2dstatic_input##inputIndex = float4(0, 0, 0, 0); \
static float4 __d2dstatic_uv##inputIndex = float4(0, 0, 0, 0); \
#if (D2D_INPUT_COUNT >= 1)
__D2D_DEFINE_INPUT_STATICS(0)
#endif
#if (D2D_INPUT_COUNT >= 2)
__D2D_DEFINE_INPUT_STATICS(1)
#endif
#if (D2D_INPUT_COUNT >= 3)
__D2D_DEFINE_INPUT_STATICS(2)
#endif
#if (D2D_INPUT_COUNT >= 4)
__D2D_DEFINE_INPUT_STATICS(3)
#endif
#if (D2D_INPUT_COUNT >= 5)
__D2D_DEFINE_INPUT_STATICS(4)
#endif
#if (D2D_INPUT_COUNT >= 6)
__D2D_DEFINE_INPUT_STATICS(5)
#endif
#if (D2D_INPUT_COUNT >= 7)
__D2D_DEFINE_INPUT_STATICS(6)
#endif
#if (D2D_INPUT_COUNT >= 8)
__D2D_DEFINE_INPUT_STATICS(7)
#endif
// Define the scene position parameter according to whether the shader requires it,
// and whether it is the only parameter.
// The scene position input always needs to be defined for full shaders.
#if (!defined(D2D_FUNCTION) || defined(D2D_REQUIRES_SCENE_POSITION))
#if (D2D_INPUT_COUNT == 0)
#define __D2D_SCENE_POS float4 __d2dinput_scenePos : SCENE_POSITION
#define __D2D_INIT_STATIC_SCENE_POS __d2dstatic_scenePos = __d2dinput_scenePos
#else
#define __D2D_SCENE_POS float4 __d2dinput_scenePos : SCENE_POSITION,
#define __D2D_INIT_STATIC_SCENE_POS __d2dstatic_scenePos = __d2dinput_scenePos;
#endif
#else
#define __D2D_SCENE_POS
#define __D2D_INIT_STATIC_SCENE_POS
#endif
// When compiling a function version, simple and complex inputs have different definitions.
// When compiling a full shader, they have the same definition.
// Access to input parameters also differs between functions and full shaders.
#if defined(D2D_FUNCTION)
#define __D2D_SIMPLE_INPUT(index) float4 __d2dinput_color##index : INPUT##index
#define __D2D_INIT_SIMPLE_STATIC(index) __d2dstatic_input##index = __d2dinput_color##index
#else
#define __D2D_SIMPLE_INPUT(index) float4 __d2dinput_uv##index : TEXCOORD##index
#define __D2D_INIT_SIMPLE_STATIC(index) __d2dstatic_uv##index = __d2dinput_uv##index
#endif
#define __D2D_COMPLEX_INPUT(index) float4 __d2dinput_uv##index : TEXCOORD##index
#define __D2D_INIT_COMPLEX_STATIC(index) __d2dstatic_uv##index = __d2dinput_uv##index
#define __D2D_SAMPLE_INPUT(index) InputTexture##index.Sample(InputSampler##index, __d2dstatic_uv##index.xy)
// Define each input as either simple or complex.
#if defined(D2D_INPUT0_SIMPLE)
#define __D2D_INPUT0 __D2D_SIMPLE_INPUT(0)
#define __D2D_INIT_STATIC0 __D2D_INIT_SIMPLE_STATIC(0)
#define __D2D_GET_INPUT0 __d2dstatic_input0
#else
#define __D2D_INPUT0 __D2D_COMPLEX_INPUT(0)
#define __D2D_INIT_STATIC0 __D2D_INIT_COMPLEX_STATIC(0)
#define __D2D_GET_INPUT0 __D2D_SAMPLE_INPUT(0)
#endif
#if defined(D2D_INPUT1_SIMPLE)
#define __D2D_INPUT1 __D2D_SIMPLE_INPUT(1)
#define __D2D_INIT_STATIC1 __D2D_INIT_SIMPLE_STATIC(1)
#define __D2D_GET_INPUT1 __d2dstatic_input1
#else
#define __D2D_INPUT1 __D2D_COMPLEX_INPUT(1)
#define __D2D_INIT_STATIC1 __D2D_INIT_COMPLEX_STATIC(1)
#define __D2D_GET_INPUT1 __D2D_SAMPLE_INPUT(1)
#endif
#if defined(D2D_INPUT2_SIMPLE)
#define __D2D_INPUT2 __D2D_SIMPLE_INPUT(2)
#define __D2D_INIT_STATIC2 __D2D_INIT_SIMPLE_STATIC(2)
#define __D2D_GET_INPUT2 __d2dstatic_input2
#else
#define __D2D_INPUT2 __D2D_COMPLEX_INPUT(2)
#define __D2D_INIT_STATIC2 __D2D_INIT_COMPLEX_STATIC(2)
#define __D2D_GET_INPUT2 __D2D_SAMPLE_INPUT(2)
#endif
#if defined(D2D_INPUT3_SIMPLE)
#define __D2D_INPUT3 __D2D_SIMPLE_INPUT(3)
#define __D2D_INIT_STATIC3 __D2D_INIT_SIMPLE_STATIC(3)
#define __D2D_GET_INPUT3 __d2dstatic_input3
#else
#define __D2D_INPUT3 __D2D_COMPLEX_INPUT(3)
#define __D2D_INIT_STATIC3 __D2D_INIT_COMPLEX_STATIC(3)
#define __D2D_GET_INPUT3 __D2D_SAMPLE_INPUT(3)
#endif
#if defined(D2D_INPUT4_SIMPLE)
#define __D2D_INPUT4 __D2D_SIMPLE_INPUT(4)
#define __D2D_INIT_STATIC4 __D2D_INIT_SIMPLE_STATIC(4)
#define __D2D_GET_INPUT4 __d2dstatic_input4
#else
#define __D2D_INPUT4 __D2D_COMPLEX_INPUT(4)
#define __D2D_INIT_STATIC4 __D2D_INIT_COMPLEX_STATIC(4)
#define __D2D_GET_INPUT4 __D2D_SAMPLE_INPUT(4)
#endif
#if defined(D2D_INPUT5_SIMPLE)
#define __D2D_INPUT5 __D2D_SIMPLE_INPUT(5)
#define __D2D_INIT_STATIC5 __D2D_INIT_SIMPLE_STATIC(5)
#define __D2D_GET_INPUT5 __d2dstatic_input5
#else
#define __D2D_INPUT5 __D2D_COMPLEX_INPUT(5)
#define __D2D_INIT_STATIC5 __D2D_INIT_COMPLEX_STATIC(5)
#define __D2D_GET_INPUT5 __D2D_SAMPLE_INPUT(5)
#endif
#if defined(D2D_INPUT6_SIMPLE)
#define __D2D_INPUT6 __D2D_SIMPLE_INPUT(6)
#define __D2D_INIT_STATIC6 __D2D_INIT_SIMPLE_STATIC(6)
#define __D2D_GET_INPUT6 __d2dstatic_input6
#else
#define __D2D_INPUT6 __D2D_COMPLEX_INPUT(6)
#define __D2D_INIT_STATIC6 __D2D_INIT_COMPLEX_STATIC(6)
#define __D2D_GET_INPUT6 __D2D_SAMPLE_INPUT(6)
#endif
#if defined(D2D_INPUT7_SIMPLE)
#define __D2D_INPUT7 __D2D_SIMPLE_INPUT(7)
#define __D2D_INIT_STATIC7 __D2D_INIT_SIMPLE_STATIC(7)
#define __D2D_GET_INPUT7 __d2dstatic_input7
#else
#define __D2D_INPUT7 __D2D_COMPLEX_INPUT(7)
#define __D2D_INIT_STATIC7 __D2D_INIT_COMPLEX_STATIC(7)
#define __D2D_GET_INPUT7 __D2D_SAMPLE_INPUT(7)
#endif
#if defined(D2D_INPUT8_SIMPLE)
#define __D2D_INPUT8 __D2D_SIMPLE_INPUT(8)
#define __D2D_INIT_STATIC8 __D2D_INIT_SIMPLE_STATIC(8)
#define __D2D_GET_INPUT8 __d2dstatic_input8
#else
#define __D2D_INPUT8 __D2D_COMPLEX_INPUT(8)
#define __D2D_INIT_STATIC8 __D2D_INIT_COMPLEX_STATIC(8)
#define __D2D_GET_INPUT8 __D2D_SAMPLE_INPUT(8)
#endif
// Define the export function inputs based on the defined input count and types.
#if (D2D_INPUT_COUNT == 0)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS
#elif (D2D_INPUT_COUNT == 1)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0
#elif (D2D_INPUT_COUNT == 2)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1
#elif (D2D_INPUT_COUNT == 3)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2
#elif (D2D_INPUT_COUNT == 4)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3
#elif (D2D_INPUT_COUNT == 5)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4
#elif (D2D_INPUT_COUNT == 6)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4, __D2D_INPUT5
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4; __D2D_INIT_STATIC5
#elif (D2D_INPUT_COUNT == 7)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4, __D2D_INPUT5, __D2D_INPUT6
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4; __D2D_INIT_STATIC5; __D2D_INIT_STATIC6
#elif (D2D_INPUT_COUNT == 8)
#define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4, __D2D_INPUT5, __D2D_INPUT6, __D2D_INPUT7
#define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4; __D2D_INIT_STATIC5; __D2D_INIT_STATIC6; __D2D_INIT_STATIC7
#endif
#if !defined(CONCAT)
#define CONCAT(str1, str2) str1##str2
#endif
// Rename the entry point target function so that the actual entry point can use the name.
// This expansion is the same for both full shaders and functions.
#define D2D_PS_ENTRY(name) float4 CONCAT(name, _Impl)()
// If neither D2D_FUNCTION or D2D_FULL_SHADER is defined, behave as if D2D_FULL_SHADER is defined.
#if defined(D2D_FUNCTION) && !defined(D2D_FULL_SHADER_ONLY)
// Replaces simple samples with either static variable or an actual sample,
// depending on whether the input is declared as simple or complex.
#define D2DGetInput(index) __D2D_GET_INPUT##index
#if !defined(D2D_CUSTOM_ENTRY)
// Declare function prototype for the target function so that it can be referenced before definition.
// D2D_ENTRY is a macro whose actual name resolves to the effect's target "entry point" function.
float4 CONCAT(D2D_ENTRY, _Impl)();
// This is the actual entry point definition, which forwards the call to the target function.
export float4 D2D_func_entry(__D2D_FUNCTION_INPUTS)
{
__D2D_INIT_STATICS;
return CONCAT(D2D_ENTRY, _Impl)();
}
#endif
#else // !defined(D2D_FUNCTION)
// Replaces simple samples with actual samples.
#define D2DGetInput(index) __D2D_SAMPLE_INPUT(index)
#if !defined(D2D_CUSTOM_ENTRY)
// Declare function prototype for the target function so that it can be referenced before definition.
// D2D_ENTRY is a macro whose actual name resolves to the effect's target "entry point" function.
float4 CONCAT(D2D_ENTRY, _Impl)();
// This is the actual entry point definition, which forwards the call to the target function.
float4 D2D_ENTRY (float4 pos : SV_POSITION, __D2D_FUNCTION_INPUTS) : SV_TARGET
{
__D2D_INIT_STATICS;
return CONCAT(D2D_ENTRY, _Impl)();
}
#endif
#endif // D2D_FUNCTION
//===============================================================
// Along with D2DGetInput defined above, the following macros and
// methods define D2D intrinsics for use in effect shader code.
//===============================================================
#if !defined(D2D_FUNCTION) || defined(D2D_REQUIRES_SCENE_POSITION)
inline float4 D2DGetScenePosition()
{
return __d2dstatic_scenePos;
}
#endif
#define D2DGetInputCoordinate(index) __d2dstatic_uv##index
#define D2DSampleInput(index, position) InputTexture##index.Sample(InputSampler##index, position)
#define D2DSampleInputAtOffset(index, offset) InputTexture##index.Sample(InputSampler##index, __d2dstatic_uv##index.xy + offset * __d2dstatic_uv##index.zw)
#define D2DSampleInputAtPosition(index, pos) InputTexture##index.Sample(InputSampler##index, __d2dstatic_uv##index.xy + __d2dstatic_uv##index.zw * (pos - __d2dstatic_scenePos.xy))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2D1Effects_1.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_EFFECTS_1_
#define _D2D1_EFFECTS_1_
#ifndef _D2D1_EFFECTS_
#include <d2d1effects.h>
#endif // #ifndef _D2D1_EFFECTS_
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
// Built in effect CLSIDs
DEFINE_GUID(CLSID_D2D1YCbCr, 0x99503cc1, 0x66c7, 0x45c9, 0xa8, 0x75, 0x8a, 0xd8, 0xa7, 0x91, 0x44, 0x01);
/// <summary>
/// The enumeration of the YCbCr effect's top level properties.
/// </summary>
typedef enum D2D1_YCBCR_PROP
{
/// <summary>
/// Property Name: "ChromaSubsampling"
/// Property Type: D2D1_YCBCR_CHROMA_SUBSAMPLING
/// </summary>
D2D1_YCBCR_PROP_CHROMA_SUBSAMPLING = 0,
/// <summary>
/// Property Name: "TransformMatrix"
/// Property Type: D2D1_MATRIX_3X2_F
/// </summary>
D2D1_YCBCR_PROP_TRANSFORM_MATRIX = 1,
/// <summary>
/// Property Name: "InterpolationMode"
/// Property Type: D2D1_YCBCR_INTERPOLATION_MODE
/// </summary>
D2D1_YCBCR_PROP_INTERPOLATION_MODE = 2,
D2D1_YCBCR_PROP_FORCE_DWORD = 0xffffffff
} D2D1_YCBCR_PROP;
typedef enum D2D1_YCBCR_CHROMA_SUBSAMPLING
{
D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO = 0,
D2D1_YCBCR_CHROMA_SUBSAMPLING_420 = 1,
D2D1_YCBCR_CHROMA_SUBSAMPLING_422 = 2,
D2D1_YCBCR_CHROMA_SUBSAMPLING_444 = 3,
D2D1_YCBCR_CHROMA_SUBSAMPLING_440 = 4,
D2D1_YCBCR_CHROMA_SUBSAMPLING_FORCE_DWORD = 0xffffffff
} D2D1_YCBCR_CHROMA_SUBSAMPLING;
typedef enum D2D1_YCBCR_INTERPOLATION_MODE
{
D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
D2D1_YCBCR_INTERPOLATION_MODE_LINEAR = 1,
D2D1_YCBCR_INTERPOLATION_MODE_CUBIC = 2,
D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3,
D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPIC = 4,
D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5,
D2D1_YCBCR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_YCBCR_INTERPOLATION_MODE;
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#endif // #ifndef _D2D1_EFFECTS_1_

View File

@ -0,0 +1,535 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2D1Effects_2.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_EFFECTS_2_
#define _D2D1_EFFECTS_2_
#ifndef _D2D1_EFFECTS_1_
#include <d2d1effects_1.h>
#endif // #ifndef _D2D1_EFFECTS_1_
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
// Built in effect CLSIDs
DEFINE_GUID(CLSID_D2D1Contrast, 0xb648a78a, 0x0ed5, 0x4f80, 0xa9, 0x4a, 0x8e, 0x82, 0x5a, 0xca, 0x6b, 0x77);
DEFINE_GUID(CLSID_D2D1RgbToHue, 0x23f3e5ec, 0x91e8, 0x4d3d, 0xad, 0x0a, 0xaf, 0xad, 0xc1, 0x00, 0x4a, 0xa1);
DEFINE_GUID(CLSID_D2D1HueToRgb, 0x7b78a6bd, 0x0141, 0x4def, 0x8a, 0x52, 0x63, 0x56, 0xee, 0x0c, 0xbd, 0xd5);
DEFINE_GUID(CLSID_D2D1ChromaKey, 0x74C01F5B, 0x2A0D, 0x408C, 0x88, 0xE2, 0xC7, 0xA3, 0xC7, 0x19, 0x77, 0x42);
DEFINE_GUID(CLSID_D2D1Emboss, 0xb1c5eb2b, 0x0348, 0x43f0, 0x81, 0x07, 0x49, 0x57, 0xca, 0xcb, 0xa2, 0xae);
DEFINE_GUID(CLSID_D2D1Exposure, 0xb56c8cfa, 0xf634, 0x41ee, 0xbe, 0xe0, 0xff, 0xa6, 0x17, 0x10, 0x60, 0x04);
DEFINE_GUID(CLSID_D2D1Grayscale, 0x36DDE0EB, 0x3725, 0x42E0, 0x83, 0x6D, 0x52, 0xFB, 0x20, 0xAE, 0xE6, 0x44);
DEFINE_GUID(CLSID_D2D1Invert, 0xe0c3784d, 0xcb39, 0x4e84, 0xb6, 0xfd, 0x6b, 0x72, 0xf0, 0x81, 0x02, 0x63);
DEFINE_GUID(CLSID_D2D1Posterize, 0x2188945e, 0x33a3, 0x4366, 0xb7, 0xbc, 0x08, 0x6b, 0xd0, 0x2d, 0x08, 0x84);
DEFINE_GUID(CLSID_D2D1Sepia, 0x3a1af410, 0x5f1d, 0x4dbe, 0x84, 0xdf, 0x91, 0x5d, 0xa7, 0x9b, 0x71, 0x53);
DEFINE_GUID(CLSID_D2D1Sharpen, 0xC9B887CB, 0xC5FF, 0x4DC5, 0x97, 0x79, 0x27, 0x3D, 0xCF, 0x41, 0x7C, 0x7D);
DEFINE_GUID(CLSID_D2D1Straighten, 0x4da47b12, 0x79a3, 0x4fb0, 0x82, 0x37, 0xbb, 0xc3, 0xb2, 0xa4, 0xde, 0x08);
DEFINE_GUID(CLSID_D2D1TemperatureTint, 0x89176087, 0x8AF9, 0x4A08, 0xAE, 0xB1, 0x89, 0x5F, 0x38, 0xDB, 0x17, 0x66);
DEFINE_GUID(CLSID_D2D1Vignette, 0xc00c40be, 0x5e67, 0x4ca3, 0x95, 0xb4, 0xf4, 0xb0, 0x2c, 0x11, 0x51, 0x35);
DEFINE_GUID(CLSID_D2D1EdgeDetection, 0xEFF583CA, 0xCB07, 0x4AA9, 0xAC, 0x5D, 0x2C, 0xC4, 0x4C, 0x76, 0x46, 0x0F);
DEFINE_GUID(CLSID_D2D1HighlightsShadows, 0xCADC8384, 0x323F, 0x4C7E, 0xA3, 0x61, 0x2E, 0x2B, 0x24, 0xDF, 0x6E, 0xE4);
DEFINE_GUID(CLSID_D2D1LookupTable3D, 0x349E0EDA, 0x0088, 0x4A79, 0x9C, 0xA3, 0xC7, 0xE3, 0x00, 0x20, 0x20, 0x20);
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
DEFINE_GUID(CLSID_D2D1Opacity, 0x811d79a4, 0xde28, 0x4454, 0x80, 0x94, 0xc6, 0x46, 0x85, 0xf8, 0xbd, 0x4c);
DEFINE_GUID(CLSID_D2D1AlphaMask, 0xc80ecff0, 0x3fd5, 0x4f05, 0x83, 0x28, 0xc5, 0xd1, 0x72, 0x4b, 0x4f, 0x0a);
DEFINE_GUID(CLSID_D2D1CrossFade, 0x12f575e8, 0x4db1, 0x485f, 0x9a, 0x84, 0x03, 0xa0, 0x7d, 0xd3, 0x82, 0x9f);
DEFINE_GUID(CLSID_D2D1Tint, 0x36312b17, 0xf7dd, 0x4014, 0x91, 0x5d, 0xff, 0xca, 0x76, 0x8c, 0xf2, 0x11);
#endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1
/// <summary>
/// The enumeration of the Contrast effect's top level properties.
/// </summary>
typedef enum D2D1_CONTRAST_PROP
{
/// <summary>
/// Property Name: "Contrast"
/// Property Type: FLOAT
/// </summary>
D2D1_CONTRAST_PROP_CONTRAST = 0,
/// <summary>
/// Property Name: "ClampInput"
/// Property Type: BOOL
/// </summary>
D2D1_CONTRAST_PROP_CLAMP_INPUT = 1,
D2D1_CONTRAST_PROP_FORCE_DWORD = 0xffffffff
} D2D1_CONTRAST_PROP;
/// <summary>
/// The enumeration of the RgbToHue effect's top level properties.
/// </summary>
typedef enum D2D1_RGBTOHUE_PROP
{
/// <summary>
/// Property Name: "OutputColorSpace"
/// Property Type: D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
/// </summary>
D2D1_RGBTOHUE_PROP_OUTPUT_COLOR_SPACE = 0,
D2D1_RGBTOHUE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_RGBTOHUE_PROP;
typedef enum D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
{
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
} D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE;
/// <summary>
/// The enumeration of the HueToRgb effect's top level properties.
/// </summary>
typedef enum D2D1_HUETORGB_PROP
{
/// <summary>
/// Property Name: "InputColorSpace"
/// Property Type: D2D1_HUETORGB_INPUT_COLOR_SPACE
/// </summary>
D2D1_HUETORGB_PROP_INPUT_COLOR_SPACE = 0,
D2D1_HUETORGB_PROP_FORCE_DWORD = 0xffffffff
} D2D1_HUETORGB_PROP;
typedef enum D2D1_HUETORGB_INPUT_COLOR_SPACE
{
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
D2D1_HUETORGB_INPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
} D2D1_HUETORGB_INPUT_COLOR_SPACE;
/// <summary>
/// The enumeration of the Chroma Key effect's top level properties.
/// </summary>
typedef enum D2D1_CHROMAKEY_PROP
{
/// <summary>
/// Property Name: "Color"
/// Property Type: D2D1_VECTOR_3F
/// </summary>
D2D1_CHROMAKEY_PROP_COLOR = 0,
/// <summary>
/// Property Name: "Tolerance"
/// Property Type: FLOAT
/// </summary>
D2D1_CHROMAKEY_PROP_TOLERANCE = 1,
/// <summary>
/// Property Name: "InvertAlpha"
/// Property Type: BOOL
/// </summary>
D2D1_CHROMAKEY_PROP_INVERT_ALPHA = 2,
/// <summary>
/// Property Name: "Feather"
/// Property Type: BOOL
/// </summary>
D2D1_CHROMAKEY_PROP_FEATHER = 3,
D2D1_CHROMAKEY_PROP_FORCE_DWORD = 0xffffffff
} D2D1_CHROMAKEY_PROP;
/// <summary>
/// The enumeration of the Emboss effect's top level properties.
/// </summary>
typedef enum D2D1_EMBOSS_PROP
{
/// <summary>
/// Property Name: "Height"
/// Property Type: FLOAT
/// </summary>
D2D1_EMBOSS_PROP_HEIGHT = 0,
/// <summary>
/// Property Name: "Direction"
/// Property Type: FLOAT
/// </summary>
D2D1_EMBOSS_PROP_DIRECTION = 1,
D2D1_EMBOSS_PROP_FORCE_DWORD = 0xffffffff
} D2D1_EMBOSS_PROP;
/// <summary>
/// The enumeration of the Exposure effect's top level properties.
/// </summary>
typedef enum D2D1_EXPOSURE_PROP
{
/// <summary>
/// Property Name: "ExposureValue"
/// Property Type: FLOAT
/// </summary>
D2D1_EXPOSURE_PROP_EXPOSURE_VALUE = 0,
D2D1_EXPOSURE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_EXPOSURE_PROP;
/// <summary>
/// The enumeration of the Posterize effect's top level properties.
/// </summary>
typedef enum D2D1_POSTERIZE_PROP
{
/// <summary>
/// Property Name: "RedValueCount"
/// Property Type: UINT32
/// </summary>
D2D1_POSTERIZE_PROP_RED_VALUE_COUNT = 0,
/// <summary>
/// Property Name: "GreenValueCount"
/// Property Type: UINT32
/// </summary>
D2D1_POSTERIZE_PROP_GREEN_VALUE_COUNT = 1,
/// <summary>
/// Property Name: "BlueValueCount"
/// Property Type: UINT32
/// </summary>
D2D1_POSTERIZE_PROP_BLUE_VALUE_COUNT = 2,
D2D1_POSTERIZE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_POSTERIZE_PROP;
/// <summary>
/// The enumeration of the Sepia effect's top level properties.
/// </summary>
typedef enum D2D1_SEPIA_PROP
{
/// <summary>
/// Property Name: "Intensity"
/// Property Type: FLOAT
/// </summary>
D2D1_SEPIA_PROP_INTENSITY = 0,
/// <summary>
/// Property Name: "AlphaMode"
/// Property Type: D2D1_ALPHA_MODE
/// </summary>
D2D1_SEPIA_PROP_ALPHA_MODE = 1,
D2D1_SEPIA_PROP_FORCE_DWORD = 0xffffffff
} D2D1_SEPIA_PROP;
/// <summary>
/// The enumeration of the Sharpen effect's top level properties.
/// </summary>
typedef enum D2D1_SHARPEN_PROP
{
/// <summary>
/// Property Name: "Sharpness"
/// Property Type: FLOAT
/// </summary>
D2D1_SHARPEN_PROP_SHARPNESS = 0,
/// <summary>
/// Property Name: "Threshold"
/// Property Type: FLOAT
/// </summary>
D2D1_SHARPEN_PROP_THRESHOLD = 1,
D2D1_SHARPEN_PROP_FORCE_DWORD = 0xffffffff
} D2D1_SHARPEN_PROP;
/// <summary>
/// The enumeration of the Straighten effect's top level properties.
/// </summary>
typedef enum D2D1_STRAIGHTEN_PROP
{
/// <summary>
/// Property Name: "Angle"
/// Property Type: FLOAT
/// </summary>
D2D1_STRAIGHTEN_PROP_ANGLE = 0,
/// <summary>
/// Property Name: "MaintainSize"
/// Property Type: BOOL
/// </summary>
D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE = 1,
/// <summary>
/// Property Name: "ScaleMode"
/// Property Type: D2D1_STRAIGHTEN_SCALE_MODE
/// </summary>
D2D1_STRAIGHTEN_PROP_SCALE_MODE = 2,
D2D1_STRAIGHTEN_PROP_FORCE_DWORD = 0xffffffff
} D2D1_STRAIGHTEN_PROP;
typedef enum D2D1_STRAIGHTEN_SCALE_MODE
{
D2D1_STRAIGHTEN_SCALE_MODE_NEAREST_NEIGHBOR = 0,
D2D1_STRAIGHTEN_SCALE_MODE_LINEAR = 1,
D2D1_STRAIGHTEN_SCALE_MODE_CUBIC = 2,
D2D1_STRAIGHTEN_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3,
D2D1_STRAIGHTEN_SCALE_MODE_ANISOTROPIC = 4,
D2D1_STRAIGHTEN_SCALE_MODE_FORCE_DWORD = 0xffffffff
} D2D1_STRAIGHTEN_SCALE_MODE;
/// <summary>
/// The enumeration of the Temperature And Tint effect's top level properties.
/// </summary>
typedef enum D2D1_TEMPERATUREANDTINT_PROP
{
/// <summary>
/// Property Name: "Temperature"
/// Property Type: FLOAT
/// </summary>
D2D1_TEMPERATUREANDTINT_PROP_TEMPERATURE = 0,
/// <summary>
/// Property Name: "Tint"
/// Property Type: FLOAT
/// </summary>
D2D1_TEMPERATUREANDTINT_PROP_TINT = 1,
D2D1_TEMPERATUREANDTINT_PROP_FORCE_DWORD = 0xffffffff
} D2D1_TEMPERATUREANDTINT_PROP;
/// <summary>
/// The enumeration of the Vignette effect's top level properties.
/// </summary>
typedef enum D2D1_VIGNETTE_PROP
{
/// <summary>
/// Property Name: "Color"
/// Property Type: D2D1_VECTOR_4F
/// </summary>
D2D1_VIGNETTE_PROP_COLOR = 0,
/// <summary>
/// Property Name: "TransitionSize"
/// Property Type: FLOAT
/// </summary>
D2D1_VIGNETTE_PROP_TRANSITION_SIZE = 1,
/// <summary>
/// Property Name: "Strength"
/// Property Type: FLOAT
/// </summary>
D2D1_VIGNETTE_PROP_STRENGTH = 2,
D2D1_VIGNETTE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_VIGNETTE_PROP;
/// <summary>
/// The enumeration of the Edge Detection effect's top level properties.
/// </summary>
typedef enum D2D1_EDGEDETECTION_PROP
{
/// <summary>
/// Property Name: "Strength"
/// Property Type: FLOAT
/// </summary>
D2D1_EDGEDETECTION_PROP_STRENGTH = 0,
/// <summary>
/// Property Name: "BlurRadius"
/// Property Type: FLOAT
/// </summary>
D2D1_EDGEDETECTION_PROP_BLUR_RADIUS = 1,
/// <summary>
/// Property Name: "Mode"
/// Property Type: D2D1_EDGEDETECTION_MODE
/// </summary>
D2D1_EDGEDETECTION_PROP_MODE = 2,
/// <summary>
/// Property Name: "OverlayEdges"
/// Property Type: BOOL
/// </summary>
D2D1_EDGEDETECTION_PROP_OVERLAY_EDGES = 3,
/// <summary>
/// Property Name: "AlphaMode"
/// Property Type: D2D1_ALPHA_MODE
/// </summary>
D2D1_EDGEDETECTION_PROP_ALPHA_MODE = 4,
D2D1_EDGEDETECTION_PROP_FORCE_DWORD = 0xffffffff
} D2D1_EDGEDETECTION_PROP;
typedef enum D2D1_EDGEDETECTION_MODE
{
D2D1_EDGEDETECTION_MODE_SOBEL = 0,
D2D1_EDGEDETECTION_MODE_PREWITT = 1,
D2D1_EDGEDETECTION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_EDGEDETECTION_MODE;
/// <summary>
/// The enumeration of the Highlights and Shadows effect's top level properties.
/// </summary>
typedef enum D2D1_HIGHLIGHTSANDSHADOWS_PROP
{
/// <summary>
/// Property Name: "Highlights"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_HIGHLIGHTS = 0,
/// <summary>
/// Property Name: "Shadows"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_SHADOWS = 1,
/// <summary>
/// Property Name: "Clarity"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_CLARITY = 2,
/// <summary>
/// Property Name: "InputGamma"
/// Property Type: D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_INPUT_GAMMA = 3,
/// <summary>
/// Property Name: "MaskBlurRadius"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_MASK_BLUR_RADIUS = 4,
D2D1_HIGHLIGHTSANDSHADOWS_PROP_FORCE_DWORD = 0xffffffff
} D2D1_HIGHLIGHTSANDSHADOWS_PROP;
typedef enum D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
{
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_LINEAR = 0,
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_SRGB = 1,
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_FORCE_DWORD = 0xffffffff
} D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA;
/// <summary>
/// The enumeration of the Lookup Table 3D effect's top level properties.
/// </summary>
typedef enum D2D1_LOOKUPTABLE3D_PROP
{
/// <summary>
/// Property Name: "Lut"
/// Property Type: IUnknown *
/// </summary>
D2D1_LOOKUPTABLE3D_PROP_LUT = 0,
/// <summary>
/// Property Name: "AlphaMode"
/// Property Type: D2D1_ALPHA_MODE
/// </summary>
D2D1_LOOKUPTABLE3D_PROP_ALPHA_MODE = 1,
D2D1_LOOKUPTABLE3D_PROP_FORCE_DWORD = 0xffffffff
} D2D1_LOOKUPTABLE3D_PROP;
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
/// <summary>
/// The enumeration of the Opacity effect's top level properties.
/// </summary>
typedef enum D2D1_OPACITY_PROP
{
/// <summary>
/// Property Name: "Opacity"
/// Property Type: FLOAT
/// </summary>
D2D1_OPACITY_PROP_OPACITY = 0,
D2D1_OPACITY_PROP_FORCE_DWORD = 0xffffffff
} D2D1_OPACITY_PROP;
/// <summary>
/// The enumeration of the Cross Fade effect's top level properties.
/// </summary>
typedef enum D2D1_CROSSFADE_PROP
{
/// <summary>
/// Property Name: "Weight"
/// Property Type: FLOAT
/// </summary>
D2D1_CROSSFADE_PROP_WEIGHT = 0,
D2D1_CROSSFADE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_CROSSFADE_PROP;
/// <summary>
/// The enumeration of the Tint effect's top level properties.
/// </summary>
typedef enum D2D1_TINT_PROP
{
/// <summary>
/// Property Name: "Color"
/// Property Type: D2D1_VECTOR_4F
/// </summary>
D2D1_TINT_PROP_COLOR = 0,
/// <summary>
/// Property Name: "ClampOutput"
/// Property Type: BOOL
/// </summary>
D2D1_TINT_PROP_CLAMP_OUTPUT = 1,
D2D1_TINT_PROP_FORCE_DWORD = 0xffffffff
} D2D1_TINT_PROP;
#endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
#endif // #ifndef _D2D1_EFFECTS_2_

File diff suppressed because it is too large Load Diff

1832
gfx/include/dxsdk/d2d1svg.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2DBaseTypes.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2DBASETYPES_INCLUDED
#define _D2DBASETYPES_INCLUDED
#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#endif // #ifndef COM_NO_WINDOWS_H
#ifndef __dxgitype_h__
#include <dxgitype.h>
#endif // #ifndef __dxgitype_h__
#ifndef DCOMMON_H_INCLUDED
#include <dcommon.h>
#endif // #ifndef DCOMMON_H_INCLUDED
typedef D3DCOLORVALUE D2D_COLOR_F;
#endif // #ifndef _D2DBASETYPES_INCLUDED

230
gfx/include/dxsdk/d2derr.h Normal file
View File

@ -0,0 +1,230 @@
/*=========================================================================*\
Copyright (c) Microsoft Corporation. All rights reserved.
\*=========================================================================*/
#pragma once
/*#include <winapifamily.h>*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
/*=========================================================================*\
D2D Status Codes
\*=========================================================================*/
#define FACILITY_D2D 0x899
#define MAKE_D2DHR( sev, code )\
MAKE_HRESULT( sev, FACILITY_D2D, (code) )
#define MAKE_D2DHR_ERR( code )\
MAKE_D2DHR( 1, code )
//+----------------------------------------------------------------------------
//
// D2D error codes
//
//------------------------------------------------------------------------------
//
// Error codes shared with WINCODECS
//
//
// The pixel format is not supported.
//
#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
//
// Error codes that were already returned in prior versions and were part of the
// MIL facility.
//
// Error codes mapped from WIN32 where there isn't already another HRESULT based
// define
//
//
// The supplied buffer was too small to accommodate the data.
//
#define D2DERR_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
//
// The file specified was not found.
//
#define D2DERR_FILE_NOT_FOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
#ifndef D2DERR_WRONG_STATE
//
// D2D specific codes
//
//
// The object was not in the correct state to process the method.
//
#define D2DERR_WRONG_STATE MAKE_D2DHR_ERR(0x001)
//
// The object has not yet been initialized.
//
#define D2DERR_NOT_INITIALIZED MAKE_D2DHR_ERR(0x002)
//
// The requested opertion is not supported.
//
#define D2DERR_UNSUPPORTED_OPERATION MAKE_D2DHR_ERR(0x003)
//
// The geomery scanner failed to process the data.
//
#define D2DERR_SCANNER_FAILED MAKE_D2DHR_ERR(0x004)
//
// D2D could not access the screen.
//
#define D2DERR_SCREEN_ACCESS_DENIED MAKE_D2DHR_ERR(0x005)
//
// A valid display state could not be determined.
//
#define D2DERR_DISPLAY_STATE_INVALID MAKE_D2DHR_ERR(0x006)
//
// The supplied vector is vero.
//
#define D2DERR_ZERO_VECTOR MAKE_D2DHR_ERR(0x007)
//
// An internal error (D2D bug) occurred. On checked builds, we would assert.
//
// The application should close this instance of D2D and should consider
// restarting its process.
//
#define D2DERR_INTERNAL_ERROR MAKE_D2DHR_ERR(0x008)
//
// The display format we need to render is not supported by the
// hardware device.
//
#define D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED MAKE_D2DHR_ERR(0x009)
//
// A call to this method is invalid.
//
#define D2DERR_INVALID_CALL MAKE_D2DHR_ERR(0x00A)
//
// No HW rendering device is available for this operation.
//
#define D2DERR_NO_HARDWARE_DEVICE MAKE_D2DHR_ERR(0x00B)
//
// There has been a presentation error that may be recoverable. The caller
// needs to recreate, rerender the entire frame, and reattempt present.
//
#define D2DERR_RECREATE_TARGET MAKE_D2DHR_ERR(0x00C)
//
// Shader construction failed because it was too complex.
//
#define D2DERR_TOO_MANY_SHADER_ELEMENTS MAKE_D2DHR_ERR(0x00D)
//
// Shader compilation failed.
//
#define D2DERR_SHADER_COMPILE_FAILED MAKE_D2DHR_ERR(0x00E)
//
// Requested DX surface size exceeded maximum texture size.
//
#define D2DERR_MAX_TEXTURE_SIZE_EXCEEDED MAKE_D2DHR_ERR(0x00F)
//
// The requested D2D version is not supported.
//
#define D2DERR_UNSUPPORTED_VERSION MAKE_D2DHR_ERR(0x010)
//
// Invalid number.
//
#define D2DERR_BAD_NUMBER MAKE_D2DHR_ERR(0x0011)
//
// Objects used together must be created from the same factory instance.
//
#define D2DERR_WRONG_FACTORY MAKE_D2DHR_ERR(0x012)
//
// A layer resource can only be in use once at any point in time.
//
#define D2DERR_LAYER_ALREADY_IN_USE MAKE_D2DHR_ERR(0x013)
//
// The pop call did not match the corresponding push call
//
#define D2DERR_POP_CALL_DID_NOT_MATCH_PUSH MAKE_D2DHR_ERR(0x014)
//
// The resource was realized on the wrong render target
//
#define D2DERR_WRONG_RESOURCE_DOMAIN MAKE_D2DHR_ERR(0x015)
//
// The push and pop calls were unbalanced
//
#define D2DERR_PUSH_POP_UNBALANCED MAKE_D2DHR_ERR(0x016)
//
// Attempt to copy from a render target while a layer or clip rect is applied
//
#define D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT MAKE_D2DHR_ERR(0x017)
//
// The brush types are incompatible for the call.
//
#define D2DERR_INCOMPATIBLE_BRUSH_TYPES MAKE_D2DHR_ERR(0x018)
//
// An unknown win32 failure occurred.
//
#define D2DERR_WIN32_ERROR MAKE_D2DHR_ERR(0x019)
//
// The render target is not compatible with GDI
//
#define D2DERR_TARGET_NOT_GDI_COMPATIBLE MAKE_D2DHR_ERR(0x01A)
//
// A text client drawing effect object is of the wrong type
//
#define D2DERR_TEXT_EFFECT_IS_WRONG_TYPE MAKE_D2DHR_ERR(0x01B)
//
// The application is holding a reference to the IDWriteTextRenderer interface
// after the corresponding DrawText or DrawTextLayout call has returned. The
// IDWriteTextRenderer instance will be zombied.
//
#define D2DERR_TEXT_RENDERER_NOT_RELEASED MAKE_D2DHR_ERR(0x01C)
//
// The requested size is larger than the guaranteed supported texture size.
//
#define D2DERR_EXCEEDS_MAX_BITMAP_SIZE MAKE_D2DHR_ERR(0x01D)
#else /*D2DERR_WRONG_STATE*/
//
// D2D specific codes now live in winerror.h
//
#endif /*D2DERR_WRONG_STATE*/
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/

6819
gfx/include/dxsdk/d3d10.h Normal file

File diff suppressed because it is too large Load Diff

1793
gfx/include/dxsdk/d3d10_1.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,306 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D10_1Shader.h
// Content: D3D10.1 Shader Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D10_1SHADER_H__
#define __D3D10_1SHADER_H__
#include "d3d10shader.h"
/*#include <winapifamily.h>*/
//----------------------------------------------------------------------------
// Shader debugging structures
//----------------------------------------------------------------------------
typedef enum _D3D10_SHADER_DEBUG_REGTYPE
{
D3D10_SHADER_DEBUG_REG_INPUT,
D3D10_SHADER_DEBUG_REG_OUTPUT,
D3D10_SHADER_DEBUG_REG_CBUFFER,
D3D10_SHADER_DEBUG_REG_TBUFFER,
D3D10_SHADER_DEBUG_REG_TEMP,
D3D10_SHADER_DEBUG_REG_TEMPARRAY,
D3D10_SHADER_DEBUG_REG_TEXTURE,
D3D10_SHADER_DEBUG_REG_SAMPLER,
D3D10_SHADER_DEBUG_REG_IMMEDIATECBUFFER,
D3D10_SHADER_DEBUG_REG_LITERAL,
D3D10_SHADER_DEBUG_REG_UNUSED,
D3D11_SHADER_DEBUG_REG_INTERFACE_POINTERS,
D3D11_SHADER_DEBUG_REG_UAV,
D3D10_SHADER_DEBUG_REG_FORCE_DWORD = 0x7fffffff,
} D3D10_SHADER_DEBUG_REGTYPE;
typedef enum _D3D10_SHADER_DEBUG_SCOPETYPE
{
D3D10_SHADER_DEBUG_SCOPE_GLOBAL,
D3D10_SHADER_DEBUG_SCOPE_BLOCK,
D3D10_SHADER_DEBUG_SCOPE_FORLOOP,
D3D10_SHADER_DEBUG_SCOPE_STRUCT,
D3D10_SHADER_DEBUG_SCOPE_FUNC_PARAMS,
D3D10_SHADER_DEBUG_SCOPE_STATEBLOCK,
D3D10_SHADER_DEBUG_SCOPE_NAMESPACE,
D3D10_SHADER_DEBUG_SCOPE_ANNOTATION,
D3D10_SHADER_DEBUG_SCOPE_FORCE_DWORD = 0x7fffffff,
} D3D10_SHADER_DEBUG_SCOPETYPE;
typedef enum _D3D10_SHADER_DEBUG_VARTYPE
{
D3D10_SHADER_DEBUG_VAR_VARIABLE,
D3D10_SHADER_DEBUG_VAR_FUNCTION,
D3D10_SHADER_DEBUG_VAR_FORCE_DWORD = 0x7fffffff,
} D3D10_SHADER_DEBUG_VARTYPE;
/////////////////////////////////////////////////////////////////////
// These are the serialized structures that get written to the file
/////////////////////////////////////////////////////////////////////
typedef struct _D3D10_SHADER_DEBUG_TOKEN_INFO
{
UINT File; // offset into file list
UINT Line; // line #
UINT Column; // column #
UINT TokenLength;
UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore
} D3D10_SHADER_DEBUG_TOKEN_INFO;
// Variable list
typedef struct _D3D10_SHADER_DEBUG_VAR_INFO
{
// Index into token list for declaring identifier
UINT TokenId;
D3D10_SHADER_VARIABLE_TYPE Type;
// register and component for this variable, only valid/necessary for arrays
UINT Register;
UINT Component;
// gives the original variable that declared this variable
UINT ScopeVar;
// this variable's offset in its ScopeVar
UINT ScopeVarOffset;
} D3D10_SHADER_DEBUG_VAR_INFO;
typedef struct _D3D10_SHADER_DEBUG_INPUT_INFO
{
// index into array of variables of variable to initialize
UINT Var;
// input, cbuffer, tbuffer
D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet;
// set to cbuffer or tbuffer slot, geometry shader input primitive #,
// identifying register for indexable temp, or -1
UINT InitialBank;
// -1 if temp, otherwise gives register in register set
UINT InitialRegister;
// -1 if temp, otherwise gives component
UINT InitialComponent;
// initial value if literal
UINT InitialValue;
} D3D10_SHADER_DEBUG_INPUT_INFO;
typedef struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO
{
// Index into variable token
UINT TokenId;
D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces)
D3D10_SHADER_VARIABLE_CLASS Class;
UINT Rows; // number of rows (matrices)
UINT Columns; // number of columns (vectors and matrices)
// In an array of structures, one struct member scope is provided, and
// you'll have to add the array stride times the index to the variable
// index you find, then find that variable in this structure's list of
// variables.
// gives a scope to look up struct members. -1 if not a struct
UINT StructMemberScope;
// number of array indices
UINT uArrayIndices; // a[3][2][1] has 3 indices
// maximum array index for each index
// offset to UINT[uArrayIndices] in UINT datastore
UINT ArrayElements; // a[3][2][1] has {3, 2, 1}
// how many variables each array index moves
// offset to UINT[uArrayIndices] in UINT datastore
UINT ArrayStrides; // a[3][2][1] has {2, 1, 1}
UINT uVariables;
// index of the first variable, later variables are offsets from this one
UINT uFirstVariable;
} D3D10_SHADER_DEBUG_SCOPEVAR_INFO;
// scope data, this maps variable names to debug variables (useful for the watch window)
typedef struct _D3D10_SHADER_DEBUG_SCOPE_INFO
{
D3D10_SHADER_DEBUG_SCOPETYPE ScopeType;
UINT Name; // offset to name of scope in strings list
UINT uNameLen; // length of name string
UINT uVariables;
UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list
} D3D10_SHADER_DEBUG_SCOPE_INFO;
// instruction outputs
typedef struct _D3D10_SHADER_DEBUG_OUTPUTVAR
{
// index variable being written to, if -1 it's not going to a variable
UINT Var;
// range data that the compiler expects to be true
UINT uValueMin, uValueMax;
INT iValueMin, iValueMax;
FLOAT fValueMin, fValueMax;
BOOL bNaNPossible, bInfPossible;
} D3D10_SHADER_DEBUG_OUTPUTVAR;
typedef struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO
{
// Only temp, indexable temp, and output are valid here
D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet;
// -1 means no output
UINT OutputReg;
// if a temp array, identifier for which one
UINT TempArrayReg;
// -1 means masked out
UINT OutputComponents[4];
D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4];
// when indexing the output, get the value of this register, then add
// that to uOutputReg. If uIndexReg is -1, then there is no index.
// find the variable whose register is the sum (by looking in the ScopeVar)
// and component matches, then set it. This should only happen for indexable
// temps and outputs.
UINT IndexReg;
UINT IndexComp;
} D3D10_SHADER_DEBUG_OUTPUTREG_INFO;
// per instruction data
typedef struct _D3D10_SHADER_DEBUG_INST_INFO
{
UINT Id; // Which instruction this is in the bytecode
UINT Opcode; // instruction type
// 0, 1, or 2
UINT uOutputs;
// up to two outputs per instruction
D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2];
// index into the list of tokens for this instruction's token
UINT TokenId;
// how many function calls deep this instruction is
UINT NestingLevel;
// list of scopes from outer-most to inner-most
// Number of scopes
UINT Scopes;
UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array
// list of variables accessed by this instruction
// Number of variables
UINT AccessedVars;
UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array
} D3D10_SHADER_DEBUG_INST_INFO;
typedef struct _D3D10_SHADER_DEBUG_FILE_INFO
{
UINT FileName; // Offset to LPCSTR for file name
UINT FileNameLen; // Length of file name
UINT FileData; // Offset to LPCSTR of length FileLen
UINT FileLen; // Length of file
} D3D10_SHADER_DEBUG_FILE_INFO;
typedef struct _D3D10_SHADER_DEBUG_INFO
{
UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO)
UINT Creator; // Offset to LPCSTR for compiler version
UINT EntrypointName; // Offset to LPCSTR for Entry point name
UINT ShaderTarget; // Offset to LPCSTR for shader target
UINT CompileFlags; // flags used to compile
UINT Files; // number of included files
UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files]
UINT Instructions; // number of instructions
UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions]
UINT Variables; // number of variables
UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables]
UINT InputVariables; // number of variables to initialize before running
UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables]
UINT Tokens; // number of tokens to initialize
UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens]
UINT Scopes; // number of scopes
UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes]
UINT ScopeVariables; // number of variables declared
UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes]
UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset
UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset
} D3D10_SHADER_DEBUG_INFO;
//----------------------------------------------------------------------------
// ID3D10ShaderReflection1:
//----------------------------------------------------------------------------
//
// Interface definitions
//
typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1;
typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1;
// {C3457783-A846-47CE-9520-CEA6F66E7447}
DEFINE_GUID(IID_ID3D10ShaderReflection1,
0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflection1
DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD(GetMovInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
STDMETHOD(GetMovcInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
STDMETHOD(GetConversionInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
STDMETHOD(GetBitwiseInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
STDMETHOD(GetGSInputPrimitive)(THIS_ _Out_ D3D10_PRIMITIVE* pPrim) PURE;
STDMETHOD(IsLevel9Shader)(THIS_ _Out_ BOOL* pbLevel9Shader) PURE;
STDMETHOD(IsSampleFrequencyShader)(THIS_ _Out_ BOOL* pbSampleFrequency) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10_1SHADER_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,151 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D10Misc.h
// Content: D3D10 Device Creation APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D10MISC_H__
#define __D3D10MISC_H__
#include "d3d10.h"
// ID3D10Blob has been made version-neutral and moved to d3dcommon.h.
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
/*#include <winapifamily.h>*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
///////////////////////////////////////////////////////////////////////////
// D3D10_DRIVER_TYPE
// ----------------
//
// This identifier is used to determine the implementation of Direct3D10
// to be used.
//
// Pass one of these values to D3D10CreateDevice
//
///////////////////////////////////////////////////////////////////////////
typedef enum D3D10_DRIVER_TYPE
{
D3D10_DRIVER_TYPE_HARDWARE = 0,
D3D10_DRIVER_TYPE_REFERENCE = 1,
D3D10_DRIVER_TYPE_NULL = 2,
D3D10_DRIVER_TYPE_SOFTWARE = 3,
D3D10_DRIVER_TYPE_WARP = 5,
} D3D10_DRIVER_TYPE;
DEFINE_GUID(GUID_DeviceType,
0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateDevice
// ------------------
//
// pAdapter
// If NULL, D3D10CreateDevice will choose the primary adapter and
// create a new instance from a temporarily created IDXGIFactory.
// If non-NULL, D3D10CreateDevice will register the appropriate
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
// creating the device.
// DriverType
// Specifies the driver type to be created: hardware, reference or
// null.
// Software
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
// non-Software driver types.
// Flags
// Any of those documented for D3D10CreateDevice.
// SDKVersion
// SDK version. Use the D3D10_SDK_VERSION macro.
// ppDevice
// Pointer to returned interface.
//
// Return Values
// Any of those documented for
// CreateDXGIFactory
// IDXGIFactory::EnumAdapters
// IDXGIAdapter::RegisterDriver
// D3D10CreateDevice
//
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateDevice(
_In_opt_ IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
_Out_opt_ ID3D10Device **ppDevice);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateDeviceAndSwapChain
// ------------------------------
//
// ppAdapter
// If NULL, D3D10CreateDevice will choose the primary adapter and
// create a new instance from a temporarily created IDXGIFactory.
// If non-NULL, D3D10CreateDevice will register the appropriate
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
// creating the device.
// DriverType
// Specifies the driver type to be created: hardware, reference or
// null.
// Software
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
// non-Software driver types.
// Flags
// Any of those documented for D3D10CreateDevice.
// SDKVersion
// SDK version. Use the D3D10_SDK_VERSION macro.
// pSwapChainDesc
// Swap chain description, may be NULL.
// ppSwapChain
// Pointer to returned interface. May be NULL.
// ppDevice
// Pointer to returned interface.
//
// Return Values
// Any of those documented for
// CreateDXGIFactory
// IDXGIFactory::EnumAdapters
// IDXGIAdapter::RegisterDriver
// D3D10CreateDevice
// IDXGIFactory::CreateSwapChain
//
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(
_In_opt_ IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
_In_opt_ DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
_Out_opt_ IDXGISwapChain **ppSwapChain,
_Out_opt_ ID3D10Device **ppDevice);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateBlob:
// -----------------
// Creates a Buffer of n Bytes
//////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, _Out_ LPD3D10BLOB *ppBuffer);
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10EFFECT_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,560 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D10Shader.h
// Content: D3D10 Shader Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D10SHADER_H__
#define __D3D10SHADER_H__
#include "d3d10.h"
/*#include <winapifamily.h>*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
//---------------------------------------------------------------------------
// D3D10_TX_VERSION:
// --------------
// Version token used to create a procedural texture filler in effects
// Used by D3D10Fill[]TX functions
//---------------------------------------------------------------------------
#define D3D10_TX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor))
//----------------------------------------------------------------------------
// D3D10SHADER flags:
// -----------------
// D3D10_SHADER_DEBUG
// Insert debug file/line/type/symbol information.
//
// D3D10_SHADER_SKIP_VALIDATION
// Do not validate the generated code against known capabilities and
// constraints. This option is only recommended when compiling shaders
// you KNOW will work. (ie. have compiled before without this option.)
// Shaders are always validated by D3D before they are set to the device.
//
// D3D10_SHADER_SKIP_OPTIMIZATION
// Instructs the compiler to skip optimization steps during code generation.
// Unless you are trying to isolate a problem in your code using this option
// is not recommended.
//
// D3D10_SHADER_PACK_MATRIX_ROW_MAJOR
// Unless explicitly specified, matrices will be packed in row-major order
// on input and output from the shader.
//
// D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR
// Unless explicitly specified, matrices will be packed in column-major
// order on input and output from the shader. This is generally more
// efficient, since it allows vector-matrix multiplication to be performed
// using a series of dot-products.
//
// D3D10_SHADER_PARTIAL_PRECISION
// Force all computations in resulting shader to occur at partial precision.
// This may result in faster evaluation of shaders on some hardware.
//
// D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT
// Force compiler to compile against the next highest available software
// target for vertex shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT
// Force compiler to compile against the next highest available software
// target for pixel shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3D10_SHADER_NO_PRESHADER
// Disables Preshaders. Using this flag will cause the compiler to not
// pull out static expression for evaluation on the host cpu
//
// D3D10_SHADER_AVOID_FLOW_CONTROL
// Hint compiler to avoid flow-control constructs where possible.
//
// D3D10_SHADER_PREFER_FLOW_CONTROL
// Hint compiler to prefer flow-control constructs where possible.
//
// D3D10_SHADER_ENABLE_STRICTNESS
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
// Specifying this flag enables the strict mode. Deprecated syntax may be
// removed in a future release, and enabling syntax is a good way to make sure
// your shaders comply to the latest spec.
//
// D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY
// This enables older shaders to compile to 4_0 targets.
//
//----------------------------------------------------------------------------
#define D3D10_SHADER_DEBUG (1 << 0)
#define D3D10_SHADER_SKIP_VALIDATION (1 << 1)
#define D3D10_SHADER_SKIP_OPTIMIZATION (1 << 2)
#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR (1 << 3)
#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
#define D3D10_SHADER_PARTIAL_PRECISION (1 << 5)
#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
#define D3D10_SHADER_NO_PRESHADER (1 << 8)
#define D3D10_SHADER_AVOID_FLOW_CONTROL (1 << 9)
#define D3D10_SHADER_PREFER_FLOW_CONTROL (1 << 10)
#define D3D10_SHADER_ENABLE_STRICTNESS (1 << 11)
#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
#define D3D10_SHADER_IEEE_STRICTNESS (1 << 13)
#define D3D10_SHADER_WARNINGS_ARE_ERRORS (1 << 18)
#define D3D10_SHADER_RESOURCES_MAY_ALIAS (1 << 19)
#define D3D10_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20)
#define D3D10_ALL_RESOURCES_BOUND (1 << 21)
#define D3D10_SHADER_DEBUG_NAME_FOR_SOURCE (1 << 22)
#define D3D10_SHADER_DEBUG_NAME_FOR_BINARY (1 << 23)
// optimization level flags
#define D3D10_SHADER_OPTIMIZATION_LEVEL0 (1 << 14)
#define D3D10_SHADER_OPTIMIZATION_LEVEL1 0
#define D3D10_SHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
#define D3D10_SHADER_OPTIMIZATION_LEVEL3 (1 << 15)
// Force root signature flags. (Passed in Flags2)
#define D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST 0
#define D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 (1 << 4)
#define D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 (1 << 5)
typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO;
typedef D3D10_SHADER_MACRO* LPD3D10_SHADER_MACRO;
typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS;
typedef D3D10_SHADER_VARIABLE_CLASS* LPD3D10_SHADER_VARIABLE_CLASS;
typedef D3D_SHADER_VARIABLE_FLAGS D3D10_SHADER_VARIABLE_FLAGS;
typedef D3D10_SHADER_VARIABLE_FLAGS* LPD3D10_SHADER_VARIABLE_FLAGS;
typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE;
typedef D3D10_SHADER_VARIABLE_TYPE* LPD3D10_SHADER_VARIABLE_TYPE;
typedef D3D_SHADER_INPUT_FLAGS D3D10_SHADER_INPUT_FLAGS;
typedef D3D10_SHADER_INPUT_FLAGS* LPD3D10_SHADER_INPUT_FLAGS;
typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE;
typedef D3D10_SHADER_INPUT_TYPE* LPD3D10_SHADER_INPUT_TYPE;
typedef D3D_SHADER_CBUFFER_FLAGS D3D10_SHADER_CBUFFER_FLAGS;
typedef D3D10_SHADER_CBUFFER_FLAGS* LPD3D10_SHADER_CBUFFER_FLAGS;
typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE;
typedef D3D10_CBUFFER_TYPE* LPD3D10_CBUFFER_TYPE;
typedef D3D_NAME D3D10_NAME;
typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE;
typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE;
typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE;
// ID3D10Include has been made version-neutral and moved to d3dcommon.h.
typedef interface ID3DInclude ID3D10Include;
typedef interface ID3DInclude* LPD3D10INCLUDE;
#define IID_ID3D10Include IID_ID3DInclude
//----------------------------------------------------------------------------
// ID3D10ShaderReflection:
//----------------------------------------------------------------------------
//
// Structure definitions
//
typedef struct _D3D10_SHADER_DESC
{
UINT Version; // Shader version
LPCSTR Creator; // Creator string
UINT Flags; // Shader compilation/parse flags
UINT ConstantBuffers; // Number of constant buffers
UINT BoundResources; // Number of bound resources
UINT InputParameters; // Number of parameters in the input signature
UINT OutputParameters; // Number of parameters in the output signature
UINT InstructionCount; // Number of emitted instructions
UINT TempRegisterCount; // Number of temporary registers used
UINT TempArrayCount; // Number of temporary arrays used
UINT DefCount; // Number of constant defines
UINT DclCount; // Number of declarations (input + output)
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
UINT TextureLoadInstructions; // Number of texture load instructions
UINT TextureCompInstructions; // Number of texture comparison instructions
UINT TextureBiasInstructions; // Number of texture bias instructions
UINT TextureGradientInstructions; // Number of texture gradient instructions
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
UINT StaticFlowControlCount; // Number of static flow control instructions used
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
UINT MacroInstructionCount; // Number of macro instructions used
UINT ArrayInstructionCount; // Number of array instructions used
UINT CutInstructionCount; // Number of cut instructions used
UINT EmitInstructionCount; // Number of emit instructions used
D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
} D3D10_SHADER_DESC;
typedef struct _D3D10_SHADER_BUFFER_DESC
{
LPCSTR Name; // Name of the constant buffer
D3D10_CBUFFER_TYPE Type; // Indicates that this is a CBuffer or TBuffer
UINT Variables; // Number of member variables
UINT Size; // Size of CB (in bytes)
UINT uFlags; // Buffer description flags
} D3D10_SHADER_BUFFER_DESC;
typedef struct _D3D10_SHADER_VARIABLE_DESC
{
LPCSTR Name; // Name of the variable
UINT StartOffset; // Offset in constant buffer's backing store
UINT Size; // Size of variable (in bytes)
UINT uFlags; // Variable flags
LPVOID DefaultValue; // Raw pointer to default value
} D3D10_SHADER_VARIABLE_DESC;
typedef struct _D3D10_SHADER_TYPE_DESC
{
D3D10_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
D3D10_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
UINT Elements; // Number of elements (0 if not an array)
UINT Members; // Number of members (0 if not a structure)
UINT Offset; // Offset from the start of structure (0 if not a structure member)
} D3D10_SHADER_TYPE_DESC;
typedef struct _D3D10_SHADER_INPUT_BIND_DESC
{
LPCSTR Name; // Name of the resource
D3D10_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
UINT BindPoint; // Starting bind point
UINT BindCount; // Number of contiguous bind points (for arrays)
UINT uFlags; // Input binding flags
D3D10_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
D3D10_SRV_DIMENSION Dimension; // Dimension (if texture)
UINT NumSamples; // Number of samples (0 if not MS texture)
} D3D10_SHADER_INPUT_BIND_DESC;
typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
{
LPCSTR SemanticName; // Name of the semantic
UINT SemanticIndex; // Index of the semantic
UINT Register; // Number of member variables
D3D10_NAME SystemValueType;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable
D3D10_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.)
BYTE Mask; // Mask to indicate which components of the register
// are used (combination of D3D10_COMPONENT_MASK values)
BYTE ReadWriteMask; // Mask to indicate whether a given component is
// never written (if this is an output signature) or
// always read (if this is an input signature).
// (combination of D3D10_COMPONENT_MASK values)
} D3D10_SIGNATURE_PARAMETER_DESC;
//
// Interface definitions
//
typedef interface ID3D10ShaderReflectionType ID3D10ShaderReflectionType;
typedef interface ID3D10ShaderReflectionType *LPD3D10SHADERREFLECTIONTYPE;
// {C530AD7D-9B16-4395-A979-BA2ECFF83ADD}
interface DECLSPEC_UUID("C530AD7D-9B16-4395-A979-BA2ECFF83ADD") ID3D10ShaderReflectionType;
DEFINE_GUID(IID_ID3D10ShaderReflectionType,
0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflectionType
DECLARE_INTERFACE(ID3D10ShaderReflectionType)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE;
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT Index) PURE;
};
typedef interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable;
typedef interface ID3D10ShaderReflectionVariable *LPD3D10SHADERREFLECTIONVARIABLE;
// {1BF63C95-2650-405d-99C1-3636BD1DA0A1}
interface DECLSPEC_UUID("1BF63C95-2650-405d-99C1-3636BD1DA0A1") ID3D10ShaderReflectionVariable;
DEFINE_GUID(IID_ID3D10ShaderReflectionVariable,
0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflectionVariable
DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetType)(THIS) PURE;
};
typedef interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer;
typedef interface ID3D10ShaderReflectionConstantBuffer *LPD3D10SHADERREFLECTIONCONSTANTBUFFER;
// {66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0}
interface DECLSPEC_UUID("66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0") ID3D10ShaderReflectionConstantBuffer;
DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer,
0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflectionConstantBuffer
DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
};
typedef interface ID3D10ShaderReflection ID3D10ShaderReflection;
typedef interface ID3D10ShaderReflection *LPD3D10SHADERREFLECTION;
// {D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA}
interface DECLSPEC_UUID("D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA") ID3D10ShaderReflection;
DEFINE_GUID(IID_ID3D10ShaderReflection,
0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflection
DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3D10CompileShader:
// ------------------
// Compiles a 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.
// SrcDataSize
// 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. The D3D10 entry
// point currently supports only "vs_4_0", "ps_4_0", and "gs_4_0".
// Flags
// See D3D10_SHADER_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.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10CompileShader(_In_reads_bytes_(SrcDataSize) LPCSTR pSrcData, SIZE_T SrcDataSize, _In_opt_ LPCSTR pFileName, _In_opt_ CONST D3D10_SHADER_MACRO* pDefines, _In_opt_ LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, _Out_ ID3D10Blob** ppShader, _Out_opt_ ID3D10Blob** ppErrorMsgs);
//----------------------------------------------------------------------------
// D3D10DisassembleShader:
// ----------------------
// Takes a binary shader, and returns a buffer containing text assembly.
//
// Parameters:
// pShader
// Pointer to the shader byte code.
// BytecodeLength
// Size of the shader byte code in bytes.
// EnableColorCode
// Emit HTML tags for color coding the output?
// pComments
// Pointer to a comment string to include at the top of the shader.
// ppDisassembly
// Returns a buffer containing the disassembled shader.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10DisassembleShader(_In_reads_bytes_(BytecodeLength) CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, _In_opt_ LPCSTR pComments, _Out_ ID3D10Blob** ppDisassembly);
//----------------------------------------------------------------------------
// D3D10GetPixelShaderProfile/D3D10GetVertexShaderProfile/D3D10GetGeometryShaderProfile:
// -----------------------------------------------------
// Returns the name of the HLSL profile best suited to a given device.
//
// Parameters:
// pDevice
// Pointer to the device in question
//----------------------------------------------------------------------------
LPCSTR WINAPI D3D10GetPixelShaderProfile(_In_ ID3D10Device *pDevice);
LPCSTR WINAPI D3D10GetVertexShaderProfile(_In_ ID3D10Device *pDevice);
LPCSTR WINAPI D3D10GetGeometryShaderProfile(_In_ ID3D10Device *pDevice);
//----------------------------------------------------------------------------
// D3D10ReflectShader:
// ------------------
// Creates a shader reflection object that can be used to retrieve information
// about a compiled shader
//
// Parameters:
// pShaderBytecode
// Pointer to a compiled shader (same pointer that is passed into
// ID3D10Device::CreateShader)
// BytecodeLength
// Length of the shader bytecode buffer
// ppReflector
// [out] Returns a ID3D10ShaderReflection object that can be used to
// retrieve shader resource and constant buffer information
//
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10ReflectShader(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10ShaderReflection **ppReflector);
//----------------------------------------------------------------------------
// D3D10PreprocessShader
// ---------------------
// Creates a shader reflection object that can be used to retrieve information
// about a compiled shader
//
// Parameters:
// pSrcData
// Pointer to source code
// SrcDataSize
// Size of source code, in bytes
// pFileName
// Source file name (used for error output)
// 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 assembling
// from file, and will error when assembling from resource or memory.
// ppShaderText
// Returns a buffer containing a single large string that represents
// the resulting formatted token stream
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during assembly. If you are running in a debugger,
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10PreprocessShader(_In_reads_bytes_(SrcDataSize) LPCSTR pSrcData, SIZE_T SrcDataSize, _In_opt_ LPCSTR pFileName, _In_opt_ CONST D3D10_SHADER_MACRO* pDefines,
_In_opt_ LPD3D10INCLUDE pInclude, _Out_ ID3D10Blob** ppShaderText, _Out_opt_ ID3D10Blob** ppErrorMsgs);
//////////////////////////////////////////////////////////////////////////
//
// Shader blob manipulation routines
// ---------------------------------
//
// void *pShaderBytecode - a buffer containing the result of an HLSL
// compilation. Typically this opaque buffer contains several
// discrete sections including the shader executable code, the input
// signature, and the output signature. This can typically be retrieved
// by calling ID3D10Blob::GetBufferPointer() on the returned blob
// from HLSL's compile APIs.
//
// UINT BytecodeLength - the length of pShaderBytecode. This can
// typically be retrieved by calling ID3D10Blob::GetBufferSize()
// on the returned blob from HLSL's compile APIs.
//
// ID3D10Blob **ppSignatureBlob(s) - a newly created buffer that
// contains only the signature portions of the original bytecode.
// This is a copy; the original bytecode is not modified. You may
// specify NULL for this parameter to have the bytecode validated
// for the presence of the corresponding signatures without actually
// copying them and creating a new blob.
//
// Returns E_INVALIDARG if any required parameters are NULL
// Returns E_FAIL is the bytecode is corrupt or missing signatures
// Returns S_OK on success
//
//////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10GetInputSignatureBlob(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob **ppSignatureBlob);
HRESULT WINAPI D3D10GetOutputSignatureBlob(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob **ppSignatureBlob);
HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob **ppSignatureBlob);
//----------------------------------------------------------------------------
// D3D10GetShaderDebugInfo:
// -----------------------
// Gets shader debug info. Debug info is generated by D3D10CompileShader and is
// embedded in the body of the shader.
//
// Parameters:
// pShaderBytecode
// Pointer to the function bytecode
// BytecodeLength
// Length of the shader bytecode buffer
// ppDebugInfo
// Buffer used to return debug info. For information about the layout
// of this buffer, see definition of D3D10_SHADER_DEBUG_INFO above.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10GetShaderDebugInfo(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob** ppDebugInfo);
#ifdef __cplusplus
}
#endif //__cplusplus
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/
#endif //__D3D10SHADER_H__

14605
gfx/include/dxsdk/d3d11.h Normal file

File diff suppressed because it is too large Load Diff

5222
gfx/include/dxsdk/d3d11_1.h Normal file

File diff suppressed because it is too large Load Diff

2721
gfx/include/dxsdk/d3d11_2.h Normal file

File diff suppressed because it is too large Load Diff

6832
gfx/include/dxsdk/d3d11_3.h Normal file

File diff suppressed because it is too large Load Diff

3097
gfx/include/dxsdk/d3d11_4.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,283 @@
/*-------------------------------------------------------------------------------------
*
* Copyright (c) Microsoft Corporation
*
*-------------------------------------------------------------------------------------*/
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __d3d11on12_h__
#define __d3d11on12_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __ID3D11On12Device_FWD_DEFINED__
#define __ID3D11On12Device_FWD_DEFINED__
typedef interface ID3D11On12Device ID3D11On12Device;
#endif /* __ID3D11On12Device_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "d3d11.h"
#include "d3d12.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_d3d11on12_0000_0000 */
/* [local] */
/*#include <winapifamily.h>*/
/*#pragma region App Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
///////////////////////////////////////////////////////////////////////////
// D3D11On12CreateDevice
// ------------------
//
// pDevice
// Specifies a pre-existing D3D12 device to use for D3D11 interop.
// May not be NULL.
// Flags
// Any of those documented for D3D11CreateDeviceAndSwapChain.
// pFeatureLevels
// Array of any of the following:
// D3D_FEATURE_LEVEL_12_1
// D3D_FEATURE_LEVEL_12_0
// D3D_FEATURE_LEVEL_11_1
// D3D_FEATURE_LEVEL_11_0
// D3D_FEATURE_LEVEL_10_1
// D3D_FEATURE_LEVEL_10_0
// D3D_FEATURE_LEVEL_9_3
// D3D_FEATURE_LEVEL_9_2
// D3D_FEATURE_LEVEL_9_1
// The first feature level which is less than or equal to the
// D3D12 device's feature level will be used to perform D3D11 validation.
// Creation will fail if no acceptable feature levels are provided.
// Providing NULL will default to the D3D12 device's feature level.
// FeatureLevels
// Size of feature levels array.
// ppCommandQueues
// Array of unique queues for D3D11On12 to use. Valid queue types:
// 3D command queue.
// Flags must be compatible with device flags, and its NodeMask must
// be a subset of the NodeMask provided to this API.
// NumQueues
// Size of command queue array.
// NodeMask
// Which node of the D3D12 device to use. Only 1 bit may be set.
// ppDevice
// Pointer to returned interface. May be NULL.
// ppImmediateContext
// Pointer to returned interface. May be NULL.
// pChosenFeatureLevel
// Pointer to returned feature level. May be NULL.
//
// Return Values
// Any of those documented for
// D3D11CreateDevice
//
///////////////////////////////////////////////////////////////////////////
typedef HRESULT (WINAPI* PFN_D3D11ON12_CREATE_DEVICE)( _In_ IUnknown*, UINT,
_In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL*, UINT FeatureLevels,
_In_reads_opt_( NumQueues ) IUnknown* CONST*, UINT NumQueues,
UINT, _COM_Outptr_opt_ ID3D11Device**, _COM_Outptr_opt_ ID3D11DeviceContext**,
_Out_opt_ D3D_FEATURE_LEVEL* );
HRESULT WINAPI D3D11On12CreateDevice(
_In_ IUnknown* pDevice,
UINT Flags,
_In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels,
UINT FeatureLevels,
_In_reads_opt_( NumQueues ) IUnknown* CONST* ppCommandQueues,
UINT NumQueues,
UINT NodeMask,
_COM_Outptr_opt_ ID3D11Device** ppDevice,
_COM_Outptr_opt_ ID3D11DeviceContext** ppImmediateContext,
_Out_opt_ D3D_FEATURE_LEVEL* pChosenFeatureLevel );
typedef struct D3D11_RESOURCE_FLAGS
{
UINT BindFlags;
UINT MiscFlags;
UINT CPUAccessFlags;
UINT StructureByteStride;
} D3D11_RESOURCE_FLAGS;
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0000_v0_0_s_ifspec;
#ifndef __ID3D11On12Device_INTERFACE_DEFINED__
#define __ID3D11On12Device_INTERFACE_DEFINED__
/* interface ID3D11On12Device */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D11On12Device;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("85611e73-70a9-490e-9614-a9e302777904")
ID3D11On12Device : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateWrappedResource(
_In_ IUnknown *pResource12,
_In_ const D3D11_RESOURCE_FLAGS *pFlags11,
D3D12_RESOURCE_STATES InState,
D3D12_RESOURCE_STATES OutState,
REFIID riid,
_COM_Outptr_opt_ void **ppResource11) = 0;
virtual void STDMETHODCALLTYPE ReleaseWrappedResources(
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
UINT NumResources) = 0;
virtual void STDMETHODCALLTYPE AcquireWrappedResources(
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
UINT NumResources) = 0;
};
#else /* C style interface */
typedef struct ID3D11On12DeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D11On12Device * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11On12Device * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D11On12Device * This);
HRESULT ( STDMETHODCALLTYPE *CreateWrappedResource )(
ID3D11On12Device * This,
_In_ IUnknown *pResource12,
_In_ const D3D11_RESOURCE_FLAGS *pFlags11,
D3D12_RESOURCE_STATES InState,
D3D12_RESOURCE_STATES OutState,
REFIID riid,
_COM_Outptr_opt_ void **ppResource11);
void ( STDMETHODCALLTYPE *ReleaseWrappedResources )(
ID3D11On12Device * This,
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
UINT NumResources);
void ( STDMETHODCALLTYPE *AcquireWrappedResources )(
ID3D11On12Device * This,
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
UINT NumResources);
END_INTERFACE
} ID3D11On12DeviceVtbl;
interface ID3D11On12Device
{
CONST_VTBL struct ID3D11On12DeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D11On12Device_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D11On12Device_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D11On12Device_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D11On12Device_CreateWrappedResource(This,pResource12,pFlags11,InState,OutState,riid,ppResource11) \
( (This)->lpVtbl -> CreateWrappedResource(This,pResource12,pFlags11,InState,OutState,riid,ppResource11) )
#define ID3D11On12Device_ReleaseWrappedResources(This,ppResources,NumResources) \
( (This)->lpVtbl -> ReleaseWrappedResources(This,ppResources,NumResources) )
#define ID3D11On12Device_AcquireWrappedResources(This,ppResources,NumResources) \
( (This)->lpVtbl -> AcquireWrappedResources(This,ppResources,NumResources) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D11On12Device_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d11on12_0000_0001 */
/* [local] */
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
DEFINE_GUID(IID_ID3D11On12Device,0x85611e73,0x70a9,0x490e,0x96,0x14,0xa9,0xe3,0x02,0x77,0x79,0x04);
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0001_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,601 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D11Shader.h
// Content: D3D11 Shader Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D11SHADER_H__
#define __D3D11SHADER_H__
#include "d3dcommon.h"
typedef enum D3D11_SHADER_VERSION_TYPE
{
D3D11_SHVER_PIXEL_SHADER = 0,
D3D11_SHVER_VERTEX_SHADER = 1,
D3D11_SHVER_GEOMETRY_SHADER = 2,
// D3D11 Shaders
D3D11_SHVER_HULL_SHADER = 3,
D3D11_SHVER_DOMAIN_SHADER = 4,
D3D11_SHVER_COMPUTE_SHADER = 5,
D3D11_SHVER_RESERVED0 = 0xFFF0,
} D3D11_SHADER_VERSION_TYPE;
#define D3D11_SHVER_GET_TYPE(_Version) \
(((_Version) >> 16) & 0xffff)
#define D3D11_SHVER_GET_MAJOR(_Version) \
(((_Version) >> 4) & 0xf)
#define D3D11_SHVER_GET_MINOR(_Version) \
(((_Version) >> 0) & 0xf)
// Slot ID for library function return
#define D3D_RETURN_PARAMETER_INDEX (-1)
typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
{
LPCSTR SemanticName; // Name of the semantic
UINT SemanticIndex; // Index of the semantic
UINT Register; // Number of member variables
D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
BYTE Mask; // Mask to indicate which components of the register
// are used (combination of D3D10_COMPONENT_MASK values)
BYTE ReadWriteMask; // Mask to indicate whether a given component is
// never written (if this is an output signature) or
// always read (if this is an input signature).
// (combination of D3D_MASK_* values)
UINT Stream; // Stream index
D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
} D3D11_SIGNATURE_PARAMETER_DESC;
typedef struct _D3D11_SHADER_BUFFER_DESC
{
LPCSTR Name; // Name of the constant buffer
D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
UINT Variables; // Number of member variables
UINT Size; // Size of CB (in bytes)
UINT uFlags; // Buffer description flags
} D3D11_SHADER_BUFFER_DESC;
typedef struct _D3D11_SHADER_VARIABLE_DESC
{
LPCSTR Name; // Name of the variable
UINT StartOffset; // Offset in constant buffer's backing store
UINT Size; // Size of variable (in bytes)
UINT uFlags; // Variable flags
LPVOID DefaultValue; // Raw pointer to default value
UINT StartTexture; // First texture index (or -1 if no textures used)
UINT TextureSize; // Number of texture slots possibly used.
UINT StartSampler; // First sampler index (or -1 if no textures used)
UINT SamplerSize; // Number of sampler slots possibly used.
} D3D11_SHADER_VARIABLE_DESC;
typedef struct _D3D11_SHADER_TYPE_DESC
{
D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
UINT Elements; // Number of elements (0 if not an array)
UINT Members; // Number of members (0 if not a structure)
UINT Offset; // Offset from the start of structure (0 if not a structure member)
LPCSTR Name; // Name of type, can be NULL
} D3D11_SHADER_TYPE_DESC;
typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
typedef struct _D3D11_SHADER_DESC
{
UINT Version; // Shader version
LPCSTR Creator; // Creator string
UINT Flags; // Shader compilation/parse flags
UINT ConstantBuffers; // Number of constant buffers
UINT BoundResources; // Number of bound resources
UINT InputParameters; // Number of parameters in the input signature
UINT OutputParameters; // Number of parameters in the output signature
UINT InstructionCount; // Number of emitted instructions
UINT TempRegisterCount; // Number of temporary registers used
UINT TempArrayCount; // Number of temporary arrays used
UINT DefCount; // Number of constant defines
UINT DclCount; // Number of declarations (input + output)
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
UINT TextureLoadInstructions; // Number of texture load instructions
UINT TextureCompInstructions; // Number of texture comparison instructions
UINT TextureBiasInstructions; // Number of texture bias instructions
UINT TextureGradientInstructions; // Number of texture gradient instructions
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
UINT StaticFlowControlCount; // Number of static flow control instructions used
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
UINT MacroInstructionCount; // Number of macro instructions used
UINT ArrayInstructionCount; // Number of array instructions used
UINT CutInstructionCount; // Number of cut instructions used
UINT EmitInstructionCount; // Number of emit instructions used
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
UINT PatchConstantParameters; // Number of parameters in the patch constant signature
UINT cGSInstanceCount; // Number of Geometry shader instances
UINT cControlPoints; // Number of control points in the HS->DS stage
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
// instruction counts
UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
UINT cInterlockedInstructions; // Number of interlocked instructions
UINT cTextureStoreInstructions; // Number of texture writes
} D3D11_SHADER_DESC;
typedef struct _D3D11_SHADER_INPUT_BIND_DESC
{
LPCSTR Name; // Name of the resource
D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
UINT BindPoint; // Starting bind point
UINT BindCount; // Number of contiguous bind points (for arrays)
UINT uFlags; // Input binding flags
D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
UINT NumSamples; // Number of samples (0 if not MS texture)
} D3D11_SHADER_INPUT_BIND_DESC;
#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
typedef struct _D3D11_LIBRARY_DESC
{
LPCSTR Creator; // The name of the originator of the library.
UINT Flags; // Compilation flags.
UINT FunctionCount; // Number of functions exported from the library.
} D3D11_LIBRARY_DESC;
typedef struct _D3D11_FUNCTION_DESC
{
UINT Version; // Shader version
LPCSTR Creator; // Creator string
UINT Flags; // Shader compilation/parse flags
UINT ConstantBuffers; // Number of constant buffers
UINT BoundResources; // Number of bound resources
UINT InstructionCount; // Number of emitted instructions
UINT TempRegisterCount; // Number of temporary registers used
UINT TempArrayCount; // Number of temporary arrays used
UINT DefCount; // Number of constant defines
UINT DclCount; // Number of declarations (input + output)
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
UINT TextureLoadInstructions; // Number of texture load instructions
UINT TextureCompInstructions; // Number of texture comparison instructions
UINT TextureBiasInstructions; // Number of texture bias instructions
UINT TextureGradientInstructions; // Number of texture gradient instructions
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
UINT StaticFlowControlCount; // Number of static flow control instructions used
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
UINT MacroInstructionCount; // Number of macro instructions used
UINT ArrayInstructionCount; // Number of array instructions used
UINT MovInstructionCount; // Number of mov instructions used
UINT MovcInstructionCount; // Number of movc instructions used
UINT ConversionInstructionCount; // Number of type conversion instructions used
UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
UINT64 RequiredFeatureFlags; // Required feature flags
LPCSTR Name; // Function name
INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
} D3D11_FUNCTION_DESC;
typedef struct _D3D11_PARAMETER_DESC
{
LPCSTR Name; // Parameter name.
LPCSTR SemanticName; // Parameter semantic name (+index).
D3D_SHADER_VARIABLE_TYPE Type; // Element type.
D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
UINT Rows; // Rows are for matrix parameters.
UINT Columns; // Components or Columns in matrix.
D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
UINT FirstInRegister; // The first input register for this parameter.
UINT FirstInComponent; // The first input register component for this parameter.
UINT FirstOutRegister; // The first output register for this parameter.
UINT FirstOutComponent; // The first output register component for this parameter.
} D3D11_PARAMETER_DESC;
//////////////////////////////////////////////////////////////////////////////
// Interfaces ////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType;
typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE;
typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable;
typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE;
typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer;
typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER;
typedef interface ID3D11ShaderReflection ID3D11ShaderReflection;
typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION;
typedef interface ID3D11LibraryReflection ID3D11LibraryReflection;
typedef interface ID3D11LibraryReflection *LPD3D11LIBRARYREFLECTION;
typedef interface ID3D11FunctionReflection ID3D11FunctionReflection;
typedef interface ID3D11FunctionReflection *LPD3D11FUNCTIONREFLECTION;
typedef interface ID3D11FunctionParameterReflection ID3D11FunctionParameterReflection;
typedef interface ID3D11FunctionParameterReflection *LPD3D11FUNCTIONPARAMETERREFLECTION;
// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType;
DEFINE_GUID(IID_ID3D11ShaderReflectionType,
0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
#undef INTERFACE
#define INTERFACE ID3D11ShaderReflectionType
DECLARE_INTERFACE(ID3D11ShaderReflectionType)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_TYPE_DESC *pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
STDMETHOD(IsEqual)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE;
STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE;
STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
STDMETHOD(IsOfType)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D11ShaderReflectionType* pBase) PURE;
};
// {51F23923-F3E5-4BD1-91CB-606177D8DB4C}
interface DECLSPEC_UUID("51F23923-F3E5-4BD1-91CB-606177D8DB4C") ID3D11ShaderReflectionVariable;
DEFINE_GUID(IID_ID3D11ShaderReflectionVariable,
0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
#undef INTERFACE
#define INTERFACE ID3D11ShaderReflectionVariable
DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE;
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
};
// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8}
interface DECLSPEC_UUID("EB62D63D-93DD-4318-8AE8-C6F83AD371B8") ID3D11ShaderReflectionConstantBuffer;
DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer,
0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
#undef INTERFACE
#define INTERFACE ID3D11ShaderReflectionConstantBuffer
DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
{
STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
};
// The ID3D11ShaderReflection IID may change from SDK version to SDK version
// if the reflection API changes. This prevents new code with the new API
// from working with an old binary. Recompiling with the new header
// will pick up the new IID.
// 8d536ca1-0cca-4956-a837-786963755584
interface DECLSPEC_UUID("8d536ca1-0cca-4956-a837-786963755584") ID3D11ShaderReflection;
DEFINE_GUID(IID_ID3D11ShaderReflection,
0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84);
#undef INTERFACE
#define INTERFACE ID3D11ShaderReflection
DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
_Out_ LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
_Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
_Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
_Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
_Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
_Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
_Out_opt_ UINT* pSizeX,
_Out_opt_ UINT* pSizeY,
_Out_opt_ UINT* pSizeZ) PURE;
STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
};
// {54384F1B-5B3E-4BB7-AE01-60BA3097CBB6}
interface DECLSPEC_UUID("54384F1B-5B3E-4BB7-AE01-60BA3097CBB6") ID3D11LibraryReflection;
DEFINE_GUID(IID_ID3D11LibraryReflection,
0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x1, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6);
#undef INTERFACE
#define INTERFACE ID3D11LibraryReflection
DECLARE_INTERFACE_(ID3D11LibraryReflection, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_LIBRARY_DESC * pDesc) PURE;
STDMETHOD_(ID3D11FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
};
// {207BCECB-D683-4A06-A8A3-9B149B9F73A4}
interface DECLSPEC_UUID("207BCECB-D683-4A06-A8A3-9B149B9F73A4") ID3D11FunctionReflection;
DEFINE_GUID(IID_ID3D11FunctionReflection,
0x207bcecb, 0xd683, 0x4a06, 0xa8, 0xa3, 0x9b, 0x14, 0x9b, 0x9f, 0x73, 0xa4);
#undef INTERFACE
#define INTERFACE ID3D11FunctionReflection
DECLARE_INTERFACE(ID3D11FunctionReflection)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_FUNCTION_DESC * pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
_Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
STDMETHOD_(ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
_Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
STDMETHOD_(ID3D11FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
};
// {42757488-334F-47FE-982E-1A65D08CC462}
interface DECLSPEC_UUID("42757488-334F-47FE-982E-1A65D08CC462") ID3D11FunctionParameterReflection;
DEFINE_GUID(IID_ID3D11FunctionParameterReflection,
0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62);
#undef INTERFACE
#define INTERFACE ID3D11FunctionParameterReflection
DECLARE_INTERFACE(ID3D11FunctionParameterReflection)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_PARAMETER_DESC * pDesc) PURE;
};
// {CAC701EE-80FC-4122-8242-10B39C8CEC34}
interface DECLSPEC_UUID("CAC701EE-80FC-4122-8242-10B39C8CEC34") ID3D11Module;
DEFINE_GUID(IID_ID3D11Module,
0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34);
#undef INTERFACE
#define INTERFACE ID3D11Module
DECLARE_INTERFACE_(ID3D11Module, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Create an instance of a module for resource re-binding.
STDMETHOD(CreateInstance)(THIS_ _In_opt_ LPCSTR pNamespace,
_COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance) PURE;
};
// {469E07F7-045A-48D5-AA12-68A478CDF75D}
interface DECLSPEC_UUID("469E07F7-045A-48D5-AA12-68A478CDF75D") ID3D11ModuleInstance;
DEFINE_GUID(IID_ID3D11ModuleInstance,
0x469e07f7, 0x45a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d);
#undef INTERFACE
#define INTERFACE ID3D11ModuleInstance
DECLARE_INTERFACE_(ID3D11ModuleInstance, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
//
// Resource binding API.
//
STDMETHOD(BindConstantBuffer)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
STDMETHOD(BindConstantBufferByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
STDMETHOD(BindResource)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindResourceByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindSampler)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindSamplerByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindUnorderedAccessView)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindResourceAsUnorderedAccessView)(THIS_ _In_ UINT uSrcSrvSlot, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
STDMETHOD(BindResourceAsUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pSrvName, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
};
// {59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E}
interface DECLSPEC_UUID("59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E") ID3D11Linker;
DEFINE_GUID(IID_ID3D11Linker,
0x59a6cd0e, 0xe10d, 0x4c1f, 0x88, 0xc0, 0x63, 0xab, 0xa1, 0xda, 0xf3, 0xe);
#undef INTERFACE
#define INTERFACE ID3D11Linker
DECLARE_INTERFACE_(ID3D11Linker, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Link the shader and produce a shader blob suitable to D3D runtime.
STDMETHOD(Link)(THIS_ _In_ interface ID3D11ModuleInstance * pEntry,
_In_ LPCSTR pEntryName,
_In_ LPCSTR pTargetName,
_In_ UINT uFlags,
_COM_Outptr_ ID3DBlob ** ppShaderBlob,
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
// Add an instance of a library module to be used for linking.
STDMETHOD(UseLibrary)(THIS_ _In_ interface ID3D11ModuleInstance * pLibraryMI) PURE;
// Add a clip plane with the plane coefficients taken from a cbuffer entry for 10L9 shaders.
STDMETHOD(AddClipPlaneFromCBuffer)(THIS_ _In_ UINT uCBufferSlot, _In_ UINT uCBufferEntry) PURE;
};
// {D80DD70C-8D2F-4751-94A1-03C79B3556DB}
interface DECLSPEC_UUID("D80DD70C-8D2F-4751-94A1-03C79B3556DB") ID3D11LinkingNode;
DEFINE_GUID(IID_ID3D11LinkingNode,
0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x3, 0xc7, 0x9b, 0x35, 0x56, 0xdb);
#undef INTERFACE
#define INTERFACE ID3D11LinkingNode
DECLARE_INTERFACE_(ID3D11LinkingNode, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
};
// {54133220-1CE8-43D3-8236-9855C5CEECFF}
interface DECLSPEC_UUID("54133220-1CE8-43D3-8236-9855C5CEECFF") ID3D11FunctionLinkingGraph;
DEFINE_GUID(IID_ID3D11FunctionLinkingGraph,
0x54133220, 0x1ce8, 0x43d3, 0x82, 0x36, 0x98, 0x55, 0xc5, 0xce, 0xec, 0xff);
#undef INTERFACE
#define INTERFACE ID3D11FunctionLinkingGraph
DECLARE_INTERFACE_(ID3D11FunctionLinkingGraph, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Create a shader module out of FLG description.
STDMETHOD(CreateModuleInstance)(THIS_ _COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance,
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
STDMETHOD(SetInputSignature)(THIS_ __in_ecount(cInputParameters) const D3D11_PARAMETER_DESC * pInputParameters,
_In_ UINT cInputParameters,
_COM_Outptr_ interface ID3D11LinkingNode ** ppInputNode) PURE;
STDMETHOD(SetOutputSignature)(THIS_ __in_ecount(cOutputParameters) const D3D11_PARAMETER_DESC * pOutputParameters,
_In_ UINT cOutputParameters,
_COM_Outptr_ interface ID3D11LinkingNode ** ppOutputNode) PURE;
STDMETHOD(CallFunction)(THIS_ _In_opt_ LPCSTR pModuleInstanceNamespace,
_In_ interface ID3D11Module * pModuleWithFunctionPrototype,
_In_ LPCSTR pFunctionName,
_COM_Outptr_ interface ID3D11LinkingNode ** ppCallNode) PURE;
STDMETHOD(PassValue)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
_In_ INT SrcParameterIndex,
_In_ interface ID3D11LinkingNode * pDstNode,
_In_ INT DstParameterIndex) PURE;
STDMETHOD(PassValueWithSwizzle)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
_In_ INT SrcParameterIndex,
_In_ LPCSTR pSrcSwizzle,
_In_ interface ID3D11LinkingNode * pDstNode,
_In_ INT DstParameterIndex,
_In_ LPCSTR pDstSwizzle) PURE;
STDMETHOD(GetLastError)(THIS_ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
STDMETHOD(GenerateHlsl)(THIS_ _In_ UINT uFlags, // uFlags is reserved for future use.
_COM_Outptr_ ID3DBlob ** ppBuffer) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D11SHADER_H__

View File

@ -0,0 +1,570 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __d3d11ShaderTracing_h__
#define __d3d11ShaderTracing_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __ID3D11ShaderTrace_FWD_DEFINED__
#define __ID3D11ShaderTrace_FWD_DEFINED__
typedef interface ID3D11ShaderTrace ID3D11ShaderTrace;
#endif /* __ID3D11ShaderTrace_FWD_DEFINED__ */
#ifndef __ID3D11ShaderTraceFactory_FWD_DEFINED__
#define __ID3D11ShaderTraceFactory_FWD_DEFINED__
typedef interface ID3D11ShaderTraceFactory ID3D11ShaderTraceFactory;
#endif /* __ID3D11ShaderTraceFactory_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_d3d11ShaderTracing_0000_0000 */
/* [local] */
typedef
enum D3D11_SHADER_TYPE
{
D3D11_VERTEX_SHADER = 1,
D3D11_HULL_SHADER = 2,
D3D11_DOMAIN_SHADER = 3,
D3D11_GEOMETRY_SHADER = 4,
D3D11_PIXEL_SHADER = 5,
D3D11_COMPUTE_SHADER = 6
} D3D11_SHADER_TYPE;
#define D3D11_TRACE_COMPONENT_X 0x1
#define D3D11_TRACE_COMPONENT_Y 0x2
#define D3D11_TRACE_COMPONENT_Z 0x4
#define D3D11_TRACE_COMPONENT_W 0x8
typedef UINT8 D3D11_TRACE_COMPONENT_MASK;
typedef struct D3D11_VERTEX_SHADER_TRACE_DESC
{
UINT64 Invocation;
} D3D11_VERTEX_SHADER_TRACE_DESC;
typedef struct D3D11_HULL_SHADER_TRACE_DESC
{
UINT64 Invocation;
} D3D11_HULL_SHADER_TRACE_DESC;
typedef struct D3D11_DOMAIN_SHADER_TRACE_DESC
{
UINT64 Invocation;
} D3D11_DOMAIN_SHADER_TRACE_DESC;
typedef struct D3D11_GEOMETRY_SHADER_TRACE_DESC
{
UINT64 Invocation;
} D3D11_GEOMETRY_SHADER_TRACE_DESC;
typedef struct D3D11_PIXEL_SHADER_TRACE_DESC
{
UINT64 Invocation;
INT X;
INT Y;
UINT64 SampleMask;
} D3D11_PIXEL_SHADER_TRACE_DESC;
typedef struct D3D11_COMPUTE_SHADER_TRACE_DESC
{
UINT64 Invocation;
UINT ThreadIDInGroup[ 3 ];
UINT ThreadGroupID[ 3 ];
} D3D11_COMPUTE_SHADER_TRACE_DESC;
#define D3D11_SHADER_TRACE_FLAG_RECORD_REGISTER_WRITES 0x1
#define D3D11_SHADER_TRACE_FLAG_RECORD_REGISTER_READS 0x2
typedef struct D3D11_SHADER_TRACE_DESC
{
D3D11_SHADER_TYPE Type;
UINT Flags;
union
{
D3D11_VERTEX_SHADER_TRACE_DESC VertexShaderTraceDesc;
D3D11_HULL_SHADER_TRACE_DESC HullShaderTraceDesc;
D3D11_DOMAIN_SHADER_TRACE_DESC DomainShaderTraceDesc;
D3D11_GEOMETRY_SHADER_TRACE_DESC GeometryShaderTraceDesc;
D3D11_PIXEL_SHADER_TRACE_DESC PixelShaderTraceDesc;
D3D11_COMPUTE_SHADER_TRACE_DESC ComputeShaderTraceDesc;
} ;
} D3D11_SHADER_TRACE_DESC;
typedef
enum D3D11_TRACE_GS_INPUT_PRIMITIVE
{
D3D11_TRACE_GS_INPUT_PRIMITIVE_UNDEFINED = 0,
D3D11_TRACE_GS_INPUT_PRIMITIVE_POINT = 1,
D3D11_TRACE_GS_INPUT_PRIMITIVE_LINE = 2,
D3D11_TRACE_GS_INPUT_PRIMITIVE_TRIANGLE = 3,
D3D11_TRACE_GS_INPUT_PRIMITIVE_LINE_ADJ = 6,
D3D11_TRACE_GS_INPUT_PRIMITIVE_TRIANGLE_ADJ = 7
} D3D11_TRACE_GS_INPUT_PRIMITIVE;
typedef struct D3D11_TRACE_STATS
{
D3D11_SHADER_TRACE_DESC TraceDesc;
UINT8 NumInvocationsInStamp;
UINT8 TargetStampIndex;
UINT NumTraceSteps;
D3D11_TRACE_COMPONENT_MASK InputMask[ 32 ];
D3D11_TRACE_COMPONENT_MASK OutputMask[ 32 ];
UINT16 NumTemps;
UINT16 MaxIndexableTempIndex;
UINT16 IndexableTempSize[ 4096 ];
UINT16 ImmediateConstantBufferSize;
UINT PixelPosition[ 4 ][ 2 ];
UINT64 PixelCoverageMask[ 4 ];
UINT64 PixelDiscardedMask[ 4 ];
UINT64 PixelCoverageMaskAfterShader[ 4 ];
UINT64 PixelCoverageMaskAfterA2CSampleMask[ 4 ];
UINT64 PixelCoverageMaskAfterA2CSampleMaskDepth[ 4 ];
UINT64 PixelCoverageMaskAfterA2CSampleMaskDepthStencil[ 4 ];
BOOL PSOutputsDepth;
BOOL PSOutputsMask;
D3D11_TRACE_GS_INPUT_PRIMITIVE GSInputPrimitive;
BOOL GSInputsPrimitiveID;
D3D11_TRACE_COMPONENT_MASK HSOutputPatchConstantMask[ 32 ];
D3D11_TRACE_COMPONENT_MASK DSInputPatchConstantMask[ 32 ];
} D3D11_TRACE_STATS;
typedef struct D3D11_TRACE_VALUE
{
UINT Bits[ 4 ];
D3D11_TRACE_COMPONENT_MASK ValidMask;
} D3D11_TRACE_VALUE;
typedef
enum D3D11_TRACE_REGISTER_TYPE
{
D3D11_TRACE_OUTPUT_NULL_REGISTER = 0,
D3D11_TRACE_INPUT_REGISTER = ( D3D11_TRACE_OUTPUT_NULL_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_PRIMITIVE_ID_REGISTER = ( D3D11_TRACE_INPUT_REGISTER + 1 ) ,
D3D11_TRACE_IMMEDIATE_CONSTANT_BUFFER = ( D3D11_TRACE_INPUT_PRIMITIVE_ID_REGISTER + 1 ) ,
D3D11_TRACE_TEMP_REGISTER = ( D3D11_TRACE_IMMEDIATE_CONSTANT_BUFFER + 1 ) ,
D3D11_TRACE_INDEXABLE_TEMP_REGISTER = ( D3D11_TRACE_TEMP_REGISTER + 1 ) ,
D3D11_TRACE_OUTPUT_REGISTER = ( D3D11_TRACE_INDEXABLE_TEMP_REGISTER + 1 ) ,
D3D11_TRACE_OUTPUT_DEPTH_REGISTER = ( D3D11_TRACE_OUTPUT_REGISTER + 1 ) ,
D3D11_TRACE_CONSTANT_BUFFER = ( D3D11_TRACE_OUTPUT_DEPTH_REGISTER + 1 ) ,
D3D11_TRACE_IMMEDIATE32 = ( D3D11_TRACE_CONSTANT_BUFFER + 1 ) ,
D3D11_TRACE_SAMPLER = ( D3D11_TRACE_IMMEDIATE32 + 1 ) ,
D3D11_TRACE_RESOURCE = ( D3D11_TRACE_SAMPLER + 1 ) ,
D3D11_TRACE_RASTERIZER = ( D3D11_TRACE_RESOURCE + 1 ) ,
D3D11_TRACE_OUTPUT_COVERAGE_MASK = ( D3D11_TRACE_RASTERIZER + 1 ) ,
D3D11_TRACE_STREAM = ( D3D11_TRACE_OUTPUT_COVERAGE_MASK + 1 ) ,
D3D11_TRACE_THIS_POINTER = ( D3D11_TRACE_STREAM + 1 ) ,
D3D11_TRACE_OUTPUT_CONTROL_POINT_ID_REGISTER = ( D3D11_TRACE_THIS_POINTER + 1 ) ,
D3D11_TRACE_INPUT_FORK_INSTANCE_ID_REGISTER = ( D3D11_TRACE_OUTPUT_CONTROL_POINT_ID_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_JOIN_INSTANCE_ID_REGISTER = ( D3D11_TRACE_INPUT_FORK_INSTANCE_ID_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_CONTROL_POINT_REGISTER = ( D3D11_TRACE_INPUT_JOIN_INSTANCE_ID_REGISTER + 1 ) ,
D3D11_TRACE_OUTPUT_CONTROL_POINT_REGISTER = ( D3D11_TRACE_INPUT_CONTROL_POINT_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_PATCH_CONSTANT_REGISTER = ( D3D11_TRACE_OUTPUT_CONTROL_POINT_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_DOMAIN_POINT_REGISTER = ( D3D11_TRACE_INPUT_PATCH_CONSTANT_REGISTER + 1 ) ,
D3D11_TRACE_UNORDERED_ACCESS_VIEW = ( D3D11_TRACE_INPUT_DOMAIN_POINT_REGISTER + 1 ) ,
D3D11_TRACE_THREAD_GROUP_SHARED_MEMORY = ( D3D11_TRACE_UNORDERED_ACCESS_VIEW + 1 ) ,
D3D11_TRACE_INPUT_THREAD_ID_REGISTER = ( D3D11_TRACE_THREAD_GROUP_SHARED_MEMORY + 1 ) ,
D3D11_TRACE_INPUT_THREAD_GROUP_ID_REGISTER = ( D3D11_TRACE_INPUT_THREAD_ID_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_REGISTER = ( D3D11_TRACE_INPUT_THREAD_GROUP_ID_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_COVERAGE_MASK_REGISTER = ( D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_FLATTENED_REGISTER = ( D3D11_TRACE_INPUT_COVERAGE_MASK_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_GS_INSTANCE_ID_REGISTER = ( D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_FLATTENED_REGISTER + 1 ) ,
D3D11_TRACE_OUTPUT_DEPTH_GREATER_EQUAL_REGISTER = ( D3D11_TRACE_INPUT_GS_INSTANCE_ID_REGISTER + 1 ) ,
D3D11_TRACE_OUTPUT_DEPTH_LESS_EQUAL_REGISTER = ( D3D11_TRACE_OUTPUT_DEPTH_GREATER_EQUAL_REGISTER + 1 ) ,
D3D11_TRACE_IMMEDIATE64 = ( D3D11_TRACE_OUTPUT_DEPTH_LESS_EQUAL_REGISTER + 1 ) ,
D3D11_TRACE_INPUT_CYCLE_COUNTER_REGISTER = ( D3D11_TRACE_IMMEDIATE64 + 1 ) ,
D3D11_TRACE_INTERFACE_POINTER = ( D3D11_TRACE_INPUT_CYCLE_COUNTER_REGISTER + 1 )
} D3D11_TRACE_REGISTER_TYPE;
#define D3D11_TRACE_REGISTER_FLAGS_RELATIVE_INDEXING 0x1
typedef struct D3D11_TRACE_REGISTER
{
D3D11_TRACE_REGISTER_TYPE RegType;
union
{
UINT16 Index1D;
UINT16 Index2D[ 2 ];
} ;
UINT8 OperandIndex;
UINT8 Flags;
} D3D11_TRACE_REGISTER;
#define D3D11_TRACE_MISC_GS_EMIT 0x1
#define D3D11_TRACE_MISC_GS_CUT 0x2
#define D3D11_TRACE_MISC_PS_DISCARD 0x4
#define D3D11_TRACE_MISC_GS_EMIT_STREAM 0x8
#define D3D11_TRACE_MISC_GS_CUT_STREAM 0x10
#define D3D11_TRACE_MISC_HALT 0x20
#define D3D11_TRACE_MISC_MESSAGE 0x40
typedef UINT16 D3D11_TRACE_MISC_OPERATIONS_MASK;
typedef struct D3D11_TRACE_STEP
{
UINT ID;
BOOL InstructionActive;
UINT8 NumRegistersWritten;
UINT8 NumRegistersRead;
D3D11_TRACE_MISC_OPERATIONS_MASK MiscOperations;
UINT OpcodeType;
UINT64 CurrentGlobalCycle;
} D3D11_TRACE_STEP;
extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0000_v0_0_s_ifspec;
#ifndef __ID3D11ShaderTrace_INTERFACE_DEFINED__
#define __ID3D11ShaderTrace_INTERFACE_DEFINED__
/* interface ID3D11ShaderTrace */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D11ShaderTrace;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("36b013e6-2811-4845-baa7-d623fe0df104")
ID3D11ShaderTrace : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE TraceReady(
/* [annotation] */
_Out_opt_ UINT64 *pTestCount) = 0;
virtual void STDMETHODCALLTYPE ResetTrace( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetTraceStats(
/* [annotation] */
_Out_ D3D11_TRACE_STATS *pTraceStats) = 0;
virtual HRESULT STDMETHODCALLTYPE PSSelectStamp(
/* [annotation] */
_In_ UINT stampIndex) = 0;
virtual HRESULT STDMETHODCALLTYPE GetInitialRegisterContents(
/* [annotation] */
_In_ D3D11_TRACE_REGISTER *pRegister,
/* [annotation] */
_Out_ D3D11_TRACE_VALUE *pValue) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStep(
/* [annotation] */
_In_ UINT stepIndex,
/* [annotation] */
_Out_ D3D11_TRACE_STEP *pTraceStep) = 0;
virtual HRESULT STDMETHODCALLTYPE GetWrittenRegister(
/* [annotation] */
_In_ UINT stepIndex,
/* [annotation] */
_In_ UINT writtenRegisterIndex,
/* [annotation] */
_Out_ D3D11_TRACE_REGISTER *pRegister,
/* [annotation] */
_Out_ D3D11_TRACE_VALUE *pValue) = 0;
virtual HRESULT STDMETHODCALLTYPE GetReadRegister(
/* [annotation] */
_In_ UINT stepIndex,
/* [annotation] */
_In_ UINT readRegisterIndex,
/* [annotation] */
_Out_ D3D11_TRACE_REGISTER *pRegister,
/* [annotation] */
_Out_ D3D11_TRACE_VALUE *pValue) = 0;
};
#else /* C style interface */
typedef struct ID3D11ShaderTraceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D11ShaderTrace * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11ShaderTrace * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D11ShaderTrace * This);
HRESULT ( STDMETHODCALLTYPE *TraceReady )(
ID3D11ShaderTrace * This,
/* [annotation] */
_Out_opt_ UINT64 *pTestCount);
void ( STDMETHODCALLTYPE *ResetTrace )(
ID3D11ShaderTrace * This);
HRESULT ( STDMETHODCALLTYPE *GetTraceStats )(
ID3D11ShaderTrace * This,
/* [annotation] */
_Out_ D3D11_TRACE_STATS *pTraceStats);
HRESULT ( STDMETHODCALLTYPE *PSSelectStamp )(
ID3D11ShaderTrace * This,
/* [annotation] */
_In_ UINT stampIndex);
HRESULT ( STDMETHODCALLTYPE *GetInitialRegisterContents )(
ID3D11ShaderTrace * This,
/* [annotation] */
_In_ D3D11_TRACE_REGISTER *pRegister,
/* [annotation] */
_Out_ D3D11_TRACE_VALUE *pValue);
HRESULT ( STDMETHODCALLTYPE *GetStep )(
ID3D11ShaderTrace * This,
/* [annotation] */
_In_ UINT stepIndex,
/* [annotation] */
_Out_ D3D11_TRACE_STEP *pTraceStep);
HRESULT ( STDMETHODCALLTYPE *GetWrittenRegister )(
ID3D11ShaderTrace * This,
/* [annotation] */
_In_ UINT stepIndex,
/* [annotation] */
_In_ UINT writtenRegisterIndex,
/* [annotation] */
_Out_ D3D11_TRACE_REGISTER *pRegister,
/* [annotation] */
_Out_ D3D11_TRACE_VALUE *pValue);
HRESULT ( STDMETHODCALLTYPE *GetReadRegister )(
ID3D11ShaderTrace * This,
/* [annotation] */
_In_ UINT stepIndex,
/* [annotation] */
_In_ UINT readRegisterIndex,
/* [annotation] */
_Out_ D3D11_TRACE_REGISTER *pRegister,
/* [annotation] */
_Out_ D3D11_TRACE_VALUE *pValue);
END_INTERFACE
} ID3D11ShaderTraceVtbl;
interface ID3D11ShaderTrace
{
CONST_VTBL struct ID3D11ShaderTraceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D11ShaderTrace_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D11ShaderTrace_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D11ShaderTrace_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D11ShaderTrace_TraceReady(This,pTestCount) \
( (This)->lpVtbl -> TraceReady(This,pTestCount) )
#define ID3D11ShaderTrace_ResetTrace(This) \
( (This)->lpVtbl -> ResetTrace(This) )
#define ID3D11ShaderTrace_GetTraceStats(This,pTraceStats) \
( (This)->lpVtbl -> GetTraceStats(This,pTraceStats) )
#define ID3D11ShaderTrace_PSSelectStamp(This,stampIndex) \
( (This)->lpVtbl -> PSSelectStamp(This,stampIndex) )
#define ID3D11ShaderTrace_GetInitialRegisterContents(This,pRegister,pValue) \
( (This)->lpVtbl -> GetInitialRegisterContents(This,pRegister,pValue) )
#define ID3D11ShaderTrace_GetStep(This,stepIndex,pTraceStep) \
( (This)->lpVtbl -> GetStep(This,stepIndex,pTraceStep) )
#define ID3D11ShaderTrace_GetWrittenRegister(This,stepIndex,writtenRegisterIndex,pRegister,pValue) \
( (This)->lpVtbl -> GetWrittenRegister(This,stepIndex,writtenRegisterIndex,pRegister,pValue) )
#define ID3D11ShaderTrace_GetReadRegister(This,stepIndex,readRegisterIndex,pRegister,pValue) \
( (This)->lpVtbl -> GetReadRegister(This,stepIndex,readRegisterIndex,pRegister,pValue) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D11ShaderTrace_INTERFACE_DEFINED__ */
#ifndef __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__
#define __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__
/* interface ID3D11ShaderTraceFactory */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D11ShaderTraceFactory;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1fbad429-66ab-41cc-9617-667ac10e4459")
ID3D11ShaderTraceFactory : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateShaderTrace(
/* [annotation] */
_In_ IUnknown *pShader,
/* [annotation] */
_In_ D3D11_SHADER_TRACE_DESC *pTraceDesc,
/* [annotation] */
_COM_Outptr_ ID3D11ShaderTrace **ppShaderTrace) = 0;
};
#else /* C style interface */
typedef struct ID3D11ShaderTraceFactoryVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D11ShaderTraceFactory * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11ShaderTraceFactory * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D11ShaderTraceFactory * This);
HRESULT ( STDMETHODCALLTYPE *CreateShaderTrace )(
ID3D11ShaderTraceFactory * This,
/* [annotation] */
_In_ IUnknown *pShader,
/* [annotation] */
_In_ D3D11_SHADER_TRACE_DESC *pTraceDesc,
/* [annotation] */
_COM_Outptr_ ID3D11ShaderTrace **ppShaderTrace);
END_INTERFACE
} ID3D11ShaderTraceFactoryVtbl;
interface ID3D11ShaderTraceFactory
{
CONST_VTBL struct ID3D11ShaderTraceFactoryVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D11ShaderTraceFactory_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D11ShaderTraceFactory_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D11ShaderTraceFactory_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D11ShaderTraceFactory_CreateShaderTrace(This,pShader,pTraceDesc,ppShaderTrace) \
( (This)->lpVtbl -> CreateShaderTrace(This,pShader,pTraceDesc,ppShaderTrace) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d11ShaderTracing_0000_0002 */
/* [local] */
HRESULT WINAPI
D3DDisassemble11Trace(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ ID3D11ShaderTrace* pTrace,
_In_ UINT StartStep,
_In_ UINT NumSteps,
_In_ UINT Flags,
_COM_Outptr_ interface ID3D10Blob** ppDisassembly);
extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0002_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

10359
gfx/include/dxsdk/d3d12.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,459 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D12Shader.h
// Content: D3D12 Shader Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D12SHADER_H__
#define __D3D12SHADER_H__
#include "d3dcommon.h"
typedef enum D3D12_SHADER_VERSION_TYPE
{
D3D12_SHVER_PIXEL_SHADER = 0,
D3D12_SHVER_VERTEX_SHADER = 1,
D3D12_SHVER_GEOMETRY_SHADER = 2,
// D3D11 Shaders
D3D12_SHVER_HULL_SHADER = 3,
D3D12_SHVER_DOMAIN_SHADER = 4,
D3D12_SHVER_COMPUTE_SHADER = 5,
D3D12_SHVER_RESERVED0 = 0xFFF0,
} D3D12_SHADER_VERSION_TYPE;
#define D3D12_SHVER_GET_TYPE(_Version) \
(((_Version) >> 16) & 0xffff)
#define D3D12_SHVER_GET_MAJOR(_Version) \
(((_Version) >> 4) & 0xf)
#define D3D12_SHVER_GET_MINOR(_Version) \
(((_Version) >> 0) & 0xf)
// Slot ID for library function return
#define D3D_RETURN_PARAMETER_INDEX (-1)
typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;
typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;
typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
{
LPCSTR SemanticName; // Name of the semantic
UINT SemanticIndex; // Index of the semantic
UINT Register; // Number of member variables
D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
BYTE Mask; // Mask to indicate which components of the register
// are used (combination of D3D10_COMPONENT_MASK values)
BYTE ReadWriteMask; // Mask to indicate whether a given component is
// never written (if this is an output signature) or
// always read (if this is an input signature).
// (combination of D3D_MASK_* values)
UINT Stream; // Stream index
D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
} D3D12_SIGNATURE_PARAMETER_DESC;
typedef struct _D3D12_SHADER_BUFFER_DESC
{
LPCSTR Name; // Name of the constant buffer
D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
UINT Variables; // Number of member variables
UINT Size; // Size of CB (in bytes)
UINT uFlags; // Buffer description flags
} D3D12_SHADER_BUFFER_DESC;
typedef struct _D3D12_SHADER_VARIABLE_DESC
{
LPCSTR Name; // Name of the variable
UINT StartOffset; // Offset in constant buffer's backing store
UINT Size; // Size of variable (in bytes)
UINT uFlags; // Variable flags
LPVOID DefaultValue; // Raw pointer to default value
UINT StartTexture; // First texture index (or -1 if no textures used)
UINT TextureSize; // Number of texture slots possibly used.
UINT StartSampler; // First sampler index (or -1 if no textures used)
UINT SamplerSize; // Number of sampler slots possibly used.
} D3D12_SHADER_VARIABLE_DESC;
typedef struct _D3D12_SHADER_TYPE_DESC
{
D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
UINT Elements; // Number of elements (0 if not an array)
UINT Members; // Number of members (0 if not a structure)
UINT Offset; // Offset from the start of structure (0 if not a structure member)
LPCSTR Name; // Name of type, can be NULL
} D3D12_SHADER_TYPE_DESC;
typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;
typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;
typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;
typedef struct _D3D12_SHADER_DESC
{
UINT Version; // Shader version
LPCSTR Creator; // Creator string
UINT Flags; // Shader compilation/parse flags
UINT ConstantBuffers; // Number of constant buffers
UINT BoundResources; // Number of bound resources
UINT InputParameters; // Number of parameters in the input signature
UINT OutputParameters; // Number of parameters in the output signature
UINT InstructionCount; // Number of emitted instructions
UINT TempRegisterCount; // Number of temporary registers used
UINT TempArrayCount; // Number of temporary arrays used
UINT DefCount; // Number of constant defines
UINT DclCount; // Number of declarations (input + output)
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
UINT TextureLoadInstructions; // Number of texture load instructions
UINT TextureCompInstructions; // Number of texture comparison instructions
UINT TextureBiasInstructions; // Number of texture bias instructions
UINT TextureGradientInstructions; // Number of texture gradient instructions
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
UINT StaticFlowControlCount; // Number of static flow control instructions used
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
UINT MacroInstructionCount; // Number of macro instructions used
UINT ArrayInstructionCount; // Number of array instructions used
UINT CutInstructionCount; // Number of cut instructions used
UINT EmitInstructionCount; // Number of emit instructions used
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
UINT PatchConstantParameters; // Number of parameters in the patch constant signature
UINT cGSInstanceCount; // Number of Geometry shader instances
UINT cControlPoints; // Number of control points in the HS->DS stage
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
// instruction counts
UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
UINT cInterlockedInstructions; // Number of interlocked instructions
UINT cTextureStoreInstructions; // Number of texture writes
} D3D12_SHADER_DESC;
typedef struct _D3D12_SHADER_INPUT_BIND_DESC
{
LPCSTR Name; // Name of the resource
D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
UINT BindPoint; // Starting bind point
UINT BindCount; // Number of contiguous bind points (for arrays)
UINT uFlags; // Input binding flags
D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
UINT NumSamples; // Number of samples (0 if not MS texture)
UINT Space; // Register space
UINT uID; // Range ID in the bytecode
} D3D12_SHADER_INPUT_BIND_DESC;
#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200
#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400
#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
#define D3D_SHADER_REQUIRES_ROVS 0x00001000
#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
typedef struct _D3D12_LIBRARY_DESC
{
LPCSTR Creator; // The name of the originator of the library.
UINT Flags; // Compilation flags.
UINT FunctionCount; // Number of functions exported from the library.
} D3D12_LIBRARY_DESC;
typedef struct _D3D12_FUNCTION_DESC
{
UINT Version; // Shader version
LPCSTR Creator; // Creator string
UINT Flags; // Shader compilation/parse flags
UINT ConstantBuffers; // Number of constant buffers
UINT BoundResources; // Number of bound resources
UINT InstructionCount; // Number of emitted instructions
UINT TempRegisterCount; // Number of temporary registers used
UINT TempArrayCount; // Number of temporary arrays used
UINT DefCount; // Number of constant defines
UINT DclCount; // Number of declarations (input + output)
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
UINT TextureLoadInstructions; // Number of texture load instructions
UINT TextureCompInstructions; // Number of texture comparison instructions
UINT TextureBiasInstructions; // Number of texture bias instructions
UINT TextureGradientInstructions; // Number of texture gradient instructions
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
UINT StaticFlowControlCount; // Number of static flow control instructions used
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
UINT MacroInstructionCount; // Number of macro instructions used
UINT ArrayInstructionCount; // Number of array instructions used
UINT MovInstructionCount; // Number of mov instructions used
UINT MovcInstructionCount; // Number of movc instructions used
UINT ConversionInstructionCount; // Number of type conversion instructions used
UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
UINT64 RequiredFeatureFlags; // Required feature flags
LPCSTR Name; // Function name
INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
} D3D12_FUNCTION_DESC;
typedef struct _D3D12_PARAMETER_DESC
{
LPCSTR Name; // Parameter name.
LPCSTR SemanticName; // Parameter semantic name (+index).
D3D_SHADER_VARIABLE_TYPE Type; // Element type.
D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
UINT Rows; // Rows are for matrix parameters.
UINT Columns; // Components or Columns in matrix.
D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
UINT FirstInRegister; // The first input register for this parameter.
UINT FirstInComponent; // The first input register component for this parameter.
UINT FirstOutRegister; // The first output register for this parameter.
UINT FirstOutComponent; // The first output register component for this parameter.
} D3D12_PARAMETER_DESC;
//////////////////////////////////////////////////////////////////////////////
// Interfaces ////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;
typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;
typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;
typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;
typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;
typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;
typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;
typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;
typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;
typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;
typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;
typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;
typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;
typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;
// {E913C351-783D-48CA-A1D1-4F306284AD56}
interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;
DEFINE_GUID(IID_ID3D12ShaderReflectionType,
0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);
#undef INTERFACE
#define INTERFACE ID3D12ShaderReflectionType
DECLARE_INTERFACE(ID3D12ShaderReflectionType)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;
STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;
STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;
};
// {8337A8A6-A216-444A-B2F4-314733A73AEA}
interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;
DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,
0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);
#undef INTERFACE
#define INTERFACE ID3D12ShaderReflectionVariable
DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
};
// {C59598B4-48B3-4869-B9B1-B1618B14A8B7}
interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;
DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,
0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);
#undef INTERFACE
#define INTERFACE ID3D12ShaderReflectionConstantBuffer
DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)
{
STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
};
// The ID3D12ShaderReflection IID may change from SDK version to SDK version
// if the reflection API changes. This prevents new code with the new API
// from working with an old binary. Recompiling with the new header
// will pick up the new IID.
// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}
interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;
DEFINE_GUID(IID_ID3D12ShaderReflection,
0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);
#undef INTERFACE
#define INTERFACE ID3D12ShaderReflection
DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
_Out_ LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
_Out_opt_ UINT* pSizeX,
_Out_opt_ UINT* pSizeY,
_Out_opt_ UINT* pSizeZ) PURE;
STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
};
// {8E349D19-54DB-4A56-9DC9-119D87BDB804}
interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;
DEFINE_GUID(IID_ID3D12LibraryReflection,
0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);
#undef INTERFACE
#define INTERFACE ID3D12LibraryReflection
DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;
STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
};
// {1108795C-2772-4BA9-B2A8-D464DC7E2799}
interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;
DEFINE_GUID(IID_ID3D12FunctionReflection,
0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);
#undef INTERFACE
#define INTERFACE ID3D12FunctionReflection
DECLARE_INTERFACE(ID3D12FunctionReflection)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
};
// {EC25F42D-7006-4F2B-B33E-02CC3375733F}
interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;
DEFINE_GUID(IID_ID3D12FunctionParameterReflection,
0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);
#undef INTERFACE
#define INTERFACE ID3D12FunctionParameterReflection
DECLARE_INTERFACE(ID3D12FunctionParameterReflection)
{
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D12SHADER_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,586 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DCompiler.h
// Content: D3D Compilation Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3DCOMPILER_H__
#define __D3DCOMPILER_H__
/*#include <winapifamily.h>*/
// Current name of the DLL shipped in the same SDK as this header.
#define D3DCOMPILER_DLL_W L"d3dcompiler_47.dll"
#define D3DCOMPILER_DLL_A "d3dcompiler_47.dll"
// Current HLSL compiler version.
#define D3D_COMPILER_VERSION 47
#ifdef UNICODE
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_W
#else
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_A
#endif
#include "d3d11shader.h"
#include "d3d12shader.h"
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
//----------------------------------------------------------------------------
// D3DReadFileToBlob:
// -----------------
// Simple helper routine to read a file on disk into memory
// for passing to other routines in this API.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DReadFileToBlob(_In_ LPCWSTR pFileName,
_Out_ ID3DBlob** ppContents);
//----------------------------------------------------------------------------
// D3DWriteBlobToFile:
// ------------------
// Simple helper routine to write a memory blob to a file on disk.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DWriteBlobToFile(_In_ ID3DBlob* pBlob,
_In_ LPCWSTR pFileName,
_In_ BOOL bOverwrite);
//----------------------------------------------------------------------------
// D3DCOMPILE flags:
// -----------------
// D3DCOMPILE_DEBUG
// Insert debug file/line/type/symbol information.
//
// D3DCOMPILE_SKIP_VALIDATION
// Do not validate the generated code against known capabilities and
// constraints. This option is only recommended when compiling shaders
// you KNOW will work. (ie. have compiled before without this option.)
// Shaders are always validated by D3D before they are set to the device.
//
// D3DCOMPILE_SKIP_OPTIMIZATION
// Instructs the compiler to skip optimization steps during code generation.
// Unless you are trying to isolate a problem in your code using this option
// is not recommended.
//
// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
// Unless explicitly specified, matrices will be packed in row-major order
// on input and output from the shader.
//
// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
// Unless explicitly specified, matrices will be packed in column-major
// order on input and output from the shader. This is generally more
// efficient, since it allows vector-matrix multiplication to be performed
// using a series of dot-products.
//
// D3DCOMPILE_PARTIAL_PRECISION
// Force all computations in resulting shader to occur at partial precision.
// This may result in faster evaluation of shaders on some hardware.
//
// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT
// Force compiler to compile against the next highest available software
// target for vertex shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT
// Force compiler to compile against the next highest available software
// target for pixel shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3DCOMPILE_NO_PRESHADER
// Disables Preshaders. Using this flag will cause the compiler to not
// pull out static expression for evaluation on the host cpu
//
// D3DCOMPILE_AVOID_FLOW_CONTROL
// Hint compiler to avoid flow-control constructs where possible.
//
// D3DCOMPILE_PREFER_FLOW_CONTROL
// Hint compiler to prefer flow-control constructs where possible.
//
// D3DCOMPILE_ENABLE_STRICTNESS
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
// Specifying this flag enables the strict mode. Deprecated syntax may be
// removed in a future release, and enabling syntax is a good way to make
// sure your shaders comply to the latest spec.
//
// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
// This enables older shaders to compile to 4_0 targets.
//
// D3DCOMPILE_DEBUG_NAME_FOR_SOURCE
// This enables a debug name to be generated based on source information.
// It requires D3DCOMPILE_DEBUG to be set, and is exclusive with
// D3DCOMPILE_DEBUG_NAME_FOR_BINARY.
//
// D3DCOMPILE_DEBUG_NAME_FOR_BINARY
// This enables a debug name to be generated based on compiled information.
// It requires D3DCOMPILE_DEBUG to be set, and is exclusive with
// D3DCOMPILE_DEBUG_NAME_FOR_SOURCE.
//
//----------------------------------------------------------------------------
#define D3DCOMPILE_DEBUG (1 << 0)
#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)
#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)
#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)
#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)
#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
#define D3DCOMPILE_NO_PRESHADER (1 << 8)
#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)
#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)
#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)
#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)
#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0
#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)
#define D3DCOMPILE_RESERVED16 (1 << 16)
#define D3DCOMPILE_RESERVED17 (1 << 17)
#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)
#define D3DCOMPILE_RESOURCES_MAY_ALIAS (1 << 19)
#define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20)
#define D3DCOMPILE_ALL_RESOURCES_BOUND (1 << 21)
#define D3DCOMPILE_DEBUG_NAME_FOR_SOURCE (1 << 22)
#define D3DCOMPILE_DEBUG_NAME_FOR_BINARY (1 << 23)
//----------------------------------------------------------------------------
// D3DCOMPILE_EFFECT flags:
// -------------------------------------
// These flags are passed in when creating an effect, and affect
// either compilation behavior or runtime effect behavior
//
// D3DCOMPILE_EFFECT_CHILD_EFFECT
// Compile this .fx file to a child effect. Child effects have no
// initializers for any shared values as these are initialied in the
// master effect (pool).
//
// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS
// By default, performance mode is enabled. Performance mode
// disallows mutable state objects by preventing non-literal
// expressions from appearing in state object definitions.
// Specifying this flag will disable the mode and allow for mutable
// state objects.
//
//----------------------------------------------------------------------------
#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)
#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)
//----------------------------------------------------------------------------
// D3DCOMPILE Flags2:
// -----------------
// Root signature flags. (passed in Flags2)
#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST 0
#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 (1 << 4)
#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 (1 << 5)
//----------------------------------------------------------------------------
// D3DCompile:
// ----------
// Compile source text into bytecode appropriate for the given target.
//----------------------------------------------------------------------------
// D3D_COMPILE_STANDARD_FILE_INCLUDE can be passed for pInclude in any
// API and indicates that a simple default include handler should be
// used. The include handler will include files relative to the
// current directory and files relative to the directory of the initial source
// file. When used with APIs like D3DCompile pSourceName must be a
// file name and the initial relative directory will be derived from it.
#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)
HRESULT WINAPI
D3DCompile(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_opt_ LPCSTR pSourceName,
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
_In_opt_ ID3DInclude* pInclude,
_In_opt_ LPCSTR pEntrypoint,
_In_ LPCSTR pTarget,
_In_ UINT Flags1,
_In_ UINT Flags2,
_Out_ ID3DBlob** ppCode,
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
typedef HRESULT (WINAPI *pD3DCompile)
(LPCVOID pSrcData,
SIZE_T SrcDataSize,
LPCSTR pFileName,
CONST D3D_SHADER_MACRO* pDefines,
ID3DInclude* pInclude,
LPCSTR pEntrypoint,
LPCSTR pTarget,
UINT Flags1,
UINT Flags2,
ID3DBlob** ppCode,
ID3DBlob** ppErrorMsgs);
#define D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 0x00000001
#define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002
#define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004
HRESULT WINAPI
D3DCompile2(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_opt_ LPCSTR pSourceName,
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
_In_opt_ ID3DInclude* pInclude,
_In_ LPCSTR pEntrypoint,
_In_ LPCSTR pTarget,
_In_ UINT Flags1,
_In_ UINT Flags2,
_In_ UINT SecondaryDataFlags,
_In_reads_bytes_opt_(SecondaryDataSize) LPCVOID pSecondaryData,
_In_ SIZE_T SecondaryDataSize,
_Out_ ID3DBlob** ppCode,
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
HRESULT WINAPI
D3DCompileFromFile(_In_ LPCWSTR pFileName,
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
_In_opt_ ID3DInclude* pInclude,
_In_ LPCSTR pEntrypoint,
_In_ LPCSTR pTarget,
_In_ UINT Flags1,
_In_ UINT Flags2,
_Out_ ID3DBlob** ppCode,
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
//----------------------------------------------------------------------------
// D3DPreprocess:
// -------------
// Process source text with the compiler's preprocessor and return
// the resulting text.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DPreprocess(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_opt_ LPCSTR pSourceName,
_In_opt_ CONST D3D_SHADER_MACRO* pDefines,
_In_opt_ ID3DInclude* pInclude,
_Out_ ID3DBlob** ppCodeText,
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
typedef HRESULT (WINAPI *pD3DPreprocess)
(LPCVOID pSrcData,
SIZE_T SrcDataSize,
LPCSTR pFileName,
CONST D3D_SHADER_MACRO* pDefines,
ID3DInclude* pInclude,
ID3DBlob** ppCodeText,
ID3DBlob** ppErrorMsgs);
//----------------------------------------------------------------------------
// D3DGetDebugInfo:
// -----------------------
// Gets shader debug info. Debug info is generated by D3DCompile and is
// embedded in the body of the shader.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DGetDebugInfo(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_Out_ ID3DBlob** ppDebugInfo);
//----------------------------------------------------------------------------
// D3DReflect:
// ----------
// Shader code contains metadata that can be inspected via the
// reflection APIs.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DReflect(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ REFIID pInterface,
_Out_ void** ppReflector);
//----------------------------------------------------------------------------
// D3DReflectLibrary:
// ----------
// Library code contains metadata that can be inspected via the library
// reflection APIs.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DReflectLibrary(__in_bcount(SrcDataSize) LPCVOID pSrcData,
__in SIZE_T SrcDataSize,
__in REFIID riid,
__out LPVOID * ppReflector);
//----------------------------------------------------------------------------
// D3DDisassemble:
// ----------------------
// Takes a binary shader and returns a buffer containing text assembly.
//----------------------------------------------------------------------------
#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
#define D3D_DISASM_ENABLE_INSTRUCTION_OFFSET 0x00000020
#define D3D_DISASM_INSTRUCTION_ONLY 0x00000040
#define D3D_DISASM_PRINT_HEX_LITERALS 0x00000080
HRESULT WINAPI
D3DDisassemble(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ UINT Flags,
_In_opt_ LPCSTR szComments,
_Out_ ID3DBlob** ppDisassembly);
typedef HRESULT (WINAPI *pD3DDisassemble)
(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ UINT Flags,
_In_opt_ LPCSTR szComments,
_Out_ ID3DBlob** ppDisassembly);
HRESULT WINAPI
D3DDisassembleRegion(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ UINT Flags,
_In_opt_ LPCSTR szComments,
_In_ SIZE_T StartByteOffset,
_In_ SIZE_T NumInsts,
_Out_opt_ SIZE_T* pFinishByteOffset,
_Out_ ID3DBlob** ppDisassembly);
//----------------------------------------------------------------------------
// Shader linking and Function Linking Graph (FLG) APIs
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DCreateLinker(__out interface ID3D11Linker ** ppLinker);
HRESULT WINAPI
D3DLoadModule(_In_ LPCVOID pSrcData,
_In_ SIZE_T cbSrcDataSize,
_Out_ interface ID3D11Module ** ppModule);
HRESULT WINAPI
D3DCreateFunctionLinkingGraph(_In_ UINT uFlags,
_Out_ interface ID3D11FunctionLinkingGraph ** ppFunctionLinkingGraph);
//----------------------------------------------------------------------------
// D3DGetTraceInstructionOffsets:
// -----------------------
// Determines byte offsets for instructions within a shader blob.
// This information is useful for going between trace instruction
// indices and byte offsets that are used in debug information.
//----------------------------------------------------------------------------
#define D3D_GET_INST_OFFSETS_INCLUDE_NON_EXECUTABLE 0x00000001
HRESULT WINAPI
D3DGetTraceInstructionOffsets(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ UINT Flags,
_In_ SIZE_T StartInstIndex,
_In_ SIZE_T NumInsts,
_Out_writes_to_opt_(NumInsts, min(NumInsts, *pTotalInsts)) SIZE_T* pOffsets,
_Out_opt_ SIZE_T* pTotalInsts);
//----------------------------------------------------------------------------
// D3DGetInputSignatureBlob:
// -----------------------
// Retrieve the input signature from a compilation result.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DGetInputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_Out_ ID3DBlob** ppSignatureBlob);
//----------------------------------------------------------------------------
// D3DGetOutputSignatureBlob:
// -----------------------
// Retrieve the output signature from a compilation result.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DGetOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_Out_ ID3DBlob** ppSignatureBlob);
//----------------------------------------------------------------------------
// D3DGetInputAndOutputSignatureBlob:
// -----------------------
// Retrieve the input and output signatures from a compilation result.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DGetInputAndOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_Out_ ID3DBlob** ppSignatureBlob);
//----------------------------------------------------------------------------
// D3DStripShader:
// -----------------------
// Removes unwanted blobs from a compilation result
//----------------------------------------------------------------------------
typedef enum D3DCOMPILER_STRIP_FLAGS
{
D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001,
D3DCOMPILER_STRIP_DEBUG_INFO = 0x00000002,
D3DCOMPILER_STRIP_TEST_BLOBS = 0x00000004,
D3DCOMPILER_STRIP_PRIVATE_DATA = 0x00000008,
D3DCOMPILER_STRIP_ROOT_SIGNATURE = 0x00000010,
D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff,
} D3DCOMPILER_STRIP_FLAGS;
HRESULT WINAPI
D3DStripShader(_In_reads_bytes_(BytecodeLength) LPCVOID pShaderBytecode,
_In_ SIZE_T BytecodeLength,
_In_ UINT uStripFlags,
_Out_ ID3DBlob** ppStrippedBlob);
//----------------------------------------------------------------------------
// D3DGetBlobPart:
// -----------------------
// Extracts information from a compilation result.
//----------------------------------------------------------------------------
typedef enum D3D_BLOB_PART
{
D3D_BLOB_INPUT_SIGNATURE_BLOB,
D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
D3D_BLOB_ALL_SIGNATURE_BLOB,
D3D_BLOB_DEBUG_INFO,
D3D_BLOB_LEGACY_SHADER,
D3D_BLOB_XNA_PREPASS_SHADER,
D3D_BLOB_XNA_SHADER,
D3D_BLOB_PDB,
D3D_BLOB_PRIVATE_DATA,
D3D_BLOB_ROOT_SIGNATURE,
D3D_BLOB_DEBUG_NAME,
// Test parts are only produced by special compiler versions and so
// are usually not present in shaders.
D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
D3D_BLOB_TEST_COMPILE_DETAILS,
D3D_BLOB_TEST_COMPILE_PERF,
D3D_BLOB_TEST_COMPILE_REPORT,
} D3D_BLOB_PART;
HRESULT WINAPI
D3DGetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ D3D_BLOB_PART Part,
_In_ UINT Flags,
_Out_ ID3DBlob** ppPart);
//----------------------------------------------------------------------------
// D3DSetBlobPart:
// -----------------------
// Update information in a compilation result.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DSetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ D3D_BLOB_PART Part,
_In_ UINT Flags,
_In_reads_bytes_(PartSize) LPCVOID pPart,
_In_ SIZE_T PartSize,
_Out_ ID3DBlob** ppNewShader);
//----------------------------------------------------------------------------
// D3DCreateBlob:
// -----------------------
// Create an ID3DBlob instance.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DCreateBlob(_In_ SIZE_T Size,
_Out_ ID3DBlob** ppBlob);
//----------------------------------------------------------------------------
// D3DCompressShaders:
// -----------------------
// Compresses a set of shaders into a more compact form.
//----------------------------------------------------------------------------
typedef struct _D3D_SHADER_DATA
{
LPCVOID pBytecode;
SIZE_T BytecodeLength;
} D3D_SHADER_DATA;
#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001
HRESULT WINAPI
D3DCompressShaders(_In_ UINT uNumShaders,
_In_reads_(uNumShaders) D3D_SHADER_DATA* pShaderData,
_In_ UINT uFlags,
_Out_ ID3DBlob** ppCompressedData);
//----------------------------------------------------------------------------
// D3DDecompressShaders:
// -----------------------
// Decompresses one or more shaders from a compressed set.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DDecompressShaders(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ UINT uNumShaders,
_In_ UINT uStartIndex,
_In_reads_opt_(uNumShaders) UINT* pIndices,
_In_ UINT uFlags,
_Out_writes_(uNumShaders) ID3DBlob** ppShaders,
_Out_opt_ UINT* pTotalShaders);
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
//----------------------------------------------------------------------------
// D3DDisassemble10Effect:
// -----------------------
// Takes a D3D10 effect interface and returns a
// buffer containing text assembly.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DDisassemble10Effect(_In_ interface ID3D10Effect *pEffect,
_In_ UINT Flags,
_Out_ ID3DBlob** ppDisassembly);
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // #ifndef __D3DCOMPILER_H__

416
gfx/include/dxsdk/d3dcsx.h Normal file
View File

@ -0,0 +1,416 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DX11GPGPU.h
// Content: D3DX11 General Purpose GPU computing algorithms
//
//////////////////////////////////////////////////////////////////////////////
/*#include <winapifamily.h>*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
#include "d3d11.h"
#ifndef __D3DX11GPGPU_H__
#define __D3DX11GPGPU_H__
// Current name of the DLL shipped in the same SDK as this header.
#define D3DCSX_DLL_W L"d3dcsx_47.dll"
#define D3DCSX_DLL_A "d3dcsx_47.dll"
#ifdef UNICODE
#define D3DCSX_DLL D3DCSX_DLL_W
#else
#define D3DCSX_DLL D3DCSX_DLL_A
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
typedef enum D3DX11_SCAN_DATA_TYPE
{
D3DX11_SCAN_DATA_TYPE_FLOAT = 1,
D3DX11_SCAN_DATA_TYPE_INT,
D3DX11_SCAN_DATA_TYPE_UINT,
} D3DX11_SCAN_DATA_TYPE;
typedef enum D3DX11_SCAN_OPCODE
{
D3DX11_SCAN_OPCODE_ADD = 1,
D3DX11_SCAN_OPCODE_MIN,
D3DX11_SCAN_OPCODE_MAX,
D3DX11_SCAN_OPCODE_MUL,
D3DX11_SCAN_OPCODE_AND,
D3DX11_SCAN_OPCODE_OR,
D3DX11_SCAN_OPCODE_XOR,
} D3DX11_SCAN_OPCODE;
typedef enum D3DX11_SCAN_DIRECTION
{
D3DX11_SCAN_DIRECTION_FORWARD = 1,
D3DX11_SCAN_DIRECTION_BACKWARD,
} D3DX11_SCAN_DIRECTION;
//////////////////////////////////////////////////////////////////////////////
// ID3DX11Scan:
//////////////////////////////////////////////////////////////////////////////
// {5089b68f-e71d-4d38-be8e-f363b95a9405}
DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05);
#undef INTERFACE
#define INTERFACE ID3DX11Scan
DECLARE_INTERFACE_(ID3DX11Scan, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX11Scan
STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
//=============================================================================
// Performs an unsegmented scan of a sequence in-place or out-of-place
// ElementType element type
// OpCode binary operation
// Direction scan direction
// ElementScanSize size of scan, in elements
// pSrc input sequence on the device. pSrc==pDst for in-place scans
// pDst output sequence on the device
//=============================================================================
STDMETHOD(Scan)( THIS_
D3DX11_SCAN_DATA_TYPE ElementType,
D3DX11_SCAN_OPCODE OpCode,
UINT ElementScanSize,
_In_ ID3D11UnorderedAccessView* pSrc,
_In_ ID3D11UnorderedAccessView* pDst
) PURE;
//=============================================================================
// Performs a multiscan of a sequence in-place or out-of-place
// ElementType element type
// OpCode binary operation
// Direction scan direction
// ElementScanSize size of scan, in elements
// ElementScanPitch pitch of the next scan, in elements
// ScanCount number of scans in a multiscan
// pSrc input sequence on the device. pSrc==pDst for in-place scans
// pDst output sequence on the device
//=============================================================================
STDMETHOD(Multiscan)( THIS_
D3DX11_SCAN_DATA_TYPE ElementType,
D3DX11_SCAN_OPCODE OpCode,
UINT ElementScanSize,
UINT ElementScanPitch,
UINT ScanCount,
_In_ ID3D11UnorderedAccessView* pSrc,
_In_ ID3D11UnorderedAccessView* pDst
) PURE;
};
//=============================================================================
// Creates a scan context
// pDevice the device context
// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
// MaxScanCount maximum number of scans in multiscan
// ppScanContext new scan context
//=============================================================================
HRESULT WINAPI D3DX11CreateScan(
_In_ ID3D11DeviceContext* pDeviceContext,
UINT MaxElementScanSize,
UINT MaxScanCount,
_Out_ ID3DX11Scan** ppScan );
//////////////////////////////////////////////////////////////////////////////
// ID3DX11SegmentedScan:
//////////////////////////////////////////////////////////////////////////////
// {a915128c-d954-4c79-bfe1-64db923194d6}
DEFINE_GUID(IID_ID3DX11SegmentedScan, 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6);
#undef INTERFACE
#define INTERFACE ID3DX11SegmentedScan
DECLARE_INTERFACE_(ID3DX11SegmentedScan, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX11SegmentedScan
STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
//=============================================================================
// Performs a segscan of a sequence in-place or out-of-place
// ElementType element type
// OpCode binary operation
// Direction scan direction
// pSrcElementFlags compact array of bits, one per element of pSrc. A set value
// indicates the start of a new segment.
// ElementScanSize size of scan, in elements
// pSrc input sequence on the device. pSrc==pDst for in-place scans
// pDst output sequence on the device
//=============================================================================
STDMETHOD(SegScan)( THIS_
D3DX11_SCAN_DATA_TYPE ElementType,
D3DX11_SCAN_OPCODE OpCode,
UINT ElementScanSize,
_In_opt_ ID3D11UnorderedAccessView* pSrc,
_In_ ID3D11UnorderedAccessView* pSrcElementFlags,
_In_ ID3D11UnorderedAccessView* pDst
) PURE;
};
//=============================================================================
// Creates a segmented scan context
// pDevice the device context
// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
// ppScanContext new scan context
//=============================================================================
HRESULT WINAPI D3DX11CreateSegmentedScan(
_In_ ID3D11DeviceContext* pDeviceContext,
UINT MaxElementScanSize,
_Out_ ID3DX11SegmentedScan** ppScan );
//////////////////////////////////////////////////////////////////////////////
#define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS 4
#define D3DX11_FFT_MAX_TEMP_BUFFERS 4
#define D3DX11_FFT_MAX_DIMENSIONS 32
//////////////////////////////////////////////////////////////////////////////
// ID3DX11FFT:
//////////////////////////////////////////////////////////////////////////////
// {b3f7a938-4c93-4310-a675-b30d6de50553}
DEFINE_GUID(IID_ID3DX11FFT, 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53);
#undef INTERFACE
#define INTERFACE ID3DX11FFT
DECLARE_INTERFACE_(ID3DX11FFT, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX11FFT
// scale for forward transform (defaults to 1 if set to 0)
STDMETHOD(SetForwardScale)(THIS_ FLOAT ForwardScale) PURE;
STDMETHOD_(FLOAT, GetForwardScale)(THIS) PURE;
// scale for inverse transform (defaults to 1/N if set to 0, where N is
// the product of the transformed dimension lengths
STDMETHOD(SetInverseScale)(THIS_ FLOAT InverseScale) PURE;
STDMETHOD_(FLOAT, GetInverseScale)(THIS) PURE;
//------------------------------------------------------------------------------
// Attaches buffers to the context and performs any required precomputation.
// The buffers must be no smaller than the corresponding buffer sizes returned
// by D3DX11CreateFFT*(). Temp buffers may beshared between multiple contexts,
// though care should be taken to concurrently execute multiple FFTs which share
// temp buffers.
//
// NumTempBuffers number of buffers in ppTempBuffers
// ppTempBuffers temp buffers to attach
// NumPrecomputeBuffers number of buffers in ppPrecomputeBufferSizes
// ppPrecomputeBufferSizes buffers to hold precomputed data
STDMETHOD(AttachBuffersAndPrecompute)( THIS_
_In_range_(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBuffers,
_In_reads_(NumTempBuffers) ID3D11UnorderedAccessView* const* ppTempBuffers,
_In_range_(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBuffers,
_In_reads_(NumPrecomputeBuffers) ID3D11UnorderedAccessView* const* ppPrecomputeBufferSizes ) PURE;
//------------------------------------------------------------------------------
// Call after buffers have been attached to the context, pInput and *ppOuput can
// be one of the temp buffers. If *ppOutput == NULL, then the computation will ping-pong
// between temp buffers and the last buffer written to is stored at *ppOutput.
// Otherwise, *ppOutput is used as the output buffer (which may incur an extra copy).
//
// The format of complex data is interleaved components, e.g. (Real0, Imag0),
// (Real1, Imag1) ... etc. Data is stored in row major order
//
// pInputBuffer view onto input buffer
// ppOutpuBuffert pointer to view of output buffer
STDMETHOD(ForwardTransform)( THIS_
_In_ const ID3D11UnorderedAccessView* pInputBuffer,
_Inout_ ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
STDMETHOD(InverseTransform)( THIS_
_In_ const ID3D11UnorderedAccessView* pInputBuffer,
_Inout_ ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DX11FFT Creation Routines
//////////////////////////////////////////////////////////////////////////////
typedef enum D3DX11_FFT_DATA_TYPE
{
D3DX11_FFT_DATA_TYPE_REAL,
D3DX11_FFT_DATA_TYPE_COMPLEX,
} D3DX11_FFT_DATA_TYPE;
typedef enum D3DX11_FFT_DIM_MASK
{
D3DX11_FFT_DIM_MASK_1D = 0x1,
D3DX11_FFT_DIM_MASK_2D = 0x3,
D3DX11_FFT_DIM_MASK_3D = 0x7,
} D3DX11_FFT_DIM_MASK;
typedef struct D3DX11_FFT_DESC
{
UINT NumDimensions; // number of dimensions
UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]; // length of each dimension
UINT DimensionMask; // a bit set for each dimensions to transform
// (see D3DX11_FFT_DIM_MASK for common masks)
D3DX11_FFT_DATA_TYPE Type; // type of the elements in spatial domain
} D3DX11_FFT_DESC;
//------------------------------------------------------------------------------
// NumTempBufferSizes Number of temporary buffers needed
// pTempBufferSizes Minimum sizes (in FLOATs) of temporary buffers
// NumPrecomputeBufferSizes Number of precompute buffers needed
// pPrecomputeBufferSizes minimum sizes (in FLOATs) for precompute buffers
//------------------------------------------------------------------------------
typedef struct D3DX11_FFT_BUFFER_INFO
{
_Field_range_(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes;
UINT TempBufferFloatSizes[D3DX11_FFT_MAX_TEMP_BUFFERS];
_Field_range_(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBufferSizes;
UINT PrecomputeBufferFloatSizes[D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS];
} D3DX11_FFT_BUFFER_INFO;
typedef enum D3DX11_FFT_CREATE_FLAG
{
D3DX11_FFT_CREATE_FLAG_NO_PRECOMPUTE_BUFFERS = 0x01L, // do not precompute values and store into buffers
} D3DX11_FFT_CREATE_FLAG;
//------------------------------------------------------------------------------
// Creates an ID3DX11FFT COM interface object and returns a pointer to it at *ppFFT.
// The descriptor describes the shape of the data as well as the scaling factors
// that should be used for forward and inverse transforms.
// The FFT computation may require temporaries that act as ping-pong buffers
// and for other purposes. aTempSizes is a list of the sizes required for
// temporaries. Likewise, some data may need to be precomputed and the sizes
// of those sizes are returned in aPrecomputedBufferSizes.
//
// To perform a computation, follow these steps:
// 1) Create the FFT context object
// 2) Precompute (and Attach temp working buffers of at least the required size)
// 3) Call Compute() on some input data
//
// Compute() may be called repeatedly with different inputs and transform
// directions. When finished with the FFT work, release the FFT interface()
//
// Device Direct3DDeviceContext to use in
// pDesc Descriptor for FFT transform in
// Count the number of 1D FFTs to perform in
// Flags See D3DX11_FFT_CREATE_FLAG in
// pBufferInfo Pointer to BUFFER_INFO struct, filled by funciton out
// ppFFT Pointer to returned context pointer out
//------------------------------------------------------------------------------
HRESULT WINAPI D3DX11CreateFFT(
ID3D11DeviceContext* pDeviceContext,
_In_ const D3DX11_FFT_DESC* pDesc,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
HRESULT WINAPI D3DX11CreateFFT1DReal(
ID3D11DeviceContext* pDeviceContext,
UINT X,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
HRESULT WINAPI D3DX11CreateFFT1DComplex(
ID3D11DeviceContext* pDeviceContext,
UINT X,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
HRESULT WINAPI D3DX11CreateFFT2DReal(
ID3D11DeviceContext* pDeviceContext,
UINT X,
UINT Y,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
HRESULT WINAPI D3DX11CreateFFT2DComplex(
ID3D11DeviceContext* pDeviceContext,
UINT X,
UINT Y,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
HRESULT WINAPI D3DX11CreateFFT3DReal(
ID3D11DeviceContext* pDeviceContext,
UINT X,
UINT Y,
UINT Z,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
HRESULT WINAPI D3DX11CreateFFT3DComplex(
ID3D11DeviceContext* pDeviceContext,
UINT X,
UINT Y,
UINT Z,
UINT Flags,
_Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
_Out_ ID3DX11FFT** ppFFT
);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX11GPGPU_H__
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/

View File

@ -0,0 +1,72 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10.h
// Content: D3DX10 utility library
//
//////////////////////////////////////////////////////////////////////////////
#ifdef __D3DX10_INTERNAL__
#error Incorrect D3DX10 header used
#endif
#ifndef __D3DX10_H__
#define __D3DX10_H__
// Defines
#include <limits.h>
#include <float.h>
#define D3DX10_DEFAULT ((UINT) -1)
#define D3DX10_FROM_FILE ((UINT) -3)
#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
#ifndef D3DX10INLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DX10INLINE __forceinline
#else
#define D3DX10INLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DX10INLINE inline
#else
#define D3DX10INLINE
#endif
#endif
#endif
// Includes
#include "d3d10.h"
#include "d3dx10.h"
#include "d3dx10math.h"
#include "d3dx10core.h"
#include "d3dx10tex.h"
#include "d3dx10mesh.h"
#include "d3dx10async.h"
// Errors
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
enum _D3DX10_ERR {
D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
};
#endif //__D3DX10_H__

View File

@ -0,0 +1,290 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DX10Async.h
// Content: D3DX10 Asynchronous Effect / Shader loaders / compilers
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3DX10ASYNC_H__
#define __D3DX10ASYNC_H__
#include "d3dx10.h"
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DX10Compile:
// ------------------
// 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.
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX10CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CompileFromFile D3DX10CompileFromFileW
#else
#define D3DX10CompileFromFile D3DX10CompileFromFileA
#endif
HRESULT WINAPI D3DX10CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX10CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CompileFromResource D3DX10CompileFromResourceW
#else
#define D3DX10CompileFromResource D3DX10CompileFromResourceA
#endif
HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
//----------------------------------------------------------------------------
// D3DX10CreateEffectFromXXXX:
// --------------------------
// Creates an effect from a binary effect or file
//
// Parameters:
//
// [in]
//
//
// pFileName
// Name of the ASCII (uncompiled) or binary (compiled) Effect file to load
//
// hModule
// Handle to the module containing the resource to compile from
// pResourceName
// Name of the resource within hModule to compile from
//
// pData
// Blob of effect data, either ASCII (uncompiled) or binary (compiled)
// DataLength
// Length of the data blob
//
// 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.
// pProfile
// Profile to use when compiling the effect.
// HLSLFlags
// Compilation flags pertaining to shaders and data types, honored by
// the HLSL compiler
// FXFlags
// Compilation flags pertaining to Effect compilation, honored
// by the Effect compiler
// pDevice
// Pointer to the D3D10 device on which to create Effect resources
// pEffectPool
// Pointer to an Effect pool to share variables with or NULL
//
// [out]
//
// ppEffect
// Address of the newly created Effect interface
// ppEffectPool
// Address of the newly created Effect pool interface
// ppErrors
// If non-NULL, address of a buffer with error messages that occurred
// during parsing or compilation
// 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.
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW
#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW
#else
#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA
#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA
#endif
HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW
#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW
#else
#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA
#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA
#endif
HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW
#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW
#else
#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA
#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA
#endif
//----------------------------------------------------------------------------
// Async processors
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
//----------------------------------------------------------------------------
// D3DX10 Asynchronous texture I/O (advanced mode)
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
#ifdef UNICODE
#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW
#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW
#else
#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA
#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA
#endif
HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor);
HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX10ASYNC_H__

View File

@ -0,0 +1,444 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10core.h
// Content: D3DX10 core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx10.h"
#ifndef __D3DX10CORE_H__
#define __D3DX10CORE_H__
// Current name of the DLL shipped in the same SDK as this header.
#define D3DX10_DLL_W L"d3dx10_43.dll"
#define D3DX10_DLL_A "d3dx10_43.dll"
#ifdef UNICODE
#define D3DX10_DLL D3DX10_DLL_W
#else
#define D3DX10_DLL D3DX10_DLL_A
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3DX10_SDK_VERSION:
// -----------------
// This identifier is passed to D3DX10CheckVersion 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,
// D3DX10CreateVersion will return FALSE. (The number itself has no meaning.)
///////////////////////////////////////////////////////////////////////////
#define D3DX10_SDK_VERSION 43
///////////////////////////////////////////////////////////////////////////
// D3DX10CreateDevice
// D3DX10CreateDeviceAndSwapChain
// D3DX10GetFeatureLevel1
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
ID3D10Device **ppDevice);
HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
IDXGISwapChain **ppSwapChain,
ID3D10Device **ppDevice);
typedef interface ID3D10Device1 ID3D10Device1;
HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1);
#ifdef D3D_DIAG_DLL
BOOL WINAPI D3DX10DebugMute(BOOL Mute);
#endif
HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// D3DX10_SPRITE flags:
// -----------------
// D3DX10_SPRITE_SAVE_STATE
// Specifies device state should be saved and restored in Begin/End.
// D3DX10SPRITE_SORT_TEXTURE
// Sprites are sorted by texture prior to drawing. This is recommended when
// drawing non-overlapping sprites of uniform depth. For example, drawing
// screen-aligned text with ID3DX10Font.
// D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK
// Sprites are sorted by depth front-to-back prior to drawing. This is
// recommended when drawing opaque sprites of varying depths.
// D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT
// Sprites are sorted by depth back-to-front prior to drawing. This is
// recommended when drawing transparent sprites of varying depths.
// D3DX10SPRITE_ADDREF_TEXTURES
// AddRef/Release all textures passed in to DrawSpritesBuffered
//////////////////////////////////////////////////////////////////////////////
typedef enum _D3DX10_SPRITE_FLAG
{
D3DX10_SPRITE_SORT_TEXTURE = 0x01,
D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02,
D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04,
D3DX10_SPRITE_SAVE_STATE = 0x08,
D3DX10_SPRITE_ADDREF_TEXTURES = 0x10,
} D3DX10_SPRITE_FLAG;
typedef struct _D3DX10_SPRITE
{
D3DXMATRIX matWorld;
D3DXVECTOR2 TexCoord;
D3DXVECTOR2 TexSize;
D3DXCOLOR ColorModulate;
ID3D10ShaderResourceView *pTexture;
UINT TextureIndex;
} D3DX10_SPRITE;
//////////////////////////////////////////////////////////////////////////////
// ID3DX10Sprite:
// ------------
// This object intends to provide an easy way to drawing sprites using D3D.
//
// Begin -
// Prepares device for drawing sprites.
//
// Draw -
// Draws a sprite
//
// Flush -
// Forces all batched sprites to submitted to the device.
//
// End -
// Restores device state to how it was when Begin was called.
//
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DX10Sprite ID3DX10Sprite;
typedef interface ID3DX10Sprite *LPD3DX10SPRITE;
// {BA0B762D-8D28-43ec-B9DC-2F84443B0614}
DEFINE_GUID(IID_ID3DX10Sprite,
0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
#undef INTERFACE
#define INTERFACE ID3DX10Sprite
DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10Sprite
STDMETHOD(Begin)(THIS_ UINT flags) PURE;
STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE;
STDMETHOD(Flush)(THIS) PURE;
STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateSprite(
ID3D10Device* pDevice,
UINT cDeviceBufferSize,
LPD3DX10SPRITE* ppSprite);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// ID3DX10ThreadPump:
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DX10DataLoader
DECLARE_INTERFACE(ID3DX10DataLoader)
{
STDMETHOD(Load)(THIS) PURE;
STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
STDMETHOD(Destroy)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DX10DataProcessor
DECLARE_INTERFACE(ID3DX10DataProcessor)
{
STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
STDMETHOD(Destroy)(THIS) PURE;
};
// {C93FECFA-6967-478a-ABBC-402D90621FCB}
DEFINE_GUID(IID_ID3DX10ThreadPump,
0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
#undef INTERFACE
#define INTERFACE ID3DX10ThreadPump
DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10ThreadPump
STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
STDMETHOD(WaitForAllItems)(THIS) PURE;
STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
STDMETHOD(PurgeAllItems)(THIS) PURE;
STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
};
HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump);
//////////////////////////////////////////////////////////////////////////////
// ID3DX10Font:
// ----------
// Font objects contain the textures and resources needed to render a specific
// font on a specific device.
//
// GetGlyphData -
// Returns glyph cache data, for a given glyph.
//
// PreloadCharacters/PreloadGlyphs/PreloadText -
// Preloads glyphs into the glyph cache textures.
//
// DrawText -
// Draws formatted text on a D3D device. Some parameters are
// surprisingly similar to those of GDI's DrawText function. See GDI
// documentation for a detailed description of these parameters.
// If pSprite is NULL, an internal sprite object will be used.
//
//////////////////////////////////////////////////////////////////////////////
typedef struct _D3DX10_FONT_DESCA
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
CHAR FaceName[LF_FACESIZE];
} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA;
typedef struct _D3DX10_FONT_DESCW
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
WCHAR FaceName[LF_FACESIZE];
} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW;
#ifdef UNICODE
typedef D3DX10_FONT_DESCW D3DX10_FONT_DESC;
typedef LPD3DX10_FONT_DESCW LPD3DX10_FONT_DESC;
#else
typedef D3DX10_FONT_DESCA D3DX10_FONT_DESC;
typedef LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC;
#endif
typedef interface ID3DX10Font ID3DX10Font;
typedef interface ID3DX10Font *LPD3DX10FONT;
// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
DEFINE_GUID(IID_ID3DX10Font,
0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
#undef INTERFACE
#define INTERFACE ID3DX10Font
DECLARE_INTERFACE_(ID3DX10Font, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10Font
STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE;
STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE;
STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
STDMETHOD_(HDC, GetDC)(THIS) PURE;
STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
#ifdef __cplusplus
#ifdef UNICODE
HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); }
HRESULT WINAPI_INLINE PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
#else
HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); }
HRESULT WINAPI_INLINE PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
#endif
#endif //__cplusplus
};
#ifndef GetTextMetrics
#ifdef UNICODE
#define GetTextMetrics GetTextMetricsW
#else
#define GetTextMetrics GetTextMetricsA
#endif
#endif
#ifndef DrawText
#ifdef UNICODE
#define DrawText DrawTextW
#else
#define DrawText DrawTextA
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateFontA(
ID3D10Device* pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
UINT CharSet,
UINT OutputPrecision,
UINT Quality,
UINT PitchAndFamily,
LPCSTR pFaceName,
LPD3DX10FONT* ppFont);
HRESULT WINAPI
D3DX10CreateFontW(
ID3D10Device* pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
UINT CharSet,
UINT OutputPrecision,
UINT Quality,
UINT PitchAndFamily,
LPCWSTR pFaceName,
LPD3DX10FONT* ppFont);
#ifdef UNICODE
#define D3DX10CreateFont D3DX10CreateFontW
#else
#define D3DX10CreateFont D3DX10CreateFontA
#endif
HRESULT WINAPI
D3DX10CreateFontIndirectA(
ID3D10Device* pDevice,
CONST D3DX10_FONT_DESCA* pDesc,
LPD3DX10FONT* ppFont);
HRESULT WINAPI
D3DX10CreateFontIndirectW(
ID3D10Device* pDevice,
CONST D3DX10_FONT_DESCW* pDesc,
LPD3DX10FONT* ppFont);
#ifdef UNICODE
#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW
#else
#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA
#endif
HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
#define _FACD3D 0x876
#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
#endif //__D3DX10CORE_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,286 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10mesh.h
// Content: D3DX10 mesh types and functions
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx10.h"
#ifndef __D3DX10MESH_H__
#define __D3DX10MESH_H__
// {7ED943DD-52E8-40b5-A8D8-76685C406330}
DEFINE_GUID(IID_ID3DX10BaseMesh,
0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
// {04B0D117-1041-46b1-AA8A-3952848BA22E}
DEFINE_GUID(IID_ID3DX10MeshBuffer,
0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e);
// {4020E5C2-1403-4929-883F-E2E849FAC195}
DEFINE_GUID(IID_ID3DX10Mesh,
0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
// {8875769A-D579-4088-AAEB-534D1AD84E96}
DEFINE_GUID(IID_ID3DX10PMesh,
0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96);
// {667EA4C7-F1CD-4386-B523-7C0290B83CC5}
DEFINE_GUID(IID_ID3DX10SPMesh,
0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5);
// {3CE6CC22-DBF2-44f4-894D-F9C34A337139}
DEFINE_GUID(IID_ID3DX10PatchMesh,
0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39);
// Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags
enum _D3DX10_MESH {
D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input.
};
typedef struct _D3DX10_ATTRIBUTE_RANGE
{
UINT AttribId;
UINT FaceStart;
UINT FaceCount;
UINT VertexStart;
UINT VertexCount;
} D3DX10_ATTRIBUTE_RANGE;
typedef D3DX10_ATTRIBUTE_RANGE* LPD3DX10_ATTRIBUTE_RANGE;
typedef enum _D3DX10_MESH_DISCARD_FLAGS
{
D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01,
D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02,
D3DX10_MESH_DISCARD_POINTREPS = 0x04,
D3DX10_MESH_DISCARD_ADJACENCY = 0x08,
D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10,
} D3DX10_MESH_DISCARD_FLAGS;
typedef struct _D3DX10_WELD_EPSILONS
{
FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency
// in general, it should be the same value or greater than the one passed to GeneratedAdjacency
FLOAT BlendWeights;
FLOAT Normal;
FLOAT PSize;
FLOAT Specular;
FLOAT Diffuse;
FLOAT Texcoord[8];
FLOAT Tangent;
FLOAT Binormal;
FLOAT TessFactor;
} D3DX10_WELD_EPSILONS;
typedef D3DX10_WELD_EPSILONS* LPD3DX10_WELD_EPSILONS;
typedef struct _D3DX10_INTERSECT_INFO
{
UINT FaceIndex; // index of face intersected
FLOAT U; // Barycentric Hit Coordinates
FLOAT V; // Barycentric Hit Coordinates
FLOAT Dist; // Ray-Intersection Parameter Distance
} D3DX10_INTERSECT_INFO, *LPD3DX10_INTERSECT_INFO;
// ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers
#undef INTERFACE
#define INTERFACE ID3DX10MeshBuffer
DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10MeshBuffer
STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE;
STDMETHOD(Unmap)(THIS) PURE;
STDMETHOD_(SIZE_T, GetSize)(THIS) PURE;
};
// D3DX10 Mesh interfaces
#undef INTERFACE
#define INTERFACE ID3DX10Mesh
DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10Mesh
STDMETHOD_(UINT, GetFaceCount)(THIS) PURE;
STDMETHOD_(UINT, GetVertexCount)(THIS) PURE;
STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE;
STDMETHOD_(UINT, GetFlags)(THIS) PURE;
STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE;
STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE;
STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE;
STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE;
STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE;
STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE;
STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE;
STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE;
STDMETHOD(GenerateGSAdjacency)(THIS) PURE;
STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE;
STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE;
STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE;
STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE;
STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE;
STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE;
STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE;
STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE;
STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
// ID3DX10Mesh - Device functions
STDMETHOD(CommitToDevice)(THIS) PURE;
STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE;
STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE;
STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE;
STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE;
};
// Flat API
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateMesh(
ID3D10Device *pDevice,
CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration,
UINT DeclCount,
LPCSTR pPositionSemantic,
UINT VertexCount,
UINT FaceCount,
UINT Options,
ID3DX10Mesh **ppMesh);
#ifdef __cplusplus
}
#endif //__cplusplus
// ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags
enum _D3DX10_MESHOPT {
D3DX10_MESHOPT_COMPACT = 0x01000000,
D3DX10_MESHOPT_ATTR_SORT = 0x02000000,
D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000,
D3DX10_MESHOPT_STRIP_REORDER = 0x08000000,
D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices
D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting
D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards
// D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead
};
//////////////////////////////////////////////////////////////////////////
// ID3DXSkinInfo
//////////////////////////////////////////////////////////////////////////
// {420BD604-1C76-4a34-A466-E45D0658A32C}
DEFINE_GUID(IID_ID3DX10SkinInfo,
0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c);
// scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh()
#define D3DX10_SKININFO_NO_SCALING 0
#define D3DX10_SKININFO_SCALE_TO_1 1
#define D3DX10_SKININFO_SCALE_TO_TOTAL 2
typedef struct _D3DX10_SKINNING_CHANNEL
{
UINT SrcOffset;
UINT DestOffset;
BOOL IsNormal;
} D3DX10_SKINNING_CHANNEL;
#undef INTERFACE
#define INTERFACE ID3DX10SkinInfo
typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO;
DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD_(UINT , GetNumVertices)(THIS) PURE;
STDMETHOD_(UINT , GetNumBones)(THIS) PURE;
STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE;
STDMETHOD(AddVertices)(THIS_ UINT Count) PURE;
STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE;
STDMETHOD(AddBones)(THIS_ UINT Count) PURE;
STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE;
STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE;
STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE;
STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE;
STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE;
STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE;
STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE;
STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE;
STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE;
STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE;
STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateSkinInfo(LPD3DX10SKININFO* ppSkinInfo);
#ifdef __cplusplus
}
#endif //__cplusplus
typedef struct _D3DX10_ATTRIBUTE_WEIGHTS
{
FLOAT Position;
FLOAT Boundary;
FLOAT Normal;
FLOAT Diffuse;
FLOAT Specular;
FLOAT Texcoord[8];
FLOAT Tangent;
FLOAT Binormal;
} D3DX10_ATTRIBUTE_WEIGHTS, *LPD3DX10_ATTRIBUTE_WEIGHTS;
#endif //__D3DX10MESH_H__

View File

@ -0,0 +1,766 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10tex.h
// Content: D3DX10 texturing APIs
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx10.h"
#ifndef __D3DX10TEX_H__
#define __D3DX10TEX_H__
//----------------------------------------------------------------------------
// D3DX10_FILTER flags:
// ------------------
//
// A valid filter must contain one of these values:
//
// D3DX10_FILTER_NONE
// No scaling or filtering will take place. Pixels outside the bounds
// of the source image are assumed to be transparent black.
// D3DX10_FILTER_POINT
// Each destination pixel is computed by sampling the nearest pixel
// from the source image.
// D3DX10_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.
// D3DX10_FILTER_TRIANGLE
// Every pixel in the source image contributes equally to the
// destination image. This is the slowest of all the filters.
// D3DX10_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:
//
// D3DX10_FILTER_MIRROR_U
// Indicates that pixels off the edge of the texture on the U-axis
// should be mirrored, not wraped.
// D3DX10_FILTER_MIRROR_V
// Indicates that pixels off the edge of the texture on the V-axis
// should be mirrored, not wraped.
// D3DX10_FILTER_MIRROR_W
// Indicates that pixels off the edge of the texture on the W-axis
// should be mirrored, not wraped.
// D3DX10_FILTER_MIRROR
// Same as specifying D3DX10_FILTER_MIRROR_U | D3DX10_FILTER_MIRROR_V |
// D3DX10_FILTER_MIRROR_V
// D3DX10_FILTER_DITHER
// Dithers the resulting image using a 4x4 order dither pattern.
// D3DX10_FILTER_SRGB_IN
// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
// D3DX10_FILTER_SRGB_OUT
// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
// D3DX10_FILTER_SRGB
// Same as specifying D3DX10_FILTER_SRGB_IN | D3DX10_FILTER_SRGB_OUT
//
//----------------------------------------------------------------------------
typedef enum D3DX10_FILTER_FLAG
{
D3DX10_FILTER_NONE = (1 << 0),
D3DX10_FILTER_POINT = (2 << 0),
D3DX10_FILTER_LINEAR = (3 << 0),
D3DX10_FILTER_TRIANGLE = (4 << 0),
D3DX10_FILTER_BOX = (5 << 0),
D3DX10_FILTER_MIRROR_U = (1 << 16),
D3DX10_FILTER_MIRROR_V = (2 << 16),
D3DX10_FILTER_MIRROR_W = (4 << 16),
D3DX10_FILTER_MIRROR = (7 << 16),
D3DX10_FILTER_DITHER = (1 << 19),
D3DX10_FILTER_DITHER_DIFFUSION= (2 << 19),
D3DX10_FILTER_SRGB_IN = (1 << 21),
D3DX10_FILTER_SRGB_OUT = (2 << 21),
D3DX10_FILTER_SRGB = (3 << 21),
} D3DX10_FILTER_FLAG;
//----------------------------------------------------------------------------
// D3DX10_NORMALMAP flags:
// ---------------------
// These flags are used to control how D3DX10ComputeNormalMap generates normal
// maps. Any number of these flags may be OR'd together in any combination.
//
// D3DX10_NORMALMAP_MIRROR_U
// Indicates that pixels off the edge of the texture on the U-axis
// should be mirrored, not wraped.
// D3DX10_NORMALMAP_MIRROR_V
// Indicates that pixels off the edge of the texture on the V-axis
// should be mirrored, not wraped.
// D3DX10_NORMALMAP_MIRROR
// Same as specifying D3DX10_NORMALMAP_MIRROR_U | D3DX10_NORMALMAP_MIRROR_V
// D3DX10_NORMALMAP_INVERTSIGN
// Inverts the direction of each normal
// D3DX10_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.
//
//----------------------------------------------------------------------------
typedef enum D3DX10_NORMALMAP_FLAG
{
D3DX10_NORMALMAP_MIRROR_U = (1 << 16),
D3DX10_NORMALMAP_MIRROR_V = (2 << 16),
D3DX10_NORMALMAP_MIRROR = (3 << 16),
D3DX10_NORMALMAP_INVERTSIGN = (8 << 16),
D3DX10_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
} D3DX10_NORMALMAP_FLAG;
//----------------------------------------------------------------------------
// D3DX10_CHANNEL flags:
// -------------------
// These flags are used by functions which operate on or more channels
// in a texture.
//
// D3DX10_CHANNEL_RED
// Indicates the red channel should be used
// D3DX10_CHANNEL_BLUE
// Indicates the blue channel should be used
// D3DX10_CHANNEL_GREEN
// Indicates the green channel should be used
// D3DX10_CHANNEL_ALPHA
// Indicates the alpha channel should be used
// D3DX10_CHANNEL_LUMINANCE
// Indicates the luminaces of the red green and blue channels should be
// used.
//
//----------------------------------------------------------------------------
typedef enum D3DX10_CHANNEL_FLAG
{
D3DX10_CHANNEL_RED = (1 << 0),
D3DX10_CHANNEL_BLUE = (1 << 1),
D3DX10_CHANNEL_GREEN = (1 << 2),
D3DX10_CHANNEL_ALPHA = (1 << 3),
D3DX10_CHANNEL_LUMINANCE = (1 << 4),
} D3DX10_CHANNEL_FLAG;
//----------------------------------------------------------------------------
// D3DX10_IMAGE_FILE_FORMAT:
// ---------------------
// This enum is used to describe supported image file formats.
//
//----------------------------------------------------------------------------
typedef enum D3DX10_IMAGE_FILE_FORMAT
{
D3DX10_IFF_BMP = 0,
D3DX10_IFF_JPG = 1,
D3DX10_IFF_PNG = 3,
D3DX10_IFF_DDS = 4,
D3DX10_IFF_TIFF = 10,
D3DX10_IFF_GIF = 11,
D3DX10_IFF_WMP = 12,
D3DX10_IFF_FORCE_DWORD = 0x7fffffff
} D3DX10_IMAGE_FILE_FORMAT;
//----------------------------------------------------------------------------
// D3DX10_SAVE_TEXTURE_FLAG:
// ---------------------
// This enum is used to support texture saving options.
//
//----------------------------------------------------------------------------
typedef enum D3DX10_SAVE_TEXTURE_FLAG
{
D3DX10_STF_USEINPUTBLOB = 0x0001,
} D3DX10_SAVE_TEXTURE_FLAG;
//----------------------------------------------------------------------------
// D3DX10_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
// D3D10_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
// D3D10_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
// ImageFileFormat
// D3DX10_IMAGE_FILE_FORMAT representing the format of the image file.
//----------------------------------------------------------------------------
typedef struct D3DX10_IMAGE_INFO
{
UINT Width;
UINT Height;
UINT Depth;
UINT ArraySize;
UINT MipLevels;
UINT MiscFlags;
DXGI_FORMAT Format;
D3D10_RESOURCE_DIMENSION ResourceDimension;
D3DX10_IMAGE_FILE_FORMAT ImageFileFormat;
} D3DX10_IMAGE_INFO;
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// Image File APIs ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// D3DX10_IMAGE_LOAD_INFO:
// ---------------
// This structure can be optionally passed in to texture loader APIs to
// control how textures get loaded. Pass in D3DX10_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
// D3D10_USAGE flag for the new texture
// BindFlags
// D3D10 Bind flags for the new texture
// CpuAccessFlags
// D3D10 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 D3DX10_IMAGE_INFO structure that will get
// populated with source image information
//----------------------------------------------------------------------------
typedef struct D3DX10_IMAGE_LOAD_INFO
{
UINT Width;
UINT Height;
UINT Depth;
UINT FirstMipLevel;
UINT MipLevels;
D3D10_USAGE Usage;
UINT BindFlags;
UINT CpuAccessFlags;
UINT MiscFlags;
DXGI_FORMAT Format;
UINT Filter;
UINT MipFilter;
D3DX10_IMAGE_INFO* pSrcInfo;
#ifdef __cplusplus
D3DX10_IMAGE_LOAD_INFO()
{
Width = D3DX10_DEFAULT;
Height = D3DX10_DEFAULT;
Depth = D3DX10_DEFAULT;
FirstMipLevel = D3DX10_DEFAULT;
MipLevels = D3DX10_DEFAULT;
Usage = (D3D10_USAGE) D3DX10_DEFAULT;
BindFlags = D3DX10_DEFAULT;
CpuAccessFlags = D3DX10_DEFAULT;
MiscFlags = D3DX10_DEFAULT;
Format = DXGI_FORMAT_FROM_FILE;
Filter = D3DX10_DEFAULT;
MipFilter = D3DX10_DEFAULT;
pSrcInfo = NULL;
}
#endif
} D3DX10_IMAGE_LOAD_INFO;
//-------------------------------------------------------------------------------
// GetImageInfoFromFile/Resource/Memory:
// ------------------------------
// Fills in a D3DX10_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 D3DX10_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.
//-------------------------------------------------------------------------------
HRESULT WINAPI
D3DX10GetImageInfoFromFileA(
LPCSTR pSrcFile,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10GetImageInfoFromFileW(
LPCWSTR pSrcFile,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileW
#else
#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileA
#endif
HRESULT WINAPI
D3DX10GetImageInfoFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10GetImageInfoFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceW
#else
#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceA
#endif
HRESULT WINAPI
D3DX10GetImageInfoFromMemory(
LPCVOID pSrcData,
SIZE_T SrcDataSize,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
//////////////////////////////////////////////////////////////////////////////
// Create/Save Texture APIs //////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// D3DX10CreateTextureFromFile/Resource/Memory:
// D3DX10CreateShaderResourceViewFromFile/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 D3DX10_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
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromFileA(
ID3D10Device* pDevice,
LPCSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromFileW(
ID3D10Device* pDevice,
LPCWSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileW
#else
#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileA
#endif
HRESULT WINAPI
D3DX10CreateTextureFromFileA(
ID3D10Device* pDevice,
LPCSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10CreateTextureFromFileW(
ID3D10Device* pDevice,
LPCWSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileW
#else
#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileA
#endif
// FromResource (resources in dll/exes)
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromResourceA(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromResourceW(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceW
#else
#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceA
#endif
HRESULT WINAPI
D3DX10CreateTextureFromResourceA(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10CreateTextureFromResourceW(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceW
#else
#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceA
#endif
// FromFileInMemory
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromMemory(
ID3D10Device* pDevice,
LPCVOID pSrcData,
SIZE_T SrcDataSize,
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
HRESULT WINAPI
D3DX10CreateTextureFromMemory(
ID3D10Device* pDevice,
LPCVOID pSrcData,
SIZE_T SrcDataSize,
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture,
HRESULT* pHResult);
//////////////////////////////////////////////////////////////////////////////
// Misc Texture APIs /////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// D3DX10_TEXTURE_LOAD_INFO:
// ------------------------
//
//----------------------------------------------------------------------------
typedef struct _D3DX10_TEXTURE_LOAD_INFO
{
D3D10_BOX *pSrcBox;
D3D10_BOX *pDstBox;
UINT SrcFirstMip;
UINT DstFirstMip;
UINT NumMips;
UINT SrcFirstElement;
UINT DstFirstElement;
UINT NumElements;
UINT Filter;
UINT MipFilter;
#ifdef __cplusplus
_D3DX10_TEXTURE_LOAD_INFO()
{
pSrcBox = NULL;
pDstBox = NULL;
SrcFirstMip = 0;
DstFirstMip = 0;
NumMips = D3DX10_DEFAULT;
SrcFirstElement = 0;
DstFirstElement = 0;
NumElements = D3DX10_DEFAULT;
Filter = D3DX10_DEFAULT;
MipFilter = D3DX10_DEFAULT;
}
#endif
} D3DX10_TEXTURE_LOAD_INFO;
//----------------------------------------------------------------------------
// D3DX10LoadTextureFromTexture:
// ----------------------------
// Load a texture from a texture.
//
// Parameters:
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10LoadTextureFromTexture(
ID3D10Resource *pSrcTexture,
D3DX10_TEXTURE_LOAD_INFO *pLoadInfo,
ID3D10Resource *pDstTexture);
//----------------------------------------------------------------------------
// D3DX10FilterTexture:
// ------------------
// 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
// D3DX10_FILTER flags controlling how each miplevel is filtered.
// Or D3DX10_DEFAULT for D3DX10_FILTER_BOX,
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10FilterTexture(
ID3D10Resource *pTexture,
UINT SrcLevel,
UINT MipFilter);
//----------------------------------------------------------------------------
// D3DX10SaveTextureToFile:
// ----------------------
// Save a texture to a file.
//
// Parameters:
// pDestFile
// File name of the destination file
// DestFormat
// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
// pSrcTexture
// Source texture, containing the image to be saved
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10SaveTextureToFileA(
ID3D10Resource *pSrcTexture,
D3DX10_IMAGE_FILE_FORMAT DestFormat,
LPCSTR pDestFile);
HRESULT WINAPI
D3DX10SaveTextureToFileW(
ID3D10Resource *pSrcTexture,
D3DX10_IMAGE_FILE_FORMAT DestFormat,
LPCWSTR pDestFile);
#ifdef UNICODE
#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileW
#else
#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileA
#endif
//----------------------------------------------------------------------------
// D3DX10SaveTextureToMemory:
// ----------------------
// Save a texture to a blob.
//
// Parameters:
// pSrcTexture
// Source texture, containing the image to be saved
// DestFormat
// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
// ppDestBuf
// address of a d3dxbuffer pointer to return the image data
// Flags
// optional flags
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10SaveTextureToMemory(
ID3D10Resource* pSrcTexture,
D3DX10_IMAGE_FILE_FORMAT DestFormat,
LPD3D10BLOB* ppDestBuf,
UINT Flags);
//----------------------------------------------------------------------------
// D3DX10ComputeNormalMap:
// ---------------------
// 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
// D3DX10_NORMALMAP flags
// Channel
// D3DX10_CHANNEL specifying source of height information
// Amplitude
// The constant value which the height information is multiplied by.
// pDestTexture
// Pointer to the destination texture
//---------------------------------------------------------------------------
HRESULT WINAPI
D3DX10ComputeNormalMap(
ID3D10Texture2D *pSrcTexture,
UINT Flags,
UINT Channel,
FLOAT Amplitude,
ID3D10Texture2D *pDestTexture);
//----------------------------------------------------------------------------
// D3DX10SHProjectCubeMap:
// ----------------------
// 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
//
//---------------------------------------------------------------------------
HRESULT WINAPI
D3DX10SHProjectCubeMap(
__in_range(2,6) UINT Order,
ID3D10Texture2D *pCubeMap,
__out_ecount(Order*Order) FLOAT *pROut,
__out_ecount_opt(Order*Order) FLOAT *pGOut,
__out_ecount_opt(Order*Order) FLOAT *pBOut);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX10TEX_H__

View File

@ -0,0 +1,74 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx11.h
// Content: D3DX11 utility library
//
//////////////////////////////////////////////////////////////////////////////
#ifdef __D3DX11_INTERNAL__
#error Incorrect D3DX11 header used
#endif
#ifndef __D3DX11_H__
#define __D3DX11_H__
// Defines
#include <limits.h>
#include <float.h>
#ifdef ALLOW_THROWING_NEW
#include <new>
#endif
#define D3DX11_DEFAULT ((UINT) -1)
#define D3DX11_FROM_FILE ((UINT) -3)
#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
#ifndef D3DX11INLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DX11INLINE __forceinline
#else
#define D3DX11INLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DX11INLINE inline
#else
#define D3DX11INLINE
#endif
#endif
#endif
// Includes
#include "d3d11.h"
#include "d3dx11.h"
#include "d3dx11core.h"
#include "d3dx11tex.h"
#include "d3dx11async.h"
// Errors
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
enum _D3DX11_ERR {
D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
};
#endif //__D3DX11_H__

View File

@ -0,0 +1,164 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DX11Async.h
// Content: D3DX11 Asynchronous Shader loaders / compilers
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3DX11ASYNC_H__
#define __D3DX11ASYNC_H__
#include "d3dx11.h"
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// 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.
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11CompileFromFile D3DX11CompileFromFileW
#else
#define D3DX11CompileFromFile D3DX11CompileFromFileA
#endif
HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11CompileFromResource D3DX11CompileFromResourceW
#else
#define D3DX11CompileFromResource D3DX11CompileFromResourceA
#endif
HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW
#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW
#else
#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA
#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA
#endif
//----------------------------------------------------------------------------
// Async processors
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
//----------------------------------------------------------------------------
// D3DX11 Asynchronous texture I/O (advanced mode)
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader);
HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader);
HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader);
HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
#ifdef UNICODE
#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW
#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW
#else
#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA
#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA
#endif
HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor);
HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX11ASYNC_H__

View File

@ -0,0 +1,128 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx11core.h
// Content: D3DX11 core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx11.h"
#ifndef __D3DX11CORE_H__
#define __D3DX11CORE_H__
// Current name of the DLL shipped in the same SDK as this header.
#define D3DX11_DLL_W L"d3dx11_43.dll"
#define D3DX11_DLL_A "d3dx11_43.dll"
#ifdef UNICODE
#define D3DX11_DLL D3DX11_DLL_W
#else
#define D3DX11_DLL D3DX11_DLL_A
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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.)
///////////////////////////////////////////////////////////////////////////
#define D3DX11_SDK_VERSION 43
#ifdef D3D_DIAG_DLL
BOOL WINAPI D3DX11DebugMute(BOOL Mute);
#endif
HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// ID3DX11ThreadPump:
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DX11DataLoader
DECLARE_INTERFACE(ID3DX11DataLoader)
{
STDMETHOD(Load)(THIS) PURE;
STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
STDMETHOD(Destroy)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DX11DataProcessor
DECLARE_INTERFACE(ID3DX11DataProcessor)
{
STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
STDMETHOD(Destroy)(THIS) PURE;
};
// {C93FECFA-6967-478a-ABBC-402D90621FCB}
DEFINE_GUID(IID_ID3DX11ThreadPump,
0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
#undef INTERFACE
#define INTERFACE ID3DX11ThreadPump
DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX11ThreadPump
STDMETHOD(AddWorkItem)(THIS_ ID3DX11DataLoader *pDataLoader, ID3DX11DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
STDMETHOD(WaitForAllItems)(THIS) PURE;
STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
STDMETHOD(PurgeAllItems)(THIS) PURE;
STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump);
HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
#define _FACD3D 0x876
#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
#endif //__D3DX11CORE_H__

View File

@ -0,0 +1,772 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx11tex.h
// Content: D3DX11 texturing APIs
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx11.h"
#ifndef __D3DX11TEX_H__
#define __D3DX11TEX_H__
//----------------------------------------------------------------------------
// 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
//
//----------------------------------------------------------------------------
typedef enum D3DX11_FILTER_FLAG
{
D3DX11_FILTER_NONE = (1 << 0),
D3DX11_FILTER_POINT = (2 << 0),
D3DX11_FILTER_LINEAR = (3 << 0),
D3DX11_FILTER_TRIANGLE = (4 << 0),
D3DX11_FILTER_BOX = (5 << 0),
D3DX11_FILTER_MIRROR_U = (1 << 16),
D3DX11_FILTER_MIRROR_V = (2 << 16),
D3DX11_FILTER_MIRROR_W = (4 << 16),
D3DX11_FILTER_MIRROR = (7 << 16),
D3DX11_FILTER_DITHER = (1 << 19),
D3DX11_FILTER_DITHER_DIFFUSION= (2 << 19),
D3DX11_FILTER_SRGB_IN = (1 << 21),
D3DX11_FILTER_SRGB_OUT = (2 << 21),
D3DX11_FILTER_SRGB = (3 << 21),
} D3DX11_FILTER_FLAG;
//----------------------------------------------------------------------------
// 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.
//
//----------------------------------------------------------------------------
typedef enum D3DX11_NORMALMAP_FLAG
{
D3DX11_NORMALMAP_MIRROR_U = (1 << 16),
D3DX11_NORMALMAP_MIRROR_V = (2 << 16),
D3DX11_NORMALMAP_MIRROR = (3 << 16),
D3DX11_NORMALMAP_INVERTSIGN = (8 << 16),
D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
} D3DX11_NORMALMAP_FLAG;
//----------------------------------------------------------------------------
// 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.
//
//----------------------------------------------------------------------------
typedef enum D3DX11_CHANNEL_FLAG
{
D3DX11_CHANNEL_RED = (1 << 0),
D3DX11_CHANNEL_BLUE = (1 << 1),
D3DX11_CHANNEL_GREEN = (1 << 2),
D3DX11_CHANNEL_ALPHA = (1 << 3),
D3DX11_CHANNEL_LUMINANCE = (1 << 4),
} D3DX11_CHANNEL_FLAG;
//----------------------------------------------------------------------------
// D3DX11_IMAGE_FILE_FORMAT:
// ---------------------
// This enum is used to describe supported image file formats.
//
//----------------------------------------------------------------------------
typedef enum 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 = 0x7fffffff
} D3DX11_IMAGE_FILE_FORMAT;
//----------------------------------------------------------------------------
// D3DX11_SAVE_TEXTURE_FLAG:
// ---------------------
// This enum is used to support texture saving options.
//
//----------------------------------------------------------------------------
typedef enum D3DX11_SAVE_TEXTURE_FLAG
{
D3DX11_STF_USEINPUTBLOB = 0x0001,
} D3DX11_SAVE_TEXTURE_FLAG;
//----------------------------------------------------------------------------
// 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.
//----------------------------------------------------------------------------
typedef struct D3DX11_IMAGE_INFO
{
UINT Width;
UINT Height;
UINT Depth;
UINT ArraySize;
UINT MipLevels;
UINT MiscFlags;
DXGI_FORMAT Format;
D3D11_RESOURCE_DIMENSION ResourceDimension;
D3DX11_IMAGE_FILE_FORMAT ImageFileFormat;
} D3DX11_IMAGE_INFO;
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// 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
//----------------------------------------------------------------------------
typedef struct D3DX11_IMAGE_LOAD_INFO
{
UINT Width;
UINT Height;
UINT Depth;
UINT FirstMipLevel;
UINT MipLevels;
D3D11_USAGE Usage;
UINT BindFlags;
UINT CpuAccessFlags;
UINT MiscFlags;
DXGI_FORMAT Format;
UINT Filter;
UINT MipFilter;
D3DX11_IMAGE_INFO* pSrcInfo;
#ifdef __cplusplus
D3DX11_IMAGE_LOAD_INFO()
{
Width = D3DX11_DEFAULT;
Height = D3DX11_DEFAULT;
Depth = D3DX11_DEFAULT;
FirstMipLevel = D3DX11_DEFAULT;
MipLevels = D3DX11_DEFAULT;
Usage = (D3D11_USAGE) D3DX11_DEFAULT;
BindFlags = D3DX11_DEFAULT;
CpuAccessFlags = D3DX11_DEFAULT;
MiscFlags = D3DX11_DEFAULT;
Format = DXGI_FORMAT_FROM_FILE;
Filter = D3DX11_DEFAULT;
MipFilter = D3DX11_DEFAULT;
pSrcInfo = NULL;
}
#endif
} D3DX11_IMAGE_LOAD_INFO;
//-------------------------------------------------------------------------------
// 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.
//-------------------------------------------------------------------------------
HRESULT WINAPI
D3DX11GetImageInfoFromFileA(
LPCSTR pSrcFile,
ID3DX11ThreadPump* pPump,
D3DX11_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11GetImageInfoFromFileW(
LPCWSTR pSrcFile,
ID3DX11ThreadPump* pPump,
D3DX11_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileW
#else
#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileA
#endif
HRESULT WINAPI
D3DX11GetImageInfoFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
ID3DX11ThreadPump* pPump,
D3DX11_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11GetImageInfoFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
ID3DX11ThreadPump* pPump,
D3DX11_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceW
#else
#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceA
#endif
HRESULT WINAPI
D3DX11GetImageInfoFromMemory(
LPCVOID pSrcData,
SIZE_T SrcDataSize,
ID3DX11ThreadPump* pPump,
D3DX11_IMAGE_INFO* pSrcInfo,
HRESULT* pHResult);
//////////////////////////////////////////////////////////////////////////////
// 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
HRESULT WINAPI
D3DX11CreateShaderResourceViewFromFileA(
ID3D11Device* pDevice,
LPCSTR pSrcFile,
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11CreateShaderResourceViewFromFileW(
ID3D11Device* pDevice,
LPCWSTR pSrcFile,
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileW
#else
#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileA
#endif
HRESULT WINAPI
D3DX11CreateTextureFromFileA(
ID3D11Device* pDevice,
LPCSTR pSrcFile,
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11Resource** ppTexture,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11CreateTextureFromFileW(
ID3D11Device* pDevice,
LPCWSTR pSrcFile,
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11Resource** ppTexture,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileW
#else
#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileA
#endif
// FromResource (resources in dll/exes)
HRESULT WINAPI
D3DX11CreateShaderResourceViewFromResourceA(
ID3D11Device* pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11CreateShaderResourceViewFromResourceW(
ID3D11Device* pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceW
#else
#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceA
#endif
HRESULT WINAPI
D3DX11CreateTextureFromResourceA(
ID3D11Device* pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11Resource** ppTexture,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11CreateTextureFromResourceW(
ID3D11Device* pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11Resource** ppTexture,
HRESULT* pHResult);
#ifdef UNICODE
#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceW
#else
#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceA
#endif
// FromFileInMemory
HRESULT WINAPI
D3DX11CreateShaderResourceViewFromMemory(
ID3D11Device* pDevice,
LPCVOID pSrcData,
SIZE_T SrcDataSize,
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11ShaderResourceView** ppShaderResourceView,
HRESULT* pHResult);
HRESULT WINAPI
D3DX11CreateTextureFromMemory(
ID3D11Device* pDevice,
LPCVOID pSrcData,
SIZE_T SrcDataSize,
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
ID3DX11ThreadPump* pPump,
ID3D11Resource** ppTexture,
HRESULT* pHResult);
//////////////////////////////////////////////////////////////////////////////
// Misc Texture APIs /////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// D3DX11_TEXTURE_LOAD_INFO:
// ------------------------
//
//----------------------------------------------------------------------------
typedef struct _D3DX11_TEXTURE_LOAD_INFO
{
D3D11_BOX *pSrcBox;
D3D11_BOX *pDstBox;
UINT SrcFirstMip;
UINT DstFirstMip;
UINT NumMips;
UINT SrcFirstElement;
UINT DstFirstElement;
UINT NumElements;
UINT Filter;
UINT MipFilter;
#ifdef __cplusplus
_D3DX11_TEXTURE_LOAD_INFO()
{
pSrcBox = NULL;
pDstBox = NULL;
SrcFirstMip = 0;
DstFirstMip = 0;
NumMips = D3DX11_DEFAULT;
SrcFirstElement = 0;
DstFirstElement = 0;
NumElements = D3DX11_DEFAULT;
Filter = D3DX11_DEFAULT;
MipFilter = D3DX11_DEFAULT;
}
#endif
} D3DX11_TEXTURE_LOAD_INFO;
//----------------------------------------------------------------------------
// D3DX11LoadTextureFromTexture:
// ----------------------------
// Load a texture from a texture.
//
// Parameters:
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX11LoadTextureFromTexture(
ID3D11DeviceContext *pContext,
ID3D11Resource *pSrcTexture,
D3DX11_TEXTURE_LOAD_INFO *pLoadInfo,
ID3D11Resource *pDstTexture);
//----------------------------------------------------------------------------
// 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,
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX11FilterTexture(
ID3D11DeviceContext *pContext,
ID3D11Resource *pTexture,
UINT SrcLevel,
UINT MipFilter);
//----------------------------------------------------------------------------
// 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
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX11SaveTextureToFileA(
ID3D11DeviceContext *pContext,
ID3D11Resource *pSrcTexture,
D3DX11_IMAGE_FILE_FORMAT DestFormat,
LPCSTR pDestFile);
HRESULT WINAPI
D3DX11SaveTextureToFileW(
ID3D11DeviceContext *pContext,
ID3D11Resource *pSrcTexture,
D3DX11_IMAGE_FILE_FORMAT DestFormat,
LPCWSTR pDestFile);
#ifdef UNICODE
#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileW
#else
#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileA
#endif
//----------------------------------------------------------------------------
// 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
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX11SaveTextureToMemory(
ID3D11DeviceContext *pContext,
ID3D11Resource* pSrcTexture,
D3DX11_IMAGE_FILE_FORMAT DestFormat,
ID3D10Blob** ppDestBuf,
UINT Flags);
//----------------------------------------------------------------------------
// 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
//---------------------------------------------------------------------------
HRESULT WINAPI
D3DX11ComputeNormalMap(
ID3D11DeviceContext *pContext,
ID3D11Texture2D *pSrcTexture,
UINT Flags,
UINT Channel,
FLOAT Amplitude,
ID3D11Texture2D *pDestTexture);
//----------------------------------------------------------------------------
// 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
//
//---------------------------------------------------------------------------
HRESULT WINAPI
D3DX11SHProjectCubeMap(
ID3D11DeviceContext *pContext,
__in_range(2,6) UINT Order,
ID3D11Texture2D *pCubeMap,
__out_ecount(Order*Order) FLOAT *pROut,
__out_ecount_opt(Order*Order) FLOAT *pGOut,
__out_ecount_opt(Order*Order) FLOAT *pBOut);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX11TEX_H__

View File

@ -0,0 +1,800 @@
//=============================================================================
// D3D11 HLSL Routines for Manual Pack/Unpack of 32-bit DXGI_FORMAT_*
//=============================================================================
//
// This file contains format conversion routines for use in the
// Compute Shader or Pixel Shader on D3D11 Hardware.
//
// Skip to the end of this comment to see a summary of the routines
// provided. The rest of the text below explains why they are needed
// and how to use them.
//
// The scenario where these can be useful is if your application
// needs to simultaneously both read and write texture - i.e. in-place
// image editing.
//
// D3D11's Unordered Access View (UAV) of a Texture1D/2D/3D resource
// allows random access reads and writes to memory from a Compute Shader
// or Pixel Shader. However, the only texture format that supports this
// is DXGI_FORMAT_R32_UINT. e.g. Other more interesting formats like
// DXGI_FORMAT_R8G8B8A8_UNORM do not support simultaneous read and
// write. You can use such formats for random access writing only
// using a UAV, or reading only using a Shader Resource View (SRV).
// But for simultaneous read+write, the format conversion hardware is
// not available.
//
// There is a workaround to this limitation, involving casting the texture
// to R32_UINT when creating a UAV, as long as the original format of the
// resource supports it (most 32 bit per element formats). This allows
// simultaneous read+write as long as the shader does manual format
// unpacking on read and packing on write.
//
// The benefit is that later on, other views such as RenderTarget Views
// or ShaderResource Views on the same texture can be used with the
// proper format (e.g. DXGI_FORMAT_R16G16_FLOAT) so the hardware can
// do the usual automatic format unpack/pack and do texture filtering etc.
// where there are no hardware limitations.
//
// The sequence of actions for an application is the following:
//
// Suppose you want to make a texture than you can use a Pixel Shader
// or Compute Shader to perform in-place editing, and that the format
// you want the data to be stored in happens to be a descendent
// of of one of these formats:
//
// DXGI_FORMAT_R10G10B10A2_TYPELESS
// DXGI_FORMAT_R8G8B8A8_TYPELESS
// DXGI_FORMAT_B8G8R8A8_TYPELESS
// DXGI_FORMAT_B8G8R8X8_TYPELESS
// DXGI_FORMAT_R16G16_TYPELESS
//
// e.g. DXGI_FORMAT_R10G10B10A2_UNORM is a descendent of
// DXGI_FORMAT_R10G10B10A2_TYPELESS, so it supports the
// usage pattern described here.
//
// (Formats descending from DXGI_FORMAT_R32_TYPELESS, such as
// DXGI_FORMAT_R32_FLOAT, are trivially supported without
// needing any of the format conversion help provided here.)
//
// Steps:
//
// (1) Create a texture with the appropriate _TYPELESS format above
// along with the needed bind flags, such as
// D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE.
//
// (2) For in-place image editing, create a UAV with the format
// DXGI_FORMAT_R32_UINT. D3D normally doesn't allow casting
// between different format "families", but the API makes
// an exception here.
//
// (3) In the Compute Shader or Pixel Shader, use the appropriate
// format pack/unpack routines provided in this file.
// For example if the DXGI_FORMAT_R32_UINT UAV really holds
// DXGI_FORMAT_R10G10B10A2_UNORM data, then, after reading a
// uint from the UAV into the shader, unpack by calling:
//
// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
//
// Then to write to the UAV in the same shader, call the following
// to pack shader data into a uint that can be written out:
//
// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
//
// (4) Other views, such as SRVs, can be created with the desired format;
// e.g. DXGI_FORMAT_R10G10B10A2_UNORM if the resource was created as
// DXGI_FORMAT_R10G10B10A2_TYPELESS. When that view is accessed by a
// shader, the hardware can do automatic type conversion as usual.
//
// Note, again, that if the shader only needs to write to a UAV, or read
// as an SRV, then none of this is needed - fully typed UAV or SRVs can
// be used. Only if simultaneous reading and writing to a UAV of a texture
// is needed are the format conversion routines provided here potentially
// useful.
//
// The following is the list of format conversion routines included in this
// file, categorized by the DXGI_FORMAT they unpack/pack. Each of the
// formats supported descends from one of the TYPELESS formats listed
// above, and supports casting to DXGI_FORMAT_R32_UINT as a UAV.
//
// DXGI_FORMAT_R10G10B10A2_UNORM:
//
// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
//
// DXGI_FORMAT_R10G10B10A2_UINT:
//
// XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput)
// UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput)
//
// DXGI_FORMAT_R8G8B8A8_UNORM:
//
// XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput)
// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
//
// DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
//
// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) *
// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
//
// * The "_inexact" function above uses shader instructions that don't
// have high enough precision to give the exact answer, albeit close.
// The alternative function uses a lookup table stored in the shader
// to give an exact SRGB->float conversion.
//
// DXGI_FORMAT_R8G8B8A8_UINT:
//
// XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput)
// XMUINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput)
//
// DXGI_FORMAT_R8G8B8A8_SNORM:
//
// XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput)
// UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput)
//
// DXGI_FORMAT_R8G8B8A8_SINT:
//
// XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput)
// UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput)
//
// DXGI_FORMAT_B8G8R8A8_UNORM:
//
// XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput)
// UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
//
// DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
//
// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) *
// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
//
// * The "_inexact" function above uses shader instructions that don't
// have high enough precision to give the exact answer, albeit close.
// The alternative function uses a lookup table stored in the shader
// to give an exact SRGB->float conversion.
//
// DXGI_FORMAT_B8G8R8X8_UNORM:
//
// XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput)
// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput)
//
// DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
//
// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput) *
// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput)
// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput)
//
// * The "_inexact" function above uses shader instructions that don't
// have high enough precision to give the exact answer, albeit close.
// The alternative function uses a lookup table stored in the shader
// to give an exact SRGB->float conversion.
//
// DXGI_FORMAT_R16G16_FLOAT:
//
// XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput)
// UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput)
//
// DXGI_FORMAT_R16G16_UNORM:
//
// XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput)
// UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise FLOAT2 unpackedInput)
//
// DXGI_FORMAT_R16G16_UINT:
//
// XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput)
// UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput)
//
// DXGI_FORMAT_R16G16_SNORM:
//
// XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput)
// UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput)
//
// DXGI_FORMAT_R16G16_SINT:
//
// XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput)
// UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput)
//
//=============================================================================
#ifndef __D3DX_DXGI_FORMAT_CONVERT_INL___
#define __D3DX_DXGI_FORMAT_CONVERT_INL___
#if HLSL_VERSION > 0
#define D3DX11INLINE
typedef int INT;
typedef uint UINT;
typedef float2 XMFLOAT2;
typedef float3 XMFLOAT3;
typedef float4 XMFLOAT4;
typedef int2 XMINT2;
typedef int4 XMINT4;
typedef uint2 XMUINT2;
typedef uint4 XMUINT4;
#define hlsl_precise precise
#define D3DX_Saturate_FLOAT(_V) saturate(_V)
#define D3DX_IsNan(_V) isnan(_V)
#define D3DX_Truncate_FLOAT(_V) trunc(_V)
#else // HLSL_VERSION > 0
#ifndef __cplusplus
#error C++ compilation required
#endif
#include <float.h>
#include <xnamath.h>
#define hlsl_precise
D3DX11INLINE FLOAT D3DX_Saturate_FLOAT(FLOAT _V)
{
return min(max(_V, 0), 1);
}
D3DX11INLINE bool D3DX_IsNan(FLOAT _V)
{
return _V != _V;
}
D3DX11INLINE FLOAT D3DX_Truncate_FLOAT(FLOAT _V)
{
return _V >= 0 ? floor(_V) : ceil(_V);
}
// 2D Vector; 32 bit signed integer components
typedef struct _XMINT2
{
INT x;
INT y;
} XMINT2;
// 2D Vector; 32 bit unsigned integer components
typedef struct _XMUINT2
{
UINT x;
UINT y;
} XMUINT2;
// 4D Vector; 32 bit signed integer components
typedef struct _XMINT4
{
INT x;
INT y;
INT z;
INT w;
} XMINT4;
// 4D Vector; 32 bit unsigned integer components
typedef struct _XMUINT4
{
UINT x;
UINT y;
UINT z;
UINT w;
} XMUINT4;
#endif // HLSL_VERSION > 0
//=============================================================================
// SRGB Helper Functions Called By Conversions Further Below.
//=============================================================================
// SRGB_to_FLOAT_inexact is imprecise due to precision of pow implementations.
// If exact SRGB->float conversion is needed, a table lookup is provided
// further below.
D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT_inexact(hlsl_precise FLOAT val)
{
if( val < 0.04045f )
val /= 12.92f;
else
val = pow((val + 0.055f)/1.055f,2.4f);
return val;
}
static const UINT D3DX_SRGBTable[] =
{
0x00000000,0x399f22b4,0x3a1f22b4,0x3a6eb40e,0x3a9f22b4,0x3ac6eb61,0x3aeeb40e,0x3b0b3e5d,
0x3b1f22b4,0x3b33070b,0x3b46eb61,0x3b5b518d,0x3b70f18d,0x3b83e1c6,0x3b8fe616,0x3b9c87fd,
0x3ba9c9b7,0x3bb7ad6f,0x3bc63549,0x3bd56361,0x3be539c1,0x3bf5ba70,0x3c0373b5,0x3c0c6152,
0x3c15a703,0x3c1f45be,0x3c293e6b,0x3c3391f7,0x3c3e4149,0x3c494d43,0x3c54b6c7,0x3c607eb1,
0x3c6ca5df,0x3c792d22,0x3c830aa8,0x3c89af9f,0x3c9085db,0x3c978dc5,0x3c9ec7c2,0x3ca63433,
0x3cadd37d,0x3cb5a601,0x3cbdac20,0x3cc5e639,0x3cce54ab,0x3cd6f7d5,0x3cdfd010,0x3ce8ddb9,
0x3cf2212c,0x3cfb9ac1,0x3d02a569,0x3d0798dc,0x3d0ca7e6,0x3d11d2af,0x3d171963,0x3d1c7c2e,
0x3d21fb3c,0x3d2796b2,0x3d2d4ebb,0x3d332380,0x3d39152b,0x3d3f23e3,0x3d454fd1,0x3d4b991c,
0x3d51ffef,0x3d58846a,0x3d5f26b7,0x3d65e6fe,0x3d6cc564,0x3d73c20f,0x3d7add29,0x3d810b67,
0x3d84b795,0x3d887330,0x3d8c3e4a,0x3d9018f6,0x3d940345,0x3d97fd4a,0x3d9c0716,0x3da020bb,
0x3da44a4b,0x3da883d7,0x3daccd70,0x3db12728,0x3db59112,0x3dba0b3b,0x3dbe95b5,0x3dc33092,
0x3dc7dbe2,0x3dcc97b6,0x3dd1641f,0x3dd6412c,0x3ddb2eef,0x3de02d77,0x3de53cd5,0x3dea5d19,
0x3def8e52,0x3df4d091,0x3dfa23e8,0x3dff8861,0x3e027f07,0x3e054280,0x3e080ea3,0x3e0ae378,
0x3e0dc105,0x3e10a754,0x3e13966b,0x3e168e52,0x3e198f10,0x3e1c98ad,0x3e1fab30,0x3e22c6a3,
0x3e25eb09,0x3e29186c,0x3e2c4ed0,0x3e2f8e41,0x3e32d6c4,0x3e362861,0x3e39831e,0x3e3ce703,
0x3e405416,0x3e43ca5f,0x3e4749e4,0x3e4ad2ae,0x3e4e64c2,0x3e520027,0x3e55a4e6,0x3e595303,
0x3e5d0a8b,0x3e60cb7c,0x3e6495e0,0x3e6869bf,0x3e6c4720,0x3e702e0c,0x3e741e84,0x3e781890,
0x3e7c1c38,0x3e8014c2,0x3e82203c,0x3e84308d,0x3e8645ba,0x3e885fc5,0x3e8a7eb2,0x3e8ca283,
0x3e8ecb3d,0x3e90f8e1,0x3e932b74,0x3e9562f8,0x3e979f71,0x3e99e0e2,0x3e9c274e,0x3e9e72b7,
0x3ea0c322,0x3ea31892,0x3ea57308,0x3ea7d289,0x3eaa3718,0x3eaca0b7,0x3eaf0f69,0x3eb18333,
0x3eb3fc18,0x3eb67a18,0x3eb8fd37,0x3ebb8579,0x3ebe12e1,0x3ec0a571,0x3ec33d2d,0x3ec5da17,
0x3ec87c33,0x3ecb2383,0x3ecdd00b,0x3ed081cd,0x3ed338cc,0x3ed5f50b,0x3ed8b68d,0x3edb7d54,
0x3ede4965,0x3ee11ac1,0x3ee3f16b,0x3ee6cd67,0x3ee9aeb6,0x3eec955d,0x3eef815d,0x3ef272ba,
0x3ef56976,0x3ef86594,0x3efb6717,0x3efe6e02,0x3f00bd2d,0x3f02460e,0x3f03d1a7,0x3f055ff9,
0x3f06f106,0x3f0884cf,0x3f0a1b56,0x3f0bb49b,0x3f0d50a0,0x3f0eef67,0x3f1090f1,0x3f12353e,
0x3f13dc51,0x3f15862b,0x3f1732cd,0x3f18e239,0x3f1a946f,0x3f1c4971,0x3f1e0141,0x3f1fbbdf,
0x3f21794e,0x3f23398e,0x3f24fca0,0x3f26c286,0x3f288b41,0x3f2a56d3,0x3f2c253d,0x3f2df680,
0x3f2fca9e,0x3f31a197,0x3f337b6c,0x3f355820,0x3f3737b3,0x3f391a26,0x3f3aff7c,0x3f3ce7b5,
0x3f3ed2d2,0x3f40c0d4,0x3f42b1be,0x3f44a590,0x3f469c4b,0x3f4895f1,0x3f4a9282,0x3f4c9201,
0x3f4e946e,0x3f5099cb,0x3f52a218,0x3f54ad57,0x3f56bb8a,0x3f58ccb0,0x3f5ae0cd,0x3f5cf7e0,
0x3f5f11ec,0x3f612eee,0x3f634eef,0x3f6571e9,0x3f6797e3,0x3f69c0d6,0x3f6beccd,0x3f6e1bbf,
0x3f704db8,0x3f7282af,0x3f74baae,0x3f76f5ae,0x3f7933b9,0x3f7b74c6,0x3f7db8e0,0x3f800000
};
D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT(UINT val)
{
#if HLSL_VERSION > 0
return asfloat(D3DX_SRGBTable[val]);
#else
return *(FLOAT*)&D3DX_SRGBTable[val];
#endif
}
D3DX11INLINE FLOAT D3DX_FLOAT_to_SRGB(hlsl_precise FLOAT val)
{
if( val < 0.0031308f )
val *= 12.92f;
else
val = 1.055f * pow(val,1.0f/2.4f) - 0.055f;
return val;
}
D3DX11INLINE FLOAT D3DX_SaturateSigned_FLOAT(FLOAT _V)
{
if (D3DX_IsNan(_V))
{
return 0;
}
return min(max(_V, -1), 1);
}
D3DX11INLINE UINT D3DX_FLOAT_to_UINT(FLOAT _V,
FLOAT _Scale)
{
return (UINT)floor(_V * _Scale + 0.5f);
}
D3DX11INLINE FLOAT D3DX_INT_to_FLOAT(INT _V,
FLOAT _Scale)
{
FLOAT Scaled = (FLOAT)_V / _Scale;
// The integer is a two's-complement signed
// number so the negative range is slightly
// larger than the positive range, meaning
// the scaled value can be slight less than -1.
// Clamp to keep the float range [-1, 1].
return max(Scaled, -1.0f);
}
D3DX11INLINE INT D3DX_FLOAT_to_INT(FLOAT _V,
FLOAT _Scale)
{
return (INT)D3DX_Truncate_FLOAT(_V * _Scale + (_V >= 0 ? 0.5f : -0.5f));
}
//=============================================================================
// Conversion routines
//=============================================================================
//-----------------------------------------------------------------------------
// R10B10G10A2_UNORM <-> FLOAT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.x = (FLOAT) (packedInput & 0x000003ff) / 1023;
unpackedOutput.y = (FLOAT)(((packedInput>>10) & 0x000003ff)) / 1023;
unpackedOutput.z = (FLOAT)(((packedInput>>20) & 0x000003ff)) / 1023;
unpackedOutput.w = (FLOAT)(((packedInput>>30) & 0x00000003)) / 3;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 1023)) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 1023)<<10) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 1023)<<20) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 3)<<30) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R10B10G10A2_UINT <-> UINT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput)
{
XMUINT4 unpackedOutput;
unpackedOutput.x = packedInput & 0x000003ff;
unpackedOutput.y = (packedInput>>10) & 0x000003ff;
unpackedOutput.z = (packedInput>>20) & 0x000003ff;
unpackedOutput.w = (packedInput>>30) & 0x00000003;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput)
{
UINT packedOutput;
unpackedInput.x = min(unpackedInput.x, 0x000003ff);
unpackedInput.y = min(unpackedInput.y, 0x000003ff);
unpackedInput.z = min(unpackedInput.z, 0x000003ff);
unpackedInput.w = min(unpackedInput.w, 0x00000003);
packedOutput = ( (unpackedInput.x) |
((unpackedInput.y)<<10) |
((unpackedInput.z)<<20) |
((unpackedInput.w)<<30) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R8G8B8A8_UNORM <-> FLOAT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.x = (FLOAT) (packedInput & 0x000000ff) / 255;
unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
unpackedOutput.z = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
unpackedOutput.w = (FLOAT) (packedInput>>24) / 255;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)<<16) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R8G8B8A8_UNORM_SRGB <-> FLOAT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
return unpackedOutput;
}
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.x = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
unpackedOutput.z = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
{
UINT packedOutput;
unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w);
packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)) |
(D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
(D3DX_FLOAT_to_UINT(unpackedInput.z, 255)<<16) |
(D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R8G8B8A8_UINT <-> UINT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput)
{
XMUINT4 unpackedOutput;
unpackedOutput.x = packedInput & 0x000000ff;
unpackedOutput.y = (packedInput>> 8) & 0x000000ff;
unpackedOutput.z = (packedInput>>16) & 0x000000ff;
unpackedOutput.w = packedInput>>24;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput)
{
UINT packedOutput;
unpackedInput.x = min(unpackedInput.x, 0x000000ff);
unpackedInput.y = min(unpackedInput.y, 0x000000ff);
unpackedInput.z = min(unpackedInput.z, 0x000000ff);
unpackedInput.w = min(unpackedInput.w, 0x000000ff);
packedOutput = ( unpackedInput.x |
(unpackedInput.y<< 8) |
(unpackedInput.z<<16) |
(unpackedInput.w<<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R8G8B8A8_SNORM <-> FLOAT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
XMINT4 signExtendedBits;
signExtendedBits.x = (INT)(packedInput << 24) >> 24;
signExtendedBits.y = (INT)((packedInput << 16) & 0xff000000) >> 24;
signExtendedBits.z = (INT)((packedInput << 8) & 0xff000000) >> 24;
signExtendedBits.w = (INT)(packedInput & 0xff000000) >> 24;
unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 127);
unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 127);
unpackedOutput.z = D3DX_INT_to_FLOAT(signExtendedBits.z, 127);
unpackedOutput.w = D3DX_INT_to_FLOAT(signExtendedBits.w, 127);
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 127) & 0x000000ff) |
((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 127) & 0x000000ff)<< 8) |
((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.z), 127) & 0x000000ff)<<16) |
((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.w), 127)) <<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R8G8B8A8_SINT <-> INT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput)
{
XMINT4 unpackedOutput;
unpackedOutput.x = (INT)(packedInput << 24) >> 24;
unpackedOutput.y = (INT)((packedInput << 16) & 0xff000000) >> 24;
unpackedOutput.z = (INT)((packedInput << 8) & 0xff000000) >> 24;
unpackedOutput.w = (INT)(packedInput & 0xff000000) >> 24;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput)
{
UINT packedOutput;
unpackedInput.x = max(min(unpackedInput.x,127),-128);
unpackedInput.y = max(min(unpackedInput.y,127),-128);
unpackedInput.z = max(min(unpackedInput.z,127),-128);
unpackedInput.w = max(min(unpackedInput.w,127),-128);
packedOutput = ( (unpackedInput.x & 0x000000ff) |
((unpackedInput.y & 0x000000ff)<< 8) |
((unpackedInput.z & 0x000000ff)<<16) |
(unpackedInput.w <<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// B8G8R8A8_UNORM <-> FLOAT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255;
unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
unpackedOutput.w = (FLOAT) (packedInput>>24) / 255;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// B8G8R8A8_UNORM_SRGB <-> FLOAT4
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
return unpackedOutput;
}
D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
{
hlsl_precise XMFLOAT4 unpackedOutput;
unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
{
UINT packedOutput;
unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w);
packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) |
(D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
(D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) |
(D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// B8G8R8X8_UNORM <-> FLOAT3
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput)
{
hlsl_precise XMFLOAT3 unpackedOutput;
unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255;
unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// B8G8R8X8_UNORM_SRGB <-> FLOAT3
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput)
{
hlsl_precise XMFLOAT3 unpackedOutput;
unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
return unpackedOutput;
}
D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput)
{
hlsl_precise XMFLOAT3 unpackedOutput;
unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput)
{
UINT packedOutput;
unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) |
(D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
(D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R16G16_FLOAT <-> FLOAT2
//-----------------------------------------------------------------------------
#if HLSL_VERSION > 0
D3DX11INLINE XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput)
{
hlsl_precise XMFLOAT2 unpackedOutput;
unpackedOutput.x = f16tof32(packedInput&0x0000ffff);
unpackedOutput.y = f16tof32(packedInput>>16);
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput)
{
UINT packedOutput;
packedOutput = asuint(f32tof16(unpackedInput.x)) |
(asuint(f32tof16(unpackedInput.y)) << 16);
return packedOutput;
}
#endif // HLSL_VERSION > 0
//-----------------------------------------------------------------------------
// R16G16_UNORM <-> FLOAT2
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput)
{
hlsl_precise XMFLOAT2 unpackedOutput;
unpackedOutput.x = (FLOAT) (packedInput & 0x0000ffff) / 65535;
unpackedOutput.y = (FLOAT) (packedInput>>16) / 65535;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise XMFLOAT2 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 65535)) |
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 65535)<< 16) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R16G16_UINT <-> UINT2
//-----------------------------------------------------------------------------
D3DX11INLINE XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput)
{
XMUINT2 unpackedOutput;
unpackedOutput.x = packedInput & 0x0000ffff;
unpackedOutput.y = packedInput>>16;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput)
{
UINT packedOutput;
unpackedInput.x = min(unpackedInput.x,0x0000ffff);
unpackedInput.y = min(unpackedInput.y,0x0000ffff);
packedOutput = ( unpackedInput.x |
(unpackedInput.y<<16) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R16G16_SNORM <-> FLOAT2
//-----------------------------------------------------------------------------
D3DX11INLINE XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput)
{
hlsl_precise XMFLOAT2 unpackedOutput;
XMINT2 signExtendedBits;
signExtendedBits.x = (INT)(packedInput << 16) >> 16;
signExtendedBits.y = (INT)(packedInput & 0xffff0000) >> 16;
unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 32767);
unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 32767);
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput)
{
UINT packedOutput;
packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 32767) & 0x0000ffff) |
(D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 32767) <<16) );
return packedOutput;
}
//-----------------------------------------------------------------------------
// R16G16_SINT <-> INT2
//-----------------------------------------------------------------------------
D3DX11INLINE XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput)
{
XMINT2 unpackedOutput;
unpackedOutput.x = (INT)(packedInput << 16) >> 16;
unpackedOutput.y = (INT)(packedInput & 0xffff0000) >> 16;
return unpackedOutput;
}
D3DX11INLINE UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput)
{
UINT packedOutput;
unpackedInput.x = max(min(unpackedInput.x,32767),-32768);
unpackedInput.y = max(min(unpackedInput.y,32767),-32768);
packedOutput = ( (unpackedInput.x & 0x0000ffff) |
(unpackedInput.y <<16) );
return packedOutput;
}
#endif // __D3DX_DXGI_FORMAT_CONVERT_INL___

403
gfx/include/dxsdk/dcommon.h Normal file
View File

@ -0,0 +1,403 @@
//+--------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Abstract:
// Public API definitions shared by DWrite, D2D, and DImage.
//
//----------------------------------------------------------------------------
#pragma once
#ifndef DCOMMON_H_INCLUDED
#define DCOMMON_H_INCLUDED
#include <dxgiformat.h>
#ifndef DX_DECLARE_INTERFACE
#define DX_DECLARE_INTERFACE(x) DECLSPEC_UUID(x) DECLSPEC_NOVTABLE
#endif
#ifndef CHECKMETHOD
#define CHECKMETHOD(method) virtual DECLSPEC_NOTHROW _Must_inspect_result_ HRESULT STDMETHODCALLTYPE method
#endif
#pragma warning(push)
#pragma warning(disable:4201) // anonymous unions warning
//
// Forward declarations
//
struct IDXGISurface;
/// <summary>
/// The measuring method used for text layout.
/// </summary>
typedef enum DWRITE_MEASURING_MODE
{
/// <summary>
/// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
/// </summary>
DWRITE_MEASURING_MODE_NATURAL,
/// <summary>
/// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
/// </summary>
DWRITE_MEASURING_MODE_GDI_CLASSIC,
/// <summary>
// Text is measured using the same glyph display metrics as text measured by GDI using a font
// created with CLEARTYPE_NATURAL_QUALITY.
/// </summary>
DWRITE_MEASURING_MODE_GDI_NATURAL
} DWRITE_MEASURING_MODE;
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
/// <summary>
/// Fonts may contain multiple drawable data formats for glyphs. These flags specify which formats
/// are supported in the font, either at a font-wide level or per glyph, and the app may use them
/// to tell DWrite which formats to return when splitting a color glyph run.
/// </summary>
enum DWRITE_GLYPH_IMAGE_FORMATS
{
/// <summary>
/// Indicates no data is available for this glyph.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_NONE = 0x00000000,
/// <summary>
/// The glyph has TrueType outlines.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE = 0x00000001,
/// <summary>
/// The glyph has CFF outlines.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_CFF = 0x00000002,
/// <summary>
/// The glyph has multilayered COLR data.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_COLR = 0x00000004,
/// <summary>
/// The glyph has SVG outlines as standard XML.
/// </summary>
/// <remarks>
/// Fonts may store the content gzip'd rather than plain text,
/// indicated by the first two bytes as gzip header {0x1F 0x8B}.
/// </remarks>
DWRITE_GLYPH_IMAGE_FORMATS_SVG = 0x00000008,
/// <summary>
/// The glyph has PNG image data, with standard PNG IHDR.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_PNG = 0x00000010,
/// <summary>
/// The glyph has JPEG image data, with standard JIFF SOI header.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_JPEG = 0x00000020,
/// <summary>
/// The glyph has TIFF image data.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_TIFF = 0x00000040,
/// <summary>
/// The glyph has raw 32-bit premultiplied BGRA data.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8 = 0x00000080,
};
#ifdef DEFINE_ENUM_FLAG_OPERATORS
DEFINE_ENUM_FLAG_OPERATORS(DWRITE_GLYPH_IMAGE_FORMATS);
#endif
#endif
/// <summary>
/// Qualifies how alpha is to be treated in a bitmap or render target containing
/// alpha.
/// </summary>
typedef enum D2D1_ALPHA_MODE
{
/// <summary>
/// Alpha mode should be determined implicitly. Some target surfaces do not supply
/// or imply this information in which case alpha must be specified.
/// </summary>
D2D1_ALPHA_MODE_UNKNOWN = 0,
/// <summary>
/// Treat the alpha as premultipled.
/// </summary>
D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
/// <summary>
/// Opacity is in the 'A' component only.
/// </summary>
D2D1_ALPHA_MODE_STRAIGHT = 2,
/// <summary>
/// Ignore any alpha channel information.
/// </summary>
D2D1_ALPHA_MODE_IGNORE = 3,
D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff
} D2D1_ALPHA_MODE;
/// <summary>
/// Description of a pixel format.
/// </summary>
typedef struct D2D1_PIXEL_FORMAT
{
DXGI_FORMAT format;
D2D1_ALPHA_MODE alphaMode;
} D2D1_PIXEL_FORMAT;
/// <summary>
/// Represents an x-coordinate and y-coordinate pair in two-dimensional space.
/// </summary>
typedef struct D2D_POINT_2U
{
UINT32 x;
UINT32 y;
} D2D_POINT_2U;
/// <summary>
/// Represents an x-coordinate and y-coordinate pair in two-dimensional space.
/// </summary>
typedef struct D2D_POINT_2F
{
FLOAT x;
FLOAT y;
} D2D_POINT_2F;
typedef POINT D2D_POINT_2L;
/// <summary>
/// A vector of 2 FLOAT values (x, y).
/// </summary>
typedef struct D2D_VECTOR_2F
{
FLOAT x;
FLOAT y;
} D2D_VECTOR_2F;
/// <summary>
/// A vector of 3 FLOAT values (x, y, z).
/// </summary>
typedef struct D2D_VECTOR_3F
{
FLOAT x;
FLOAT y;
FLOAT z;
} D2D_VECTOR_3F;
/// <summary>
/// A vector of 4 FLOAT values (x, y, z, w).
/// </summary>
typedef struct D2D_VECTOR_4F
{
FLOAT x;
FLOAT y;
FLOAT z;
FLOAT w;
} D2D_VECTOR_4F;
/// <summary>
/// Represents a rectangle defined by the coordinates of the upper-left corner
/// (left, top) and the coordinates of the lower-right corner (right, bottom).
/// </summary>
typedef struct D2D_RECT_F
{
FLOAT left;
FLOAT top;
FLOAT right;
FLOAT bottom;
} D2D_RECT_F;
/// <summary>
/// Represents a rectangle defined by the coordinates of the upper-left corner
/// (left, top) and the coordinates of the lower-right corner (right, bottom).
/// </summary>
typedef struct D2D_RECT_U
{
UINT32 left;
UINT32 top;
UINT32 right;
UINT32 bottom;
} D2D_RECT_U;
typedef RECT D2D_RECT_L;
/// <summary>
/// Stores an ordered pair of floats, typically the width and height of a rectangle.
/// </summary>
typedef struct D2D_SIZE_F
{
FLOAT width;
FLOAT height;
} D2D_SIZE_F;
/// <summary>
/// Stores an ordered pair of integers, typically the width and height of a
/// rectangle.
/// </summary>
typedef struct D2D_SIZE_U
{
UINT32 width;
UINT32 height;
} D2D_SIZE_U;
/// <summary>
/// Represents a 3-by-2 matrix.
/// </summary>
typedef struct D2D_MATRIX_3X2_F
{
union
{
struct
{
/// <summary>
/// Horizontal scaling / cosine of rotation
/// </summary>
FLOAT m11;
/// <summary>
/// Vertical shear / sine of rotation
/// </summary>
FLOAT m12;
/// <summary>
/// Horizontal shear / negative sine of rotation
/// </summary>
FLOAT m21;
/// <summary>
/// Vertical scaling / cosine of rotation
/// </summary>
FLOAT m22;
/// <summary>
/// Horizontal shift (always orthogonal regardless of rotation)
/// </summary>
FLOAT dx;
/// <summary>
/// Vertical shift (always orthogonal regardless of rotation)
/// </summary>
FLOAT dy;
};
struct
{
FLOAT _11, _12;
FLOAT _21, _22;
FLOAT _31, _32;
};
FLOAT m[3][2];
};
} D2D_MATRIX_3X2_F;
/// <summary>
/// Represents a 4-by-3 matrix.
/// </summary>
typedef struct D2D_MATRIX_4X3_F
{
union
{
struct
{
FLOAT _11, _12, _13;
FLOAT _21, _22, _23;
FLOAT _31, _32, _33;
FLOAT _41, _42, _43;
};
FLOAT m[4][3];
};
} D2D_MATRIX_4X3_F;
/// <summary>
/// Represents a 4-by-4 matrix.
/// </summary>
typedef struct D2D_MATRIX_4X4_F
{
union
{
struct
{
FLOAT _11, _12, _13, _14;
FLOAT _21, _22, _23, _24;
FLOAT _31, _32, _33, _34;
FLOAT _41, _42, _43, _44;
};
FLOAT m[4][4];
};
} D2D_MATRIX_4X4_F;
/// <summary>
/// Represents a 5-by-4 matrix.
/// </summary>
typedef struct D2D_MATRIX_5X4_F
{
union
{
struct
{
FLOAT _11, _12, _13, _14;
FLOAT _21, _22, _23, _24;
FLOAT _31, _32, _33, _34;
FLOAT _41, _42, _43, _44;
FLOAT _51, _52, _53, _54;
};
FLOAT m[5][4];
};
} D2D_MATRIX_5X4_F;
typedef D2D_POINT_2F D2D1_POINT_2F;
typedef D2D_POINT_2U D2D1_POINT_2U;
typedef D2D_POINT_2L D2D1_POINT_2L;
typedef D2D_RECT_F D2D1_RECT_F;
typedef D2D_RECT_U D2D1_RECT_U;
typedef D2D_RECT_L D2D1_RECT_L;
typedef D2D_SIZE_F D2D1_SIZE_F;
typedef D2D_SIZE_U D2D1_SIZE_U;
typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
#pragma warning(pop)
#endif /* DCOMMON_H_INCLUDED */

204
gfx/include/dxsdk/dsconf.h Normal file
View File

@ -0,0 +1,204 @@
/*==========================================================================;
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: dsconf.h
* Content: DirectSound configuration interface include file
*
**************************************************************************/
#ifndef __DSCONF_INCLUDED__
#define __DSCONF_INCLUDED__
/*#include <winapifamily.h>*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
#ifndef __DSOUND_INCLUDED__
#error dsound.h not included
#endif // __DSOUND_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// DirectSound Configuration Component GUID {11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA}
DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
//
// DirectSound Device Properties {84624F82-25EC-11d1-A4D8-00C04FC28ACA}
//
DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
typedef enum
{
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8,
} DSPROPERTY_DIRECTSOUNDDEVICE;
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
#endif // DIRECTSOUND_VERSION >= 0x0700
typedef enum
{
DIRECTSOUNDDEVICE_TYPE_EMULATED,
DIRECTSOUNDDEVICE_TYPE_VXD,
DIRECTSOUNDDEVICE_TYPE_WDM
} DIRECTSOUNDDEVICE_TYPE;
typedef enum
{
DIRECTSOUNDDEVICE_DATAFLOW_RENDER,
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
} DIRECTSOUNDDEVICE_DATAFLOW;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
{
LPSTR DeviceName; // waveIn/waveOut device name
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
GUID DeviceId; // DirectSound device id
} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
{
LPWSTR DeviceName; // waveIn/waveOut device name
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
GUID DeviceId; // DirectSound device id
} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA;
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
#endif // UNICODE
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
{
GUID DeviceId; // DirectSound device id
CHAR DescriptionA[0x100]; // Device description (ANSI)
WCHAR DescriptionW[0x100]; // Device description (Unicode)
CHAR ModuleA[MAX_PATH]; // Device driver module (ANSI)
WCHAR ModuleW[MAX_PATH]; // Device driver module (Unicode)
DIRECTSOUNDDEVICE_TYPE Type; // Device type
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
ULONG WaveDeviceId; // Wave device id
ULONG Devnode; // Devnode (or DevInst)
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
{
DIRECTSOUNDDEVICE_TYPE Type; // Device type
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
GUID DeviceId; // DirectSound device id
LPSTR Description; // Device description
LPSTR Module; // Device driver module
LPSTR Interface; // Device interface
ULONG WaveDeviceId; // Wave device id
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
{
DIRECTSOUNDDEVICE_TYPE Type; // Device type
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
GUID DeviceId; // DirectSound device id
LPWSTR Description; // Device description
LPWSTR Module; // Device driver module
LPWSTR Interface; // Device interface
ULONG WaveDeviceId; // Wave device id
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA;
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
#endif // DIRECTSOUND_VERSION >= 0x0700
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID);
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID);
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID);
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW
#else // UNICODE
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1
#endif // DIRECTSOUND_VERSION >= 0x0700
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
{
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback; // Callback function pointer
LPVOID Context; // Callback function context argument
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
{
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback; // Callback function pointer
LPVOID Context; // Callback function context argument
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
{
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback; // Callback function pointer
LPVOID Context; // Callback function context argument
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA;
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
#endif // DIRECTSOUND_VERSION >= 0x0700
#ifdef __cplusplus
}
#endif // __cplusplus
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/
#endif // __DSCONF_INCLUDED__

283
gfx/include/dxsdk/dsetup.h Normal file
View File

@ -0,0 +1,283 @@
/*==========================================================================
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dsetup.h
* Content: DirectXSetup, error codes and flags
***************************************************************************/
#ifndef __DSETUP_H__
#define __DSETUP_H__
#include <windows.h> // windows stuff
#ifdef __cplusplus
extern "C" {
#endif
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
// DSETUP Error Codes, must remain compatible with previous setup.
#define DSETUPERR_SUCCESS_RESTART 1
#define DSETUPERR_SUCCESS 0
#define DSETUPERR_BADWINDOWSVERSION -1
#define DSETUPERR_SOURCEFILENOTFOUND -2
#define DSETUPERR_NOCOPY -5
#define DSETUPERR_OUTOFDISKSPACE -6
#define DSETUPERR_CANTFINDINF -7
#define DSETUPERR_CANTFINDDIR -8
#define DSETUPERR_INTERNAL -9
#define DSETUPERR_UNKNOWNOS -11
#define DSETUPERR_NEWERVERSION -14
#define DSETUPERR_NOTADMIN -15
#define DSETUPERR_UNSUPPORTEDPROCESSOR -16
#define DSETUPERR_MISSINGCAB_MANAGEDDX -17
#define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18
#define DSETUPERR_CABDOWNLOADFAIL -19
#define DSETUPERR_DXCOMPONENTFILEINUSE -20
#define DSETUPERR_UNTRUSTEDCABINETFILE -21
// DSETUP flags. DirectX 5.0 apps should use these flags only.
#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
#define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */
#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
// DO NOT USE THEM for DX5. They will go away in future DX releases.
#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
//******************************************************************
// DirectX Setup Callback mechanism
//******************************************************************
// DSETUP Message Info Codes, passed to callback as Reason parameter.
#define DSETUP_CB_MSG_NOMESSAGE 0
#define DSETUP_CB_MSG_INTERNAL_ERROR 10
#define DSETUP_CB_MSG_BEGIN_INSTALL 13
#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
#define DSETUP_CB_MSG_PROGRESS 18
#define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19
typedef struct _DSETUP_CB_PROGRESS
{
DWORD dwPhase;
DWORD dwInPhaseMaximum;
DWORD dwInPhaseProgress;
DWORD dwOverallMaximum;
DWORD dwOverallProgress;
} DSETUP_CB_PROGRESS;
enum _DSETUP_CB_PROGRESS_PHASE
{
DSETUP_INITIALIZING,
DSETUP_EXTRACTING,
DSETUP_COPYING,
DSETUP_FINALIZING
};
#ifdef _WIN32
//
// Data Structures
//
#ifndef UNICODE_ONLY
typedef struct _DIRECTXREGISTERAPPA {
DWORD dwSize;
DWORD dwFlags;
LPSTR lpszApplicationName;
LPGUID lpGUID;
LPSTR lpszFilename;
LPSTR lpszCommandLine;
LPSTR lpszPath;
LPSTR lpszCurrentDirectory;
} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
typedef struct _DIRECTXREGISTERAPP2A {
DWORD dwSize;
DWORD dwFlags;
LPSTR lpszApplicationName;
LPGUID lpGUID;
LPSTR lpszFilename;
LPSTR lpszCommandLine;
LPSTR lpszPath;
LPSTR lpszCurrentDirectory;
LPSTR lpszLauncherName;
} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
typedef struct _DIRECTXREGISTERAPPW {
DWORD dwSize;
DWORD dwFlags;
LPWSTR lpszApplicationName;
LPGUID lpGUID;
LPWSTR lpszFilename;
LPWSTR lpszCommandLine;
LPWSTR lpszPath;
LPWSTR lpszCurrentDirectory;
} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
typedef struct _DIRECTXREGISTERAPP2W {
DWORD dwSize;
DWORD dwFlags;
LPWSTR lpszApplicationName;
LPGUID lpGUID;
LPWSTR lpszFilename;
LPWSTR lpszCommandLine;
LPWSTR lpszPath;
LPWSTR lpszCurrentDirectory;
LPWSTR lpszLauncherName;
} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
#endif //!ANSI_ONLY
#ifdef UNICODE
typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
#else
typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
#endif // UNICODE
//
// API
//
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXSetupA(
HWND hWnd,
__in_opt LPSTR lpszRootPath,
DWORD dwFlags
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXSetupW(
HWND hWnd,
__in_opt LPWSTR lpszRootPath,
DWORD dwFlags
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXSetup DirectXSetupW
#else
#define DirectXSetup DirectXSetupA
#endif // !UNICODE
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXRegisterApplicationA(
HWND hWnd,
LPVOID lpDXRegApp
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXRegisterApplicationW(
HWND hWnd,
LPVOID lpDXRegApp
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXRegisterApplication DirectXRegisterApplicationW
#else
#define DirectXRegisterApplication DirectXRegisterApplicationA
#endif // !UNICODE
INT
WINAPI
DirectXUnRegisterApplication(
HWND hWnd,
LPGUID lpGUID
);
//
// Function Pointers
//
#ifdef UNICODE
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
#else
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
#endif // UNICODE
typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
DWORD MsgType, /* Same as flags to MessageBox */
LPSTR szMessage,
LPSTR szName,
void *pInfo);
INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
INT WINAPI DirectXSetupShowEULA(HWND hWndParent);
#ifndef UNICODE_ONLY
UINT
WINAPI
DirectXSetupGetEULAA(
__out_ecount(cchEULA) LPSTR lpszEULA,
UINT cchEULA,
WORD LangID
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
UINT
WINAPI
DirectXSetupGetEULAW(
__out_ecount(cchEULA) LPWSTR lpszEULA,
UINT cchEULA,
WORD LangID
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXSetupGetEULA DirectXSetupGetEULAW
typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD);
#else
#define DirectXSetupGetEULA DirectXSetupGetEULAA
typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD);
#endif // !UNICODE
#endif // WIN32
#ifdef __cplusplus
};
#endif
#endif

5121
gfx/include/dxsdk/dwrite.h Normal file

File diff suppressed because it is too large Load Diff

1926
gfx/include/dxsdk/dwrite_1.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,975 @@
//+--------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Abstract:
// DirectX Typography Services public API definitions.
//
//----------------------------------------------------------------------------
#ifndef DWRITE_2_H_INCLUDED
#define DWRITE_2_H_INCLUDED
#pragma once
#include <dwrite_1.h>
interface IDWriteFontFallback;
/// <summary>
/// How to align glyphs to the margin.
/// </summary>
enum DWRITE_OPTICAL_ALIGNMENT
{
/// <summary>
/// Align to the default metrics of the glyph.
/// </summary>
DWRITE_OPTICAL_ALIGNMENT_NONE,
/// <summary>
/// Align glyphs to the margins. Without this, some small whitespace
/// may be present between the text and the margin from the glyph's side
/// bearing values. Note that glyphs may still overhang outside the
/// margin, such as flourishes or italic slants.
/// </summary>
DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS,
};
/// <summary>
/// Whether to enable grid-fitting of glyph outlines (a.k.a. hinting).
/// </summary>
enum DWRITE_GRID_FIT_MODE
{
/// <summary>
/// Choose grid fitting base on the font's gasp table information.
/// </summary>
DWRITE_GRID_FIT_MODE_DEFAULT,
/// <summary>
/// Always disable grid fitting, using the ideal glyph outlines.
/// </summary>
DWRITE_GRID_FIT_MODE_DISABLED,
/// <summary>
/// Enable grid fitting, adjusting glyph outlines for device pixel display.
/// </summary>
DWRITE_GRID_FIT_MODE_ENABLED
};
/// <summary>
/// Overall metrics associated with text after layout.
/// All coordinates are in device independent pixels (DIPs).
/// </summary>
struct DWRITE_TEXT_METRICS1 : DWRITE_TEXT_METRICS
{
/// <summary>
/// The height of the formatted text taking into account the
/// trailing whitespace at the end of each line, which will
/// matter for vertical reading directions.
/// </summary>
FLOAT heightIncludingTrailingWhitespace;
};
/// <summary>
/// The text renderer interface represents a set of application-defined
/// callbacks that perform rendering of text, inline objects, and decorations
/// such as underlines.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("D3E0E934-22A0-427E-AAE4-7D9574B59DB1") IDWriteTextRenderer1 : public IDWriteTextRenderer
{
/// <summary>
/// IDWriteTextLayout::Draw calls this function to instruct the client to
/// render a run of glyphs.
/// </summary>
/// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param>
/// <param name="baselineOriginX">X-coordinate of the baseline.</param>
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
/// <param name="orientationAngle">Orientation of the glyph run.</param>
/// <param name="measuringMode">Specifies measuring method for glyphs in
/// the run. Renderer implementations may choose different rendering
/// modes for given measuring methods, but best results are seen when
/// the rendering mode matches the corresponding measuring mode:
/// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
/// </param>
/// <param name="glyphRun">The glyph run to draw.</param>
/// <param name="glyphRunDescription">Properties of the characters
/// associated with this run.</param>
/// <param name="clientDrawingEffect">The drawing effect set in
/// IDWriteTextLayout::SetDrawingEffect.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// If a non-identity orientation is passed, the glyph run should be
/// rotated around the given baseline x and y coordinates. The function
/// IDWriteAnalyzer2::GetGlyphOrientationTransform will return the
/// necessary transform for you, which can be combined with any existing
/// world transform on the drawing context.
/// </remarks>
STDMETHOD(DrawGlyphRun)(
_In_opt_ void* clientDrawingContext,
FLOAT baselineOriginX,
FLOAT baselineOriginY,
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
DWRITE_MEASURING_MODE measuringMode,
_In_ DWRITE_GLYPH_RUN const* glyphRun,
_In_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
_In_opt_ IUnknown* clientDrawingEffect
) PURE;
/// <summary>
/// IDWriteTextLayout::Draw calls this function to instruct the client to draw
/// an underline.
/// </summary>
/// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param>
/// <param name="baselineOriginX">X-coordinate of the baseline.</param>
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
/// <param name="orientationAngle">Orientation of the underline.</param>
/// <param name="underline">Underline logical information.</param>
/// <param name="clientDrawingEffect">The drawing effect set in
/// IDWriteTextLayout::SetDrawingEffect.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// A single underline can be broken into multiple calls, depending on
/// how the formatting changes attributes. If font sizes/styles change
/// within an underline, the thickness and offset will be averaged
/// weighted according to characters.
///
/// To get the correct top coordinate of the underline rect, add
/// underline::offset to the baseline's Y. Otherwise the underline will
/// be immediately under the text. The x coordinate will always be passed
/// as the left side, regardless of text directionality. This simplifies
/// drawing and reduces the problem of round-off that could potentially
/// cause gaps or a double stamped alpha blend. To avoid alpha overlap,
/// round the end points to the nearest device pixel.
/// </remarks>
STDMETHOD(DrawUnderline)(
_In_opt_ void* clientDrawingContext,
FLOAT baselineOriginX,
FLOAT baselineOriginY,
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
_In_ DWRITE_UNDERLINE const* underline,
_In_opt_ IUnknown* clientDrawingEffect
) PURE;
/// <summary>
/// IDWriteTextLayout::Draw calls this function to instruct the client to draw
/// a strikethrough.
/// </summary>
/// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param>
/// <param name="baselineOriginX">X-coordinate of the baseline.</param>
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
/// <param name="orientationAngle">Orientation of the strikethrough.</param>
/// <param name="strikethrough">Strikethrough logical information.</param>
/// <param name="clientDrawingEffect">The drawing effect set in
/// IDWriteTextLayout::SetDrawingEffect.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// A single strikethrough can be broken into multiple calls, depending on
/// how the formatting changes attributes. Strikethrough is not averaged
/// across font sizes/styles changes.
/// To get the correct top coordinate of the strikethrough rect,
/// add strikethrough::offset to the baseline's Y.
/// Like underlines, the x coordinate will always be passed as the left side,
/// regardless of text directionality.
/// </remarks>
STDMETHOD(DrawStrikethrough)(
_In_opt_ void* clientDrawingContext,
FLOAT baselineOriginX,
FLOAT baselineOriginY,
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
_In_ DWRITE_STRIKETHROUGH const* strikethrough,
_In_opt_ IUnknown* clientDrawingEffect
) PURE;
/// <summary>
/// IDWriteTextLayout::Draw calls this application callback when it needs to
/// draw an inline object.
/// </summary>
/// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param>
/// <param name="originX">X-coordinate at the top-left corner of the
/// inline object.</param>
/// <param name="originY">Y-coordinate at the top-left corner of the
/// inline object.</param>
/// <param name="orientationAngle">Orientation of the inline object.</param>
/// <param name="inlineObject">The object set using IDWriteTextLayout::SetInlineObject.</param>
/// <param name="isSideways">The object should be drawn on its side.</param>
/// <param name="isRightToLeft">The object is in an right-to-left context
/// and should be drawn flipped.</param>
/// <param name="clientDrawingEffect">The drawing effect set in
/// IDWriteTextLayout::SetDrawingEffect.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// The right-to-left flag is a hint to draw the appropriate visual for
/// that reading direction. For example, it would look strange to draw an
/// arrow pointing to the right to indicate a submenu. The sideways flag
/// similarly hints that the object is drawn in a different orientation.
/// If a non-identity orientation is passed, the top left of the inline
/// object should be rotated around the given x and y coordinates.
/// IDWriteAnalyzer2::GetGlyphOrientationTransform returns the necessary
/// transform for this.
/// </remarks>
STDMETHOD(DrawInlineObject)(
_In_opt_ void* clientDrawingContext,
FLOAT originX,
FLOAT originY,
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
_In_ IDWriteInlineObject* inlineObject,
BOOL isSideways,
BOOL isRightToLeft,
_In_opt_ IUnknown* clientDrawingEffect
) PURE;
using IDWriteTextRenderer::DrawGlyphRun;
using IDWriteTextRenderer::DrawUnderline;
using IDWriteTextRenderer::DrawStrikethrough;
using IDWriteTextRenderer::DrawInlineObject;
};
/// <summary>
/// The format of text used for text layout.
/// </summary>
/// <remarks>
/// This object may not be thread-safe and it may carry the state of text format change.
/// </remarks>
interface DWRITE_DECLARE_INTERFACE("5F174B49-0D8B-4CFB-8BCA-F1CCE9D06C67") IDWriteTextFormat1 : public IDWriteTextFormat
{
/// <summary>
/// Set the preferred orientation of glyphs when using a vertical reading direction.
/// </summary>
/// <param name="glyphOrientation">Preferred glyph orientation.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetVerticalGlyphOrientation)(
DWRITE_VERTICAL_GLYPH_ORIENTATION glyphOrientation
) PURE;
/// <summary>
/// Get the preferred orientation of glyphs when using a vertical reading
/// direction.
/// </summary>
STDMETHOD_(DWRITE_VERTICAL_GLYPH_ORIENTATION, GetVerticalGlyphOrientation)() PURE;
/// <summary>
/// Set whether or not the last word on the last line is wrapped.
/// </summary>
/// <param name="isLastLineWrappingEnabled">Line wrapping option.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetLastLineWrapping)(
BOOL isLastLineWrappingEnabled
) PURE;
/// <summary>
/// Get whether or not the last word on the last line is wrapped.
/// </summary>
STDMETHOD_(BOOL, GetLastLineWrapping)() PURE;
/// <summary>
/// Set how the glyphs align to the edges the margin. Default behavior is
/// to align glyphs using their default glyphs metrics which include side
/// bearings.
/// </summary>
/// <param name="opticalAlignment">Optical alignment option.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetOpticalAlignment)(
DWRITE_OPTICAL_ALIGNMENT opticalAlignment
) PURE;
/// <summary>
/// Get how the glyphs align to the edges the margin.
/// </summary>
STDMETHOD_(DWRITE_OPTICAL_ALIGNMENT, GetOpticalAlignment)() PURE;
/// <summary>
/// Apply a custom font fallback onto layout. If none is specified,
/// layout uses the system fallback list.
/// </summary>
/// <param name="fontFallback">Custom font fallback created from
/// IDWriteFontFallbackBuilder::CreateFontFallback or from
/// IDWriteFactory2::GetSystemFontFallback.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetFontFallback)(
IDWriteFontFallback* fontFallback
) PURE;
/// <summary>
/// Get the current font fallback object.
/// </summary>
STDMETHOD(GetFontFallback)(
__out IDWriteFontFallback** fontFallback
) PURE;
};
/// <summary>
/// The text layout interface represents a block of text after it has
/// been fully analyzed and formatted.
///
/// All coordinates are in device independent pixels (DIPs).
/// </summary>
interface DWRITE_DECLARE_INTERFACE("1093C18F-8D5E-43F0-B064-0917311B525E") IDWriteTextLayout2 : public IDWriteTextLayout1
{
/// <summary>
/// GetMetrics retrieves overall metrics for the formatted string.
/// </summary>
/// <param name="textMetrics">The returned metrics.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// Drawing effects like underline and strikethrough do not contribute
/// to the text size, which is essentially the sum of advance widths and
/// line heights. Additionally, visible swashes and other graphic
/// adornments may extend outside the returned width and height.
/// </remarks>
STDMETHOD(GetMetrics)(
_Out_ DWRITE_TEXT_METRICS1* textMetrics
) PURE;
using IDWriteTextLayout::GetMetrics;
/// <summary>
/// Set the preferred orientation of glyphs when using a vertical reading direction.
/// </summary>
/// <param name="glyphOrientation">Preferred glyph orientation.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetVerticalGlyphOrientation)(
DWRITE_VERTICAL_GLYPH_ORIENTATION glyphOrientation
) PURE;
/// <summary>
/// Get the preferred orientation of glyphs when using a vertical reading
/// direction.
/// </summary>
STDMETHOD_(DWRITE_VERTICAL_GLYPH_ORIENTATION, GetVerticalGlyphOrientation)() PURE;
/// <summary>
/// Set whether or not the last word on the last line is wrapped.
/// </summary>
/// <param name="isLastLineWrappingEnabled">Line wrapping option.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetLastLineWrapping)(
BOOL isLastLineWrappingEnabled
) PURE;
/// <summary>
/// Get whether or not the last word on the last line is wrapped.
/// </summary>
STDMETHOD_(BOOL, GetLastLineWrapping)() PURE;
/// <summary>
/// Set how the glyphs align to the edges the margin. Default behavior is
/// to align glyphs using their default glyphs metrics which include side
/// bearings.
/// </summary>
/// <param name="opticalAlignment">Optical alignment option.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetOpticalAlignment)(
DWRITE_OPTICAL_ALIGNMENT opticalAlignment
) PURE;
/// <summary>
/// Get how the glyphs align to the edges the margin.
/// </summary>
STDMETHOD_(DWRITE_OPTICAL_ALIGNMENT, GetOpticalAlignment)() PURE;
/// <summary>
/// Apply a custom font fallback onto layout. If none is specified,
/// layout uses the system fallback list.
/// </summary>
/// <param name="fontFallback">Custom font fallback created from
/// IDWriteFontFallbackBuilder::CreateFontFallback or
/// IDWriteFactory2::GetSystemFontFallback.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(SetFontFallback)(
IDWriteFontFallback* fontFallback
) PURE;
/// <summary>
/// Get the current font fallback object.
/// </summary>
STDMETHOD(GetFontFallback)(
__out IDWriteFontFallback** fontFallback
) PURE;
};
/// <summary>
/// The text analyzer interface represents a set of application-defined
/// callbacks that perform rendering of text, inline objects, and decorations
/// such as underlines.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("553A9FF3-5693-4DF7-B52B-74806F7F2EB9") IDWriteTextAnalyzer2 : public IDWriteTextAnalyzer1
{
/// <summary>
/// Returns 2x3 transform matrix for the respective angle to draw the
/// glyph run or other object.
/// </summary>
/// <param name="glyphOrientationAngle">The angle reported to one of the application callbacks,
/// including IDWriteTextAnalysisSink1::SetGlyphOrientation and IDWriteTextRenderer1::Draw*.</param>
/// <param name="isSideways">Whether the run's glyphs are sideways or not.</param>
/// <param name="originX">X origin of the element, be it a glyph run or underline or other.</param>
/// <param name="originY">Y origin of the element, be it a glyph run or underline or other.</param>
/// <param name="transform">Returned transform.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// This rotates around the given origin x and y, returning a translation component
/// such that the glyph run, text decoration, or inline object is drawn with the
/// right orientation at the expected coordinate.
/// </remarks>
STDMETHOD(GetGlyphOrientationTransform)(
DWRITE_GLYPH_ORIENTATION_ANGLE glyphOrientationAngle,
BOOL isSideways,
FLOAT originX,
FLOAT originY,
_Out_ DWRITE_MATRIX* transform
) PURE;
/// <summary>
/// Returns a list of typographic feature tags for the given script and language.
/// </summary>
/// <param name="fontFace">The font face to get features from.</param>
/// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
/// <param name="localeName">The locale to use when selecting the feature,
/// such en-us or ja-jp.</param>
/// <param name="maxTagCount">Maximum tag count.</param>
/// <param name="actualTagCount">Actual tag count. If greater than
/// maxTagCount, E_NOT_SUFFICIENT_BUFFER is returned, and the call
/// should be retried with a larger buffer.</param>
/// <param name="tags">Feature tag list.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetTypographicFeatures)(
IDWriteFontFace* fontFace,
DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
_In_opt_z_ WCHAR const* localeName,
UINT32 maxTagCount,
_Out_ UINT32* actualTagCount,
_Out_writes_(maxTagCount) DWRITE_FONT_FEATURE_TAG* tags
) PURE;
/// <summary>
/// Returns an array of which glyphs are affected by a given feature.
/// </summary>
/// <param name="fontFace">The font face to read glyph information from.</param>
/// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
/// <param name="localeName">The locale to use when selecting the feature,
/// such en-us or ja-jp.</param>
/// <param name="featureTag">OpenType feature name to use, which may be one
/// of the DWRITE_FONT_FEATURE_TAG values or a custom feature using
/// DWRITE_MAKE_OPENTYPE_TAG.</param>
/// <param name="glyphCount">Number of glyph indices to check.</param>
/// <param name="glyphIndices">Glyph indices to check for feature application.</param>
/// <param name="featureApplies">Output of which glyphs are affected by the
/// feature, where for each glyph affected, the respective array index
/// will be 1. The result is returned per-glyph without regard to
/// neighboring context of adjacent glyphs.</param>
/// </remarks>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CheckTypographicFeature)(
IDWriteFontFace* fontFace,
DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
_In_opt_z_ WCHAR const* localeName,
DWRITE_FONT_FEATURE_TAG featureTag,
UINT32 glyphCount,
_In_reads_(glyphCount) UINT16 const* glyphIndices,
_Out_writes_(glyphCount) UINT8* featureApplies
) PURE;
using IDWriteTextAnalyzer1::GetGlyphOrientationTransform;
};
/// <summary>
/// A font fallback definition used for mapping characters to fonts capable of
/// supporting them.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("EFA008F9-F7A1-48BF-B05C-F224713CC0FF") IDWriteFontFallback : public IUnknown
{
/// <summary>
/// Determines an appropriate font to use to render the range of text.
/// </summary>
/// <param name="source">The text source implementation holds the text and
/// locale.</param>
/// <param name="textLength">Length of the text to analyze.</param>
/// <param name="baseFontCollection">Default font collection to use.</param>
/// <param name="baseFamilyName">Family name of the base font. If you pass
/// null, no matching will be done against the family.</param>
/// <param name="baseWeight">Desired weight.</param>
/// <param name="baseStyle">Desired style.</param>
/// <param name="baseStretch">Desired stretch.</param>
/// <param name="mappedLength">Length of text mapped to the mapped font.
/// This will always be less or equal to the input text length and
/// greater than zero (if the text length is non-zero) so that the
/// caller advances at least one character each call.</param>
/// <param name="mappedFont">The font that should be used to render the
/// first mappedLength characters of the text. If it returns NULL,
/// then no known font can render the text, and mappedLength is the
/// number of unsupported characters to skip.</param>
/// <param name="scale">Scale factor to multiply the em size of the
/// returned font by.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(MapCharacters)(
IDWriteTextAnalysisSource* analysisSource,
UINT32 textPosition,
UINT32 textLength,
_In_opt_ IDWriteFontCollection* baseFontCollection,
_In_opt_z_ wchar_t const* baseFamilyName,
DWRITE_FONT_WEIGHT baseWeight,
DWRITE_FONT_STYLE baseStyle,
DWRITE_FONT_STRETCH baseStretch,
_Out_range_(0, textLength) UINT32* mappedLength,
_COM_Outptr_result_maybenull_ IDWriteFont** mappedFont,
_Out_ FLOAT* scale
) PURE;
};
/// <summary>
/// Builder used to create a font fallback definition by appending a series of
/// fallback mappings, followed by a creation call.
/// </summary>
/// <remarks>
/// This object may not be thread-safe.
/// </remarks>
interface DWRITE_DECLARE_INTERFACE("FD882D06-8ABA-4FB8-B849-8BE8B73E14DE") IDWriteFontFallbackBuilder : public IUnknown
{
/// <summary>
/// Appends a single mapping to the list. Call this once for each additional mapping.
/// </summary>
/// <param name="ranges">Unicode ranges that apply to this mapping.</param>
/// <param name="rangesCount">Number of Unicode ranges.</param>
/// <param name="localeName">Locale of the context (e.g. document locale).</param>
/// <param name="baseFamilyName">Base family name to match against, if applicable.</param>
/// <param name="fontCollection">Explicit font collection for this mapping (optional).</param>
/// <param name="targetFamilyNames">List of target family name strings.</param>
/// <param name="targetFamilyNamesCount">Number of target family names.</param>
/// <param name="scale">Scale factor to multiply the result target font by.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(AddMapping)(
_In_reads_(rangesCount) DWRITE_UNICODE_RANGE const* ranges,
UINT32 rangesCount,
_In_reads_(targetFamilyNamesCount) WCHAR const** targetFamilyNames,
UINT32 targetFamilyNamesCount,
_In_opt_ IDWriteFontCollection* fontCollection = NULL,
_In_opt_z_ WCHAR const* localeName = NULL,
_In_opt_z_ WCHAR const* baseFamilyName = NULL,
FLOAT scale = 1.0f
) PURE;
/// <summary>
/// Appends all the mappings from an existing font fallback object.
/// </summary>
/// <param name="fontFallback">Font fallback to read mappings from.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(AddMappings)(
IDWriteFontFallback* fontFallback
) PURE;
/// <summary>
/// Creates the finalized fallback object from the mappings added.
/// </summary>
/// <param name="fontFallback">Created fallback list.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateFontFallback)(
_COM_Outptr_ IDWriteFontFallback** fontFallback
) PURE;
};
/// <summary>
/// DWRITE_COLOR_F
/// </summary>
#ifndef D3DCOLORVALUE_DEFINED
typedef struct _D3DCOLORVALUE {
union {
FLOAT r;
FLOAT dvR;
};
union {
FLOAT g;
FLOAT dvG;
};
union {
FLOAT b;
FLOAT dvB;
};
union {
FLOAT a;
FLOAT dvA;
};
} D3DCOLORVALUE;
#define D3DCOLORVALUE_DEFINED
#endif // D3DCOLORVALUE_DEFINED
typedef D3DCOLORVALUE DWRITE_COLOR_F;
/// <summary>
/// The IDWriteFont interface represents a physical font in a font collection.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("29748ed6-8c9c-4a6a-be0b-d912e8538944") IDWriteFont2 : public IDWriteFont1
{
/// <summary>
/// Returns TRUE if the font contains tables that can provide color information
/// (including COLR, CPAL, SVG, CBDT, sbix tables), or FALSE if not. Note that
/// TRUE is returned even in the case when the font tables contain only grayscale
/// images.
/// </summary>
STDMETHOD_(BOOL, IsColorFont)() PURE;
};
/// <summary>
/// The interface that represents an absolute reference to a font face.
/// It contains font face type, appropriate file references and face identification data.
/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("d8b768ff-64bc-4e66-982b-ec8e87f693f7") IDWriteFontFace2 : public IDWriteFontFace1
{
/// <summary>
/// Returns TRUE if the font contains tables that can provide color information
/// (including COLR, CPAL, SVG, CBDT, sbix tables), or FALSE if not. Note that
/// TRUE is returned even in the case when the font tables contain only grayscale
/// images.
/// </summary>
STDMETHOD_(BOOL, IsColorFont)() PURE;
/// <summary>
/// Returns the number of color palettes defined by the font. The return
/// value is zero if the font has no color information. Color fonts must
/// have at least one palette, with palette index zero being the default.
/// </summary>
STDMETHOD_(UINT32, GetColorPaletteCount)() PURE;
/// <summary>
/// Returns the number of entries in each color palette. All color palettes
/// in a font have the same number of palette entries. The return value is
/// zero if the font has no color information.
/// </summary>
STDMETHOD_(UINT32, GetPaletteEntryCount)() PURE;
/// <summary>
/// Reads color values from the font's color palette.
/// </summary>
/// <param name="colorPaletteIndex">Zero-based index of the color palette. If the
/// font does not have a palette with the specified index, the method returns
/// DWRITE_E_NOCOLOR.<param>
/// <param name="firstEntryIndex">Zero-based index of the first palette entry
/// to read.</param>
/// <param name="entryCount">Number of palette entries to read.</param>
/// <param name="paletteEntries">Array that receives the color values.<param>
/// <returns>
/// Standard HRESULT error code.
/// The return value is E_INVALIDARG if firstEntryIndex + entryCount is greater
/// than the actual number of palette entries as returned by GetPaletteEntryCount.
/// The return value is DWRITE_E_NOCOLOR if the font does not have a palette
/// with the specified palette index.
/// </returns>
STDMETHOD(GetPaletteEntries)(
UINT32 colorPaletteIndex,
UINT32 firstEntryIndex,
UINT32 entryCount,
_Out_writes_(entryCount) DWRITE_COLOR_F* paletteEntries
) PURE;
/// <summary>
/// Determines the recommended text rendering and grid-fit mode to be used based on the
/// font, size, world transform, and measuring mode.
/// </summary>
/// <param name="fontEmSize">Logical font size in DIPs.</param>
/// <param name="dpiX">Number of pixels per logical inch in the horizontal direction.</param>
/// <param name="dpiY">Number of pixels per logical inch in the vertical direction.</param>
/// <param name="transform">Specifies the world transform.</param>
/// <param name="outlineThreshold">Specifies the quality of the graphics system's outline rendering,
/// affects the size threshold above which outline rendering is used.</param>
/// <param name="measuringMode">Specifies the method used to measure during text layout. For proper
/// glyph spacing, the function returns a rendering mode that is compatible with the specified
/// measuring mode.</param>
/// <param name="renderingParams">Rendering parameters object. This parameter is necessary in case the rendering parameters
/// object overrides the rendering mode.</param>
/// <param name="renderingMode">Receives the recommended rendering mode.</param>
/// <param name="gridFitMode">Receives the recommended grid-fit mode.</param>
/// <remarks>
/// This method should be used to determine the actual rendering mode in cases where the rendering
/// mode of the rendering params object is DWRITE_RENDERING_MODE_DEFAULT, and the actual grid-fit
/// mode when the rendering params object is DWRITE_GRID_FIT_MODE_DEFAULT.
/// </remarks>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetRecommendedRenderingMode)(
FLOAT fontEmSize,
FLOAT dpiX,
FLOAT dpiY,
_In_opt_ DWRITE_MATRIX const* transform,
BOOL isSideways,
DWRITE_OUTLINE_THRESHOLD outlineThreshold,
DWRITE_MEASURING_MODE measuringMode,
_In_opt_ IDWriteRenderingParams* renderingParams,
_Out_ DWRITE_RENDERING_MODE* renderingMode,
_Out_ DWRITE_GRID_FIT_MODE* gridFitMode
) PURE;
using IDWriteFontFace1::GetRecommendedRenderingMode;
};
/// <summary>
/// Represents a color glyph run. The IDWriteFactory2::TranslateColorGlyphRun
/// method returns an ordered collection of color glyph runs, which can be
/// layered on top of each other to produce a color representation of the
/// given base glyph run.
/// </summary>
struct DWRITE_COLOR_GLYPH_RUN
{
/// <summary>
/// Glyph run to render.
/// </summary>
DWRITE_GLYPH_RUN glyphRun;
/// <summary>
/// Optional glyph run description.
/// </summary>
_Maybenull_ DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription;
/// <summary>
/// Location at which to draw this glyph run.
/// </summary>
FLOAT baselineOriginX;
FLOAT baselineOriginY;
/// <summary>
/// Color to use for this layer, if any. This is the same color that
/// IDWriteFontFace2::GetPaletteEntries would return for the current
/// palette index if the paletteIndex member is less than 0xFFFF. If
/// the paletteIndex member is 0xFFFF then there is no associated
/// palette entry, this member is set to { 0, 0, 0, 0 }, and the client
/// should use the current foreground brush.
/// </summary>
DWRITE_COLOR_F runColor;
/// <summary>
/// Zero-based index of this layer's color entry in the current color
/// palette, or 0xFFFF if this layer is to be rendered using
/// the current foreground brush.
/// </summary>
UINT16 paletteIndex;
};
/// <summary>
/// Enumerator for an ordered collection of color glyph runs.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("d31fbe17-f157-41a2-8d24-cb779e0560e8") IDWriteColorGlyphRunEnumerator : public IUnknown
{
/// <summary>
/// Advances to the first or next color run. The runs are enumerated
/// in order from back to front.
/// </summary>
/// <param name="hasRun">Receives TRUE if there is a current run or
/// FALSE if the end of the sequence has been reached.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(MoveNext)(
_Out_ BOOL* hasRun
) PURE;
/// <summary>
/// Gets the current color glyph run.
/// </summary>
/// <param name="colorGlyphRun">Receives a pointer to the color
/// glyph run. The pointer remains valid until the next call to
/// MoveNext or until the interface is released.</param>
/// <returns>
/// Standard HRESULT error code. An error is returned if there is
/// no current glyph run, i.e., if MoveNext has not yet been called
/// or if the end of the sequence has been reached.
/// </returns>
STDMETHOD(GetCurrentRun)(
_Outptr_ DWRITE_COLOR_GLYPH_RUN const** colorGlyphRun
) PURE;
};
/// <summary>
/// The interface that represents text rendering settings for glyph rasterization and filtering.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("F9D711C3-9777-40AE-87E8-3E5AF9BF0948") IDWriteRenderingParams2 : public IDWriteRenderingParams1
{
/// <summary>
/// Gets the grid fitting mode.
/// </summary>
STDMETHOD_(DWRITE_GRID_FIT_MODE, GetGridFitMode)() PURE;
};
/// <summary>
/// The root factory interface for all DWrite objects.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("0439fc60-ca44-4994-8dee-3a9af7b732ec") IDWriteFactory2 : public IDWriteFactory1
{
/// <summary>
/// Get the system-appropriate font fallback mapping list.
/// </summary>
/// <param name="fontFallback">The system fallback list.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetSystemFontFallback)(
_COM_Outptr_ IDWriteFontFallback** fontFallback
) PURE;
/// <summary>
/// Create a custom font fallback builder.
/// </summary>
/// <param name="fontFallbackBuilder">Empty font fallback builder.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateFontFallbackBuilder)(
_COM_Outptr_ IDWriteFontFallbackBuilder** fontFallbackBuilder
) PURE;
/// <summary>
/// Translates a glyph run to a sequence of color glyph runs, which can be
/// rendered to produce a color representation of the original "base" run.
/// </summary>
/// <param name="baselineOriginX">Horizontal origin of the base glyph run in
/// pre-transform coordinates.</param>
/// <param name="baselineOriginY">Vertical origin of the base glyph run in
/// pre-transform coordinates.</param>
/// <param name="glyphRun">Pointer to the original "base" glyph run.</param>
/// <param name="glyphRunDescription">Optional glyph run description.</param>
/// <param name="measuringMode">Measuring mode, needed to compute the origins
/// of each glyph.</param>
/// <param name="worldToDeviceTransform">Matrix converting from the client's
/// coordinate space to device coordinates (pixels), i.e., the world transform
/// multiplied by any DPI scaling.</param>
/// <param name="colorPaletteIndex">Zero-based index of the color palette to use.
/// Valid indices are less than the number of palettes in the font, as returned
/// by IDWriteFontFace2::GetColorPaletteCount.</param>
/// <param name="colorLayers">If the function succeeds, receives a pointer
/// to an enumerator object that can be used to obtain the color glyph runs.
/// If the base run has no color glyphs, then the output pointer is NULL
/// and the method returns DWRITE_E_NOCOLOR.</param>
/// <returns>
/// Returns DWRITE_E_NOCOLOR if the font has no color information, the base
/// glyph run does not contain any color glyphs, or the specified color palette
/// index is out of range. In this case, the client should render the base glyph
/// run. Otherwise, returns a standard HRESULT error code.
/// </returns>
STDMETHOD(TranslateColorGlyphRun)(
FLOAT baselineOriginX,
FLOAT baselineOriginY,
_In_ DWRITE_GLYPH_RUN const* glyphRun,
_In_opt_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
DWRITE_MEASURING_MODE measuringMode,
_In_opt_ DWRITE_MATRIX const* worldToDeviceTransform,
UINT32 colorPaletteIndex,
_COM_Outptr_ IDWriteColorGlyphRunEnumerator** colorLayers
) PURE;
/// <summary>
/// Creates a rendering parameters object with the specified properties.
/// </summary>
/// <param name="gamma">The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256.</param>
/// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param>
/// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType).</param>
/// <param name="pixelGeometry">The geometry of a device pixel.</param>
/// <param name="renderingMode">Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param>
/// <param name="gridFitMode">How to grid fit glyph outlines. In most cases, this should be DWRITE_GRID_FIT_DEFAULT to automatically choose an appropriate mode.</param>
/// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateCustomRenderingParams)(
FLOAT gamma,
FLOAT enhancedContrast,
FLOAT grayscaleEnhancedContrast,
FLOAT clearTypeLevel,
DWRITE_PIXEL_GEOMETRY pixelGeometry,
DWRITE_RENDERING_MODE renderingMode,
DWRITE_GRID_FIT_MODE gridFitMode,
_COM_Outptr_ IDWriteRenderingParams2** renderingParams
) PURE;
using IDWriteFactory::CreateCustomRenderingParams;
using IDWriteFactory1::CreateCustomRenderingParams;
/// <summary>
/// Creates a glyph run analysis object, which encapsulates information
/// used to render a glyph run.
/// </summary>
/// <param name="glyphRun">Structure specifying the properties of the glyph run.</param>
/// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
/// scaling specified by the emSize and pixelsPerDip.</param>
/// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default
/// and not outline).</param>
/// <param name="measuringMode">Specifies the method to measure glyphs.</param>
/// <param name="gridFitMode">How to grid-fit glyph outlines. This must be non-default.</param>
/// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs.</param>
/// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param>
/// <param name="glyphRunAnalysis">Receives a pointer to the newly created object.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateGlyphRunAnalysis)(
_In_ DWRITE_GLYPH_RUN const* glyphRun,
_In_opt_ DWRITE_MATRIX const* transform,
DWRITE_RENDERING_MODE renderingMode,
DWRITE_MEASURING_MODE measuringMode,
DWRITE_GRID_FIT_MODE gridFitMode,
DWRITE_TEXT_ANTIALIAS_MODE antialiasMode,
FLOAT baselineOriginX,
FLOAT baselineOriginY,
_COM_Outptr_ IDWriteGlyphRunAnalysis** glyphRunAnalysis
) PURE;
using IDWriteFactory::CreateGlyphRunAnalysis;
};
#endif /* DWRITE_2_H_INCLUDED */

3489
gfx/include/dxsdk/dwrite_3.h Normal file

File diff suppressed because it is too large Load Diff

196
gfx/include/dxsdk/dxdiag.h Normal file
View File

@ -0,0 +1,196 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: dxdiag.h
* Content: DirectX Diagnostic Tool include file
*
****************************************************************************/
#ifndef _DXDIAG_H_
#define _DXDIAG_H_
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
// This identifier is passed to IDxDiagProvider::Initialize in order to ensure that an
// application was built against the correct header files. This number is
// incremented whenever a header (or other) change would require applications
// to be rebuilt. If the version doesn't match, IDxDiagProvider::Initialize will fail.
// (The number itself has no meaning.)
#define DXDIAG_DX9_SDK_VERSION 111
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* DxDiag Errors
*
****************************************************************************/
#define DXDIAG_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
/****************************************************************************
*
* DxDiag CLSIDs
*
****************************************************************************/
// {A65B8071-3BFE-4213-9A5B-491DA4461CA7}
DEFINE_GUID(CLSID_DxDiagProvider,
0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7);
/****************************************************************************
*
* DxDiag Interface IIDs
*
****************************************************************************/
// {9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2}
DEFINE_GUID(IID_IDxDiagProvider,
0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2);
// {0x7D0F462F-0x4064-0x4862-BC7F-933E5058C10F}
DEFINE_GUID(IID_IDxDiagContainer,
0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F);
/****************************************************************************
*
* DxDiag Interface Pointer definitions
*
****************************************************************************/
typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
/****************************************************************************
*
* DxDiag Structures
*
****************************************************************************/
typedef struct _DXDIAG_INIT_PARAMS
{
DWORD dwSize; // Size of this structure.
DWORD dwDxDiagHeaderVersion; // Pass in DXDIAG_DX9_SDK_VERSION. This verifies
// the header and dll are correctly matched.
BOOL bAllowWHQLChecks; // If true, allow dxdiag to check if drivers are
// digital signed as logo'd by WHQL which may
// connect via internet to update WHQL certificates.
VOID* pReserved; // Reserved. Must be NULL.
} DXDIAG_INIT_PARAMS;
/****************************************************************************
*
* DxDiag Application Interfaces
*
****************************************************************************/
//
// COM definition for IDxDiagProvider
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDxDiagProvider
DECLARE_INTERFACE_(IDxDiagProvider,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDxDiagProvider methods ***/
STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE;
STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE;
};
//
// COM definition for IDxDiagContainer
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDxDiagContainer
DECLARE_INTERFACE_(IDxDiagContainer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDxDiagContainer methods ***/
STDMETHOD(GetNumberOfChildContainers) (THIS_ DWORD *pdwCount) PURE;
STDMETHOD(EnumChildContainerNames) (THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE;
STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE;
STDMETHOD(GetNumberOfProps) (THIS_ DWORD *pdwCount) PURE;
STDMETHOD(EnumPropNames) (THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE;
STDMETHOD(GetProp) (THIS_ LPCWSTR pwszPropName, VARIANT *pvarProp) PURE;
};
/****************************************************************************
*
* DxDiag application interface macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p)
#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a)
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p)
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a)
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c)
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b)
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a)
#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c)
#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b)
#else /* C++ */
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
#define IDxDiagProvider_AddRef(p) (p)->AddRef(p)
#define IDxDiagProvider_Release(p) (p)->Release(p)
#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(p,a,b)
#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(p,a)
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
#define IDxDiagContainer_AddRef(p) (p)->AddRef(p)
#define IDxDiagContainer_Release(p) (p)->Release(p)
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(p,a)
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(p,a,b,c)
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(p,a,b)
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(p,a)
#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(p,a,b,c)
#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(p,a,b)
#endif
#ifdef __cplusplus
}
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif /* _DXDIAG_H_ */

99
gfx/include/dxsdk/dxerr.h Normal file
View File

@ -0,0 +1,99 @@
/*==========================================================================;
*
*
* File: dxerr.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _DXERR_H_
#define _DXERR_H_
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//
// DXGetErrorString
//
// Desc: Converts a DirectX HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW
//
// Return: Converted string
//
const char* WINAPI DXGetErrorStringA(__in HRESULT hr);
const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString DXGetErrorStringW
#else
#define DXGetErrorString DXGetErrorStringA
#endif
//
// DXGetErrorDescription
//
// Desc: Returns a string description of a DirectX HRESULT
//
// Args: HRESULT hr Can be any error code from
// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW
//
// Return: String description
//
const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr);
const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr);
#ifdef UNICODE
#define DXGetErrorDescription DXGetErrorDescriptionW
#else
#define DXGetErrorDescription DXGetErrorDescriptionA
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox );
HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox );
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // _DXERR_H_

239
gfx/include/dxsdk/dxfile.h Normal file
View File

@ -0,0 +1,239 @@
/***************************************************************************
*
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
*
* File: dxfile.h
*
* Content: DirectX File public header file
*
***************************************************************************/
#ifndef __DXFILE_H__
#define __DXFILE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef DWORD DXFILEFORMAT;
#define DXFILEFORMAT_BINARY 0
#define DXFILEFORMAT_TEXT 1
#define DXFILEFORMAT_COMPRESSED 2
typedef DWORD DXFILELOADOPTIONS;
#define DXFILELOAD_FROMFILE 0x00L
#define DXFILELOAD_FROMRESOURCE 0x01L
#define DXFILELOAD_FROMMEMORY 0x02L
#define DXFILELOAD_FROMSTREAM 0x04L
#define DXFILELOAD_FROMURL 0x08L
typedef struct _DXFILELOADRESOURCE {
HMODULE hModule;
LPCTSTR lpName;
LPCTSTR lpType;
}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE;
typedef struct _DXFILELOADMEMORY {
LPVOID lpMemory;
DWORD dSize;
}DXFILELOADMEMORY, *LPDXFILELOADMEMORY;
/*
* DirectX File object types.
*/
#ifndef WIN_TYPES
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
#endif
WIN_TYPES(IDirectXFile, DIRECTXFILE);
WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT);
WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT);
WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT);
WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA);
WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE);
WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY);
/*
* API for creating IDirectXFile interface.
*/
STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile);
/*
* The methods for IUnknown
*/
#define IUNKNOWN_METHODS(kind) \
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \
STDMETHOD_(ULONG, AddRef) (THIS) kind; \
STDMETHOD_(ULONG, Release) (THIS) kind
/*
* The methods for IDirectXFileObject
*/
#define IDIRECTXFILEOBJECT_METHODS(kind) \
STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \
STDMETHOD(GetId) (THIS_ LPGUID) kind
/*
* DirectX File interfaces.
*/
#undef INTERFACE
#define INTERFACE IDirectXFile
DECLARE_INTERFACE_(IDirectXFile, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS,
LPDIRECTXFILEENUMOBJECT *) PURE;
STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT,
LPDIRECTXFILESAVEOBJECT *) PURE;
STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileEnumObject
DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE;
STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE;
STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileSaveObject
DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE;
STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *,
DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE;
STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileObject
DECLARE_INTERFACE_(IDirectXFileObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
};
#undef INTERFACE
#define INTERFACE IDirectXFileData
DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE;
STDMETHOD(GetType) (THIS_ const GUID **) PURE;
STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE;
STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE;
STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE;
STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileDataReference
DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileBinary
DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(GetSize) (THIS_ DWORD *) PURE;
STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE;
STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE;
};
/*
* DirectXFile Object Class Id (for CoCreateInstance())
*/
DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
/*
* DirectX File Interface GUIDs.
*/
DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/*
* DirectX File Header template's GUID.
*/
DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/*
* DirectX File errors.
*/
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
#define DXFILE_OK 0
#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
#define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
#ifdef __cplusplus
};
#endif
#endif /* _DXFILE_H_ */

2958
gfx/include/dxsdk/dxgi.h Normal file

File diff suppressed because it is too large Load Diff

2475
gfx/include/dxsdk/dxgi1_2.h Normal file

File diff suppressed because it is too large Load Diff

2121
gfx/include/dxsdk/dxgi1_3.h Normal file

File diff suppressed because it is too large Load Diff

1494
gfx/include/dxsdk/dxgi1_4.h Normal file

File diff suppressed because it is too large Load Diff

1539
gfx/include/dxsdk/dxgi1_5.h Normal file

File diff suppressed because it is too large Load Diff

730
gfx/include/dxsdk/dxgi1_6.h Normal file
View File

@ -0,0 +1,730 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __dxgi1_6_h__
#define __dxgi1_6_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IDXGIAdapter4_FWD_DEFINED__
#define __IDXGIAdapter4_FWD_DEFINED__
typedef interface IDXGIAdapter4 IDXGIAdapter4;
#endif /* __IDXGIAdapter4_FWD_DEFINED__ */
#ifndef __IDXGIOutput6_FWD_DEFINED__
#define __IDXGIOutput6_FWD_DEFINED__
typedef interface IDXGIOutput6 IDXGIOutput6;
#endif /* __IDXGIOutput6_FWD_DEFINED__ */
/* header files for imported files */
#include "dxgi1_5.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_dxgi1_6_0000_0000 */
/* [local] */
// Copyright (c) Microsoft Corporation. All Rights Reserved
/*#include <winapifamily.h>*/
/*#pragma region App Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
typedef
enum DXGI_ADAPTER_FLAG3
{
DXGI_ADAPTER_FLAG3_NONE = 0,
DXGI_ADAPTER_FLAG3_REMOTE = 1,
DXGI_ADAPTER_FLAG3_SOFTWARE = 2,
DXGI_ADAPTER_FLAG3_ACG_COMPATIBLE = 4,
DXGI_ADAPTER_FLAG3_SUPPORT_MONITORED_FENCES = 8,
DXGI_ADAPTER_FLAG3_SUPPORT_NON_MONITORED_FENCES = 0x10,
DXGI_ADAPTER_FLAG3_KEYED_MUTEX_CONFORMANCE = 0x20,
DXGI_ADAPTER_FLAG3_FORCE_DWORD = 0xffffffff
} DXGI_ADAPTER_FLAG3;
DEFINE_ENUM_FLAG_OPERATORS( DXGI_ADAPTER_FLAG3 );
typedef struct DXGI_ADAPTER_DESC3
{
WCHAR Description[ 128 ];
UINT VendorId;
UINT DeviceId;
UINT SubSysId;
UINT Revision;
SIZE_T DedicatedVideoMemory;
SIZE_T DedicatedSystemMemory;
SIZE_T SharedSystemMemory;
LUID AdapterLuid;
DXGI_ADAPTER_FLAG3 Flags;
DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity;
DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity;
} DXGI_ADAPTER_DESC3;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0000_v0_0_s_ifspec;
#ifndef __IDXGIAdapter4_INTERFACE_DEFINED__
#define __IDXGIAdapter4_INTERFACE_DEFINED__
/* interface IDXGIAdapter4 */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIAdapter4;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3c8d99d1-4fbf-4181-a82c-af66bf7bd24e")
IDXGIAdapter4 : public IDXGIAdapter3
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc3(
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC3 *pDesc) = 0;
};
#else /* C style interface */
typedef struct IDXGIAdapter4Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIAdapter4 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIAdapter4 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIAdapter4 * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
_In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][out][in] */
_Inout_ UINT *pDataSize,
/* [annotation][out] */
_Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFIID riid,
/* [annotation][retval][out] */
_COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
IDXGIAdapter4 * This,
/* [in] */ UINT Output,
/* [annotation][out][in] */
_COM_Outptr_ IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID InterfaceName,
/* [annotation][out] */
_Out_ LARGE_INTEGER *pUMDVersion);
HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC1 *pDesc);
HRESULT ( STDMETHODCALLTYPE *GetDesc2 )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC2 *pDesc);
HRESULT ( STDMETHODCALLTYPE *RegisterHardwareContentProtectionTeardownStatusEvent )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie);
void ( STDMETHODCALLTYPE *UnregisterHardwareContentProtectionTeardownStatus )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ DWORD dwCookie);
HRESULT ( STDMETHODCALLTYPE *QueryVideoMemoryInfo )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ UINT NodeIndex,
/* [annotation][in] */
_In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
/* [annotation][out] */
_Out_ DXGI_QUERY_VIDEO_MEMORY_INFO *pVideoMemoryInfo);
HRESULT ( STDMETHODCALLTYPE *SetVideoMemoryReservation )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ UINT NodeIndex,
/* [annotation][in] */
_In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
/* [annotation][in] */
_In_ UINT64 Reservation);
HRESULT ( STDMETHODCALLTYPE *RegisterVideoMemoryBudgetChangeNotificationEvent )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie);
void ( STDMETHODCALLTYPE *UnregisterVideoMemoryBudgetChangeNotification )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ DWORD dwCookie);
HRESULT ( STDMETHODCALLTYPE *GetDesc3 )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC3 *pDesc);
END_INTERFACE
} IDXGIAdapter4Vtbl;
interface IDXGIAdapter4
{
CONST_VTBL struct IDXGIAdapter4Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIAdapter4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIAdapter4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIAdapter4_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIAdapter4_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIAdapter4_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIAdapter4_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIAdapter4_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIAdapter4_EnumOutputs(This,Output,ppOutput) \
( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) )
#define IDXGIAdapter4_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGIAdapter4_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \
( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) )
#define IDXGIAdapter4_GetDesc1(This,pDesc) \
( (This)->lpVtbl -> GetDesc1(This,pDesc) )
#define IDXGIAdapter4_GetDesc2(This,pDesc) \
( (This)->lpVtbl -> GetDesc2(This,pDesc) )
#define IDXGIAdapter4_RegisterHardwareContentProtectionTeardownStatusEvent(This,hEvent,pdwCookie) \
( (This)->lpVtbl -> RegisterHardwareContentProtectionTeardownStatusEvent(This,hEvent,pdwCookie) )
#define IDXGIAdapter4_UnregisterHardwareContentProtectionTeardownStatus(This,dwCookie) \
( (This)->lpVtbl -> UnregisterHardwareContentProtectionTeardownStatus(This,dwCookie) )
#define IDXGIAdapter4_QueryVideoMemoryInfo(This,NodeIndex,MemorySegmentGroup,pVideoMemoryInfo) \
( (This)->lpVtbl -> QueryVideoMemoryInfo(This,NodeIndex,MemorySegmentGroup,pVideoMemoryInfo) )
#define IDXGIAdapter4_SetVideoMemoryReservation(This,NodeIndex,MemorySegmentGroup,Reservation) \
( (This)->lpVtbl -> SetVideoMemoryReservation(This,NodeIndex,MemorySegmentGroup,Reservation) )
#define IDXGIAdapter4_RegisterVideoMemoryBudgetChangeNotificationEvent(This,hEvent,pdwCookie) \
( (This)->lpVtbl -> RegisterVideoMemoryBudgetChangeNotificationEvent(This,hEvent,pdwCookie) )
#define IDXGIAdapter4_UnregisterVideoMemoryBudgetChangeNotification(This,dwCookie) \
( (This)->lpVtbl -> UnregisterVideoMemoryBudgetChangeNotification(This,dwCookie) )
#define IDXGIAdapter4_GetDesc3(This,pDesc) \
( (This)->lpVtbl -> GetDesc3(This,pDesc) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIAdapter4_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi1_6_0000_0001 */
/* [local] */
typedef struct DXGI_OUTPUT_DESC1
{
WCHAR DeviceName[ 32 ];
RECT DesktopCoordinates;
BOOL AttachedToDesktop;
DXGI_MODE_ROTATION Rotation;
HMONITOR Monitor;
UINT BitsPerColor;
DXGI_COLOR_SPACE_TYPE ColorSpace;
FLOAT RedPrimary[ 2 ];
FLOAT GreenPrimary[ 2 ];
FLOAT BluePrimary[ 2 ];
FLOAT WhitePoint[ 2 ];
FLOAT MinLuminance;
FLOAT MaxLuminance;
FLOAT MaxFullFrameLuminance;
} DXGI_OUTPUT_DESC1;
typedef
enum DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS
{
DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN = 1,
DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_WINDOWED = 2,
DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED = 4
} DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS );
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0001_v0_0_s_ifspec;
#ifndef __IDXGIOutput6_INTERFACE_DEFINED__
#define __IDXGIOutput6_INTERFACE_DEFINED__
/* interface IDXGIOutput6 */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIOutput6;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("068346e8-aaec-4b84-add7-137f513f77a1")
IDXGIOutput6 : public IDXGIOutput5
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc1(
/* [annotation][out] */
_Out_ DXGI_OUTPUT_DESC1 *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckHardwareCompositionSupport(
/* [annotation][out] */
_Out_ UINT *pFlags) = 0;
};
#else /* C style interface */
typedef struct IDXGIOutput6Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIOutput6 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIOutput6 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
_In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][out][in] */
_Inout_ UINT *pDataSize,
/* [annotation][out] */
_Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFIID riid,
/* [annotation][retval][out] */
_COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_OUTPUT_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
IDXGIOutput6 * This,
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [annotation][out][in] */
_Inout_ UINT *pNumModes,
/* [annotation][out] */
_Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ const DXGI_MODE_DESC *pModeToMatch,
/* [annotation][out] */
_Out_ DXGI_MODE_DESC *pClosestMatch,
/* [annotation][in] */
_In_opt_ IUnknown *pConcernedDevice);
HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IUnknown *pDevice,
BOOL Exclusive);
void ( STDMETHODCALLTYPE *ReleaseOwnership )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ const DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IDXGISurface *pScanoutSurface);
HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IDXGISurface *pDestination);
HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_FRAME_STATISTICS *pStats);
HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList1 )(
IDXGIOutput6 * This,
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [annotation][out][in] */
_Inout_ UINT *pNumModes,
/* [annotation][out] */
_Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc);
HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode1 )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ const DXGI_MODE_DESC1 *pModeToMatch,
/* [annotation][out] */
_Out_ DXGI_MODE_DESC1 *pClosestMatch,
/* [annotation][in] */
_In_opt_ IUnknown *pConcernedDevice);
HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData1 )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IDXGIResource *pDestination);
HRESULT ( STDMETHODCALLTYPE *DuplicateOutput )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][out] */
_COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
BOOL ( STDMETHODCALLTYPE *SupportsOverlays )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *CheckOverlaySupport )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ DXGI_FORMAT EnumFormat,
/* [annotation][out] */
_In_ IUnknown *pConcernedDevice,
/* [annotation][out] */
_Out_ UINT *pFlags);
HRESULT ( STDMETHODCALLTYPE *CheckOverlayColorSpaceSupport )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ DXGI_FORMAT Format,
/* [annotation][in] */
_In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
/* [annotation][in] */
_In_ IUnknown *pConcernedDevice,
/* [annotation][out] */
_Out_ UINT *pFlags);
HRESULT ( STDMETHODCALLTYPE *DuplicateOutput1 )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [in] */ UINT Flags,
/* [annotation][in] */
_In_ UINT SupportedFormatsCount,
/* [annotation][in] */
_In_reads_(SupportedFormatsCount) const DXGI_FORMAT *pSupportedFormats,
/* [annotation][out] */
_COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_OUTPUT_DESC1 *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckHardwareCompositionSupport )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ UINT *pFlags);
END_INTERFACE
} IDXGIOutput6Vtbl;
interface IDXGIOutput6
{
CONST_VTBL struct IDXGIOutput6Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIOutput6_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIOutput6_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIOutput6_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIOutput6_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIOutput6_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIOutput6_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIOutput6_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIOutput6_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGIOutput6_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
#define IDXGIOutput6_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
#define IDXGIOutput6_WaitForVBlank(This) \
( (This)->lpVtbl -> WaitForVBlank(This) )
#define IDXGIOutput6_TakeOwnership(This,pDevice,Exclusive) \
( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
#define IDXGIOutput6_ReleaseOwnership(This) \
( (This)->lpVtbl -> ReleaseOwnership(This) )
#define IDXGIOutput6_GetGammaControlCapabilities(This,pGammaCaps) \
( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
#define IDXGIOutput6_SetGammaControl(This,pArray) \
( (This)->lpVtbl -> SetGammaControl(This,pArray) )
#define IDXGIOutput6_GetGammaControl(This,pArray) \
( (This)->lpVtbl -> GetGammaControl(This,pArray) )
#define IDXGIOutput6_SetDisplaySurface(This,pScanoutSurface) \
( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
#define IDXGIOutput6_GetDisplaySurfaceData(This,pDestination) \
( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
#define IDXGIOutput6_GetFrameStatistics(This,pStats) \
( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
#define IDXGIOutput6_GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) \
( (This)->lpVtbl -> GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) )
#define IDXGIOutput6_FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
( (This)->lpVtbl -> FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
#define IDXGIOutput6_GetDisplaySurfaceData1(This,pDestination) \
( (This)->lpVtbl -> GetDisplaySurfaceData1(This,pDestination) )
#define IDXGIOutput6_DuplicateOutput(This,pDevice,ppOutputDuplication) \
( (This)->lpVtbl -> DuplicateOutput(This,pDevice,ppOutputDuplication) )
#define IDXGIOutput6_SupportsOverlays(This) \
( (This)->lpVtbl -> SupportsOverlays(This) )
#define IDXGIOutput6_CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) \
( (This)->lpVtbl -> CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) )
#define IDXGIOutput6_CheckOverlayColorSpaceSupport(This,Format,ColorSpace,pConcernedDevice,pFlags) \
( (This)->lpVtbl -> CheckOverlayColorSpaceSupport(This,Format,ColorSpace,pConcernedDevice,pFlags) )
#define IDXGIOutput6_DuplicateOutput1(This,pDevice,Flags,SupportedFormatsCount,pSupportedFormats,ppOutputDuplication) \
( (This)->lpVtbl -> DuplicateOutput1(This,pDevice,Flags,SupportedFormatsCount,pSupportedFormats,ppOutputDuplication) )
#define IDXGIOutput6_GetDesc1(This,pDesc) \
( (This)->lpVtbl -> GetDesc1(This,pDesc) )
#define IDXGIOutput6_CheckHardwareCompositionSupport(This,pFlags) \
( (This)->lpVtbl -> CheckHardwareCompositionSupport(This,pFlags) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIOutput6_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi1_6_0000_0002 */
/* [local] */
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
DEFINE_GUID(IID_IDXGIAdapter4,0x3c8d99d1,0x4fbf,0x4181,0xa8,0x2c,0xaf,0x66,0xbf,0x7b,0xd2,0x4e);
DEFINE_GUID(IID_IDXGIOutput6,0x068346e8,0xaaec,0x4b84,0xad,0xd7,0x13,0x7f,0x51,0x3f,0x77,0xa1);
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0002_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,56 @@
//
// Copyright (C) Microsoft. All rights reserved.
//
#ifndef __dxgicommon_h__
#define __dxgicommon_h__
typedef struct DXGI_RATIONAL
{
UINT Numerator;
UINT Denominator;
} DXGI_RATIONAL;
// The following values are used with DXGI_SAMPLE_DESC::Quality:
#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff
#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe
typedef struct DXGI_SAMPLE_DESC
{
UINT Count;
UINT Quality;
} DXGI_SAMPLE_DESC;
typedef enum DXGI_COLOR_SPACE_TYPE
{
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0,
DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1,
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2,
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3,
DXGI_COLOR_SPACE_RESERVED = 4,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11,
DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13,
DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16,
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17,
DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 18,
DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 = 19,
DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P709 = 20,
DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P2020 = 21,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709 = 22,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020 = 23,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 = 24,
DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF
} DXGI_COLOR_SPACE_TYPE;
#endif // __dxgicommon_h__

View File

@ -0,0 +1,995 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __dxgidebug_h__
#define __dxgidebug_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IDXGIInfoQueue_FWD_DEFINED__
#define __IDXGIInfoQueue_FWD_DEFINED__
typedef interface IDXGIInfoQueue IDXGIInfoQueue;
#endif /* __IDXGIInfoQueue_FWD_DEFINED__ */
#ifndef __IDXGIDebug_FWD_DEFINED__
#define __IDXGIDebug_FWD_DEFINED__
typedef interface IDXGIDebug IDXGIDebug;
#endif /* __IDXGIDebug_FWD_DEFINED__ */
#ifndef __IDXGIDebug1_FWD_DEFINED__
#define __IDXGIDebug1_FWD_DEFINED__
typedef interface IDXGIDebug1 IDXGIDebug1;
#endif /* __IDXGIDebug1_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_dxgidebug_0000_0000 */
/* [local] */
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
#define DXGI_DEBUG_BINARY_VERSION ( 1 )
typedef
enum DXGI_DEBUG_RLO_FLAGS
{
DXGI_DEBUG_RLO_SUMMARY = 0x1,
DXGI_DEBUG_RLO_DETAIL = 0x2,
DXGI_DEBUG_RLO_IGNORE_INTERNAL = 0x4,
DXGI_DEBUG_RLO_ALL = 0x7
} DXGI_DEBUG_RLO_FLAGS;
typedef GUID DXGI_DEBUG_ID;
DEFINE_GUID(DXGI_DEBUG_ALL, 0xe48ae283, 0xda80, 0x490b, 0x87, 0xe6, 0x43, 0xe9, 0xa9, 0xcf, 0xda, 0x8);
DEFINE_GUID(DXGI_DEBUG_DX, 0x35cdd7fc, 0x13b2, 0x421d, 0xa5, 0xd7, 0x7e, 0x44, 0x51, 0x28, 0x7d, 0x64);
DEFINE_GUID(DXGI_DEBUG_DXGI, 0x25cddaa4, 0xb1c6, 0x47e1, 0xac, 0x3e, 0x98, 0x87, 0x5b, 0x5a, 0x2e, 0x2a);
DEFINE_GUID(DXGI_DEBUG_APP, 0x6cd6e01, 0x4219, 0x4ebd, 0x87, 0x9, 0x27, 0xed, 0x23, 0x36, 0xc, 0x62);
typedef
enum DXGI_INFO_QUEUE_MESSAGE_CATEGORY
{
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN = 0,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_CATEGORY_SHADER = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION + 1 )
} DXGI_INFO_QUEUE_MESSAGE_CATEGORY;
typedef
enum DXGI_INFO_QUEUE_MESSAGE_SEVERITY
{
DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION = 0,
DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING + 1 ) ,
DXGI_INFO_QUEUE_MESSAGE_SEVERITY_MESSAGE = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO + 1 )
} DXGI_INFO_QUEUE_MESSAGE_SEVERITY;
typedef int DXGI_INFO_QUEUE_MESSAGE_ID;
#define DXGI_INFO_QUEUE_MESSAGE_ID_STRING_FROM_APPLICATION 0
typedef struct DXGI_INFO_QUEUE_MESSAGE
{
DXGI_DEBUG_ID Producer;
DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category;
DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity;
DXGI_INFO_QUEUE_MESSAGE_ID ID;
/* [annotation] */
_Field_size_(DescriptionByteLength) const char *pDescription;
SIZE_T DescriptionByteLength;
} DXGI_INFO_QUEUE_MESSAGE;
typedef struct DXGI_INFO_QUEUE_FILTER_DESC
{
UINT NumCategories;
/* [annotation] */
_Field_size_(NumCategories) DXGI_INFO_QUEUE_MESSAGE_CATEGORY *pCategoryList;
UINT NumSeverities;
/* [annotation] */
_Field_size_(NumSeverities) DXGI_INFO_QUEUE_MESSAGE_SEVERITY *pSeverityList;
UINT NumIDs;
/* [annotation] */
_Field_size_(NumIDs) DXGI_INFO_QUEUE_MESSAGE_ID *pIDList;
} DXGI_INFO_QUEUE_FILTER_DESC;
typedef struct DXGI_INFO_QUEUE_FILTER
{
DXGI_INFO_QUEUE_FILTER_DESC AllowList;
DXGI_INFO_QUEUE_FILTER_DESC DenyList;
} DXGI_INFO_QUEUE_FILTER;
#define DXGI_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
HRESULT WINAPI DXGIGetDebugInterface(REFIID riid, void **ppDebug);
extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0000_v0_0_s_ifspec;
#ifndef __IDXGIInfoQueue_INTERFACE_DEFINED__
#define __IDXGIInfoQueue_INTERFACE_DEFINED__
/* interface IDXGIInfoQueue */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_IDXGIInfoQueue;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("D67441C7-672A-476f-9E82-CD55B44949CE")
IDXGIInfoQueue : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ UINT64 MessageCountLimit) = 0;
virtual void STDMETHODCALLTYPE ClearStoredMessages(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMessage(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ UINT64 MessageIndex,
/* [annotation] */
_Out_writes_bytes_opt_(*pMessageByteLength) DXGI_INFO_QUEUE_MESSAGE *pMessage,
/* [annotation] */
_Inout_ SIZE_T *pMessageByteLength) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilters(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
/* [annotation] */
_Inout_ SIZE_T *pFilterByteLength) = 0;
virtual void STDMETHODCALLTYPE ClearStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushDenyAllStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
virtual void STDMETHODCALLTYPE PopStorageFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
/* [annotation] */
_Inout_ SIZE_T *pFilterByteLength) = 0;
virtual void STDMETHODCALLTYPE ClearRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushDenyAllRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
virtual void STDMETHODCALLTYPE PopRetrievalFilter(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
virtual HRESULT STDMETHODCALLTYPE AddMessage(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
/* [annotation] */
_In_ LPCSTR pDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
/* [annotation] */
_In_ LPCSTR pDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
/* [annotation] */
_In_ BOOL bEnable) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
/* [annotation] */
_In_ BOOL bEnable) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
/* [annotation] */
_In_ BOOL bEnable) = 0;
virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category) = 0;
virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity) = 0;
virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_ID ID) = 0;
virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ BOOL bMute) = 0;
virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput(
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer) = 0;
};
#else /* C style interface */
typedef struct IDXGIInfoQueueVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIInfoQueue * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIInfoQueue * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIInfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ UINT64 MessageCountLimit);
void ( STDMETHODCALLTYPE *ClearStoredMessages )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *GetMessage )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ UINT64 MessageIndex,
/* [annotation] */
_Out_writes_bytes_opt_(*pMessageByteLength) DXGI_INFO_QUEUE_MESSAGE *pMessage,
/* [annotation] */
_Inout_ SIZE_T *pMessageByteLength);
UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilters )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter);
HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
/* [annotation] */
_Inout_ SIZE_T *pFilterByteLength);
void ( STDMETHODCALLTYPE *ClearStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushDenyAllStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter);
void ( STDMETHODCALLTYPE *PopStorageFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter);
HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
/* [annotation] */
_Inout_ SIZE_T *pFilterByteLength);
void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushDenyAllRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_FILTER *pFilter);
void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
HRESULT ( STDMETHODCALLTYPE *AddMessage )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
/* [annotation] */
_In_ LPCSTR pDescription);
HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
/* [annotation] */
_In_ LPCSTR pDescription);
HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
/* [annotation] */
_In_ BOOL bEnable);
HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
/* [annotation] */
_In_ BOOL bEnable);
HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
/* [annotation] */
_In_ BOOL bEnable);
BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category);
BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity);
BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ DXGI_INFO_QUEUE_MESSAGE_ID ID);
void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer,
/* [annotation] */
_In_ BOOL bMute);
BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
IDXGIInfoQueue * This,
/* [annotation] */
_In_ DXGI_DEBUG_ID Producer);
END_INTERFACE
} IDXGIInfoQueueVtbl;
interface IDXGIInfoQueue
{
CONST_VTBL struct IDXGIInfoQueueVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIInfoQueue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIInfoQueue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIInfoQueue_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIInfoQueue_SetMessageCountLimit(This,Producer,MessageCountLimit) \
( (This)->lpVtbl -> SetMessageCountLimit(This,Producer,MessageCountLimit) )
#define IDXGIInfoQueue_ClearStoredMessages(This,Producer) \
( (This)->lpVtbl -> ClearStoredMessages(This,Producer) )
#define IDXGIInfoQueue_GetMessage(This,Producer,MessageIndex,pMessage,pMessageByteLength) \
( (This)->lpVtbl -> GetMessage(This,Producer,MessageIndex,pMessage,pMessageByteLength) )
#define IDXGIInfoQueue_GetNumStoredMessagesAllowedByRetrievalFilters(This,Producer) \
( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilters(This,Producer) )
#define IDXGIInfoQueue_GetNumStoredMessages(This,Producer) \
( (This)->lpVtbl -> GetNumStoredMessages(This,Producer) )
#define IDXGIInfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This,Producer) \
( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This,Producer) )
#define IDXGIInfoQueue_GetMessageCountLimit(This,Producer) \
( (This)->lpVtbl -> GetMessageCountLimit(This,Producer) )
#define IDXGIInfoQueue_GetNumMessagesAllowedByStorageFilter(This,Producer) \
( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This,Producer) )
#define IDXGIInfoQueue_GetNumMessagesDeniedByStorageFilter(This,Producer) \
( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This,Producer) )
#define IDXGIInfoQueue_AddStorageFilterEntries(This,Producer,pFilter) \
( (This)->lpVtbl -> AddStorageFilterEntries(This,Producer,pFilter) )
#define IDXGIInfoQueue_GetStorageFilter(This,Producer,pFilter,pFilterByteLength) \
( (This)->lpVtbl -> GetStorageFilter(This,Producer,pFilter,pFilterByteLength) )
#define IDXGIInfoQueue_ClearStorageFilter(This,Producer) \
( (This)->lpVtbl -> ClearStorageFilter(This,Producer) )
#define IDXGIInfoQueue_PushEmptyStorageFilter(This,Producer) \
( (This)->lpVtbl -> PushEmptyStorageFilter(This,Producer) )
#define IDXGIInfoQueue_PushDenyAllStorageFilter(This,Producer) \
( (This)->lpVtbl -> PushDenyAllStorageFilter(This,Producer) )
#define IDXGIInfoQueue_PushCopyOfStorageFilter(This,Producer) \
( (This)->lpVtbl -> PushCopyOfStorageFilter(This,Producer) )
#define IDXGIInfoQueue_PushStorageFilter(This,Producer,pFilter) \
( (This)->lpVtbl -> PushStorageFilter(This,Producer,pFilter) )
#define IDXGIInfoQueue_PopStorageFilter(This,Producer) \
( (This)->lpVtbl -> PopStorageFilter(This,Producer) )
#define IDXGIInfoQueue_GetStorageFilterStackSize(This,Producer) \
( (This)->lpVtbl -> GetStorageFilterStackSize(This,Producer) )
#define IDXGIInfoQueue_AddRetrievalFilterEntries(This,Producer,pFilter) \
( (This)->lpVtbl -> AddRetrievalFilterEntries(This,Producer,pFilter) )
#define IDXGIInfoQueue_GetRetrievalFilter(This,Producer,pFilter,pFilterByteLength) \
( (This)->lpVtbl -> GetRetrievalFilter(This,Producer,pFilter,pFilterByteLength) )
#define IDXGIInfoQueue_ClearRetrievalFilter(This,Producer) \
( (This)->lpVtbl -> ClearRetrievalFilter(This,Producer) )
#define IDXGIInfoQueue_PushEmptyRetrievalFilter(This,Producer) \
( (This)->lpVtbl -> PushEmptyRetrievalFilter(This,Producer) )
#define IDXGIInfoQueue_PushDenyAllRetrievalFilter(This,Producer) \
( (This)->lpVtbl -> PushDenyAllRetrievalFilter(This,Producer) )
#define IDXGIInfoQueue_PushCopyOfRetrievalFilter(This,Producer) \
( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This,Producer) )
#define IDXGIInfoQueue_PushRetrievalFilter(This,Producer,pFilter) \
( (This)->lpVtbl -> PushRetrievalFilter(This,Producer,pFilter) )
#define IDXGIInfoQueue_PopRetrievalFilter(This,Producer) \
( (This)->lpVtbl -> PopRetrievalFilter(This,Producer) )
#define IDXGIInfoQueue_GetRetrievalFilterStackSize(This,Producer) \
( (This)->lpVtbl -> GetRetrievalFilterStackSize(This,Producer) )
#define IDXGIInfoQueue_AddMessage(This,Producer,Category,Severity,ID,pDescription) \
( (This)->lpVtbl -> AddMessage(This,Producer,Category,Severity,ID,pDescription) )
#define IDXGIInfoQueue_AddApplicationMessage(This,Severity,pDescription) \
( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
#define IDXGIInfoQueue_SetBreakOnCategory(This,Producer,Category,bEnable) \
( (This)->lpVtbl -> SetBreakOnCategory(This,Producer,Category,bEnable) )
#define IDXGIInfoQueue_SetBreakOnSeverity(This,Producer,Severity,bEnable) \
( (This)->lpVtbl -> SetBreakOnSeverity(This,Producer,Severity,bEnable) )
#define IDXGIInfoQueue_SetBreakOnID(This,Producer,ID,bEnable) \
( (This)->lpVtbl -> SetBreakOnID(This,Producer,ID,bEnable) )
#define IDXGIInfoQueue_GetBreakOnCategory(This,Producer,Category) \
( (This)->lpVtbl -> GetBreakOnCategory(This,Producer,Category) )
#define IDXGIInfoQueue_GetBreakOnSeverity(This,Producer,Severity) \
( (This)->lpVtbl -> GetBreakOnSeverity(This,Producer,Severity) )
#define IDXGIInfoQueue_GetBreakOnID(This,Producer,ID) \
( (This)->lpVtbl -> GetBreakOnID(This,Producer,ID) )
#define IDXGIInfoQueue_SetMuteDebugOutput(This,Producer,bMute) \
( (This)->lpVtbl -> SetMuteDebugOutput(This,Producer,bMute) )
#define IDXGIInfoQueue_GetMuteDebugOutput(This,Producer) \
( (This)->lpVtbl -> GetMuteDebugOutput(This,Producer) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIInfoQueue_INTERFACE_DEFINED__ */
#ifndef __IDXGIDebug_INTERFACE_DEFINED__
#define __IDXGIDebug_INTERFACE_DEFINED__
/* interface IDXGIDebug */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_IDXGIDebug;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("119E7452-DE9E-40fe-8806-88F90C12B441")
IDXGIDebug : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ReportLiveObjects(
GUID apiid,
DXGI_DEBUG_RLO_FLAGS flags) = 0;
};
#else /* C style interface */
typedef struct IDXGIDebugVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIDebug * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDebug * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIDebug * This);
HRESULT ( STDMETHODCALLTYPE *ReportLiveObjects )(
IDXGIDebug * This,
GUID apiid,
DXGI_DEBUG_RLO_FLAGS flags);
END_INTERFACE
} IDXGIDebugVtbl;
interface IDXGIDebug
{
CONST_VTBL struct IDXGIDebugVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIDebug_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIDebug_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIDebug_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIDebug_ReportLiveObjects(This,apiid,flags) \
( (This)->lpVtbl -> ReportLiveObjects(This,apiid,flags) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIDebug_INTERFACE_DEFINED__ */
#ifndef __IDXGIDebug1_INTERFACE_DEFINED__
#define __IDXGIDebug1_INTERFACE_DEFINED__
/* interface IDXGIDebug1 */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_IDXGIDebug1;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c5a05f0c-16f2-4adf-9f4d-a8c4d58ac550")
IDXGIDebug1 : public IDXGIDebug
{
public:
virtual void STDMETHODCALLTYPE EnableLeakTrackingForThread( void) = 0;
virtual void STDMETHODCALLTYPE DisableLeakTrackingForThread( void) = 0;
virtual BOOL STDMETHODCALLTYPE IsLeakTrackingEnabledForThread( void) = 0;
};
#else /* C style interface */
typedef struct IDXGIDebug1Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIDebug1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDebug1 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIDebug1 * This);
HRESULT ( STDMETHODCALLTYPE *ReportLiveObjects )(
IDXGIDebug1 * This,
GUID apiid,
DXGI_DEBUG_RLO_FLAGS flags);
void ( STDMETHODCALLTYPE *EnableLeakTrackingForThread )(
IDXGIDebug1 * This);
void ( STDMETHODCALLTYPE *DisableLeakTrackingForThread )(
IDXGIDebug1 * This);
BOOL ( STDMETHODCALLTYPE *IsLeakTrackingEnabledForThread )(
IDXGIDebug1 * This);
END_INTERFACE
} IDXGIDebug1Vtbl;
interface IDXGIDebug1
{
CONST_VTBL struct IDXGIDebug1Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIDebug1_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIDebug1_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIDebug1_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIDebug1_ReportLiveObjects(This,apiid,flags) \
( (This)->lpVtbl -> ReportLiveObjects(This,apiid,flags) )
#define IDXGIDebug1_EnableLeakTrackingForThread(This) \
( (This)->lpVtbl -> EnableLeakTrackingForThread(This) )
#define IDXGIDebug1_DisableLeakTrackingForThread(This) \
( (This)->lpVtbl -> DisableLeakTrackingForThread(This) )
#define IDXGIDebug1_IsLeakTrackingEnabledForThread(This) \
( (This)->lpVtbl -> IsLeakTrackingEnabledForThread(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIDebug1_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgidebug_0000_0003 */
/* [local] */
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
/*#pragma endregion*/
/*#pragma region Desktop Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
/*#pragma endregion*/
DEFINE_GUID(IID_IDXGIInfoQueue,0xD67441C7,0x672A,0x476f,0x9E,0x82,0xCD,0x55,0xB4,0x49,0x49,0xCE);
DEFINE_GUID(IID_IDXGIDebug,0x119E7452,0xDE9E,0x40fe,0x88,0x06,0x88,0xF9,0x0C,0x12,0xB4,0x41);
DEFINE_GUID(IID_IDXGIDebug1,0xc5a05f0c,0x16f2,0x4adf,0x9f,0x4d,0xa8,0xc4,0xd5,0x8a,0xc5,0x50);
extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0003_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0003_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,137 @@
//
// Copyright (C) Microsoft. All rights reserved.
//
#ifndef __dxgiformat_h__
#define __dxgiformat_h__
#define DXGI_FORMAT_DEFINED 1
typedef enum DXGI_FORMAT
{
DXGI_FORMAT_UNKNOWN = 0,
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
DXGI_FORMAT_R32G32B32A32_UINT = 3,
DXGI_FORMAT_R32G32B32A32_SINT = 4,
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
DXGI_FORMAT_R32G32B32_FLOAT = 6,
DXGI_FORMAT_R32G32B32_UINT = 7,
DXGI_FORMAT_R32G32B32_SINT = 8,
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
DXGI_FORMAT_R16G16B16A16_UINT = 12,
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
DXGI_FORMAT_R16G16B16A16_SINT = 14,
DXGI_FORMAT_R32G32_TYPELESS = 15,
DXGI_FORMAT_R32G32_FLOAT = 16,
DXGI_FORMAT_R32G32_UINT = 17,
DXGI_FORMAT_R32G32_SINT = 18,
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
DXGI_FORMAT_R10G10B10A2_UINT = 25,
DXGI_FORMAT_R11G11B10_FLOAT = 26,
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
DXGI_FORMAT_R8G8B8A8_UINT = 30,
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
DXGI_FORMAT_R8G8B8A8_SINT = 32,
DXGI_FORMAT_R16G16_TYPELESS = 33,
DXGI_FORMAT_R16G16_FLOAT = 34,
DXGI_FORMAT_R16G16_UNORM = 35,
DXGI_FORMAT_R16G16_UINT = 36,
DXGI_FORMAT_R16G16_SNORM = 37,
DXGI_FORMAT_R16G16_SINT = 38,
DXGI_FORMAT_R32_TYPELESS = 39,
DXGI_FORMAT_D32_FLOAT = 40,
DXGI_FORMAT_R32_FLOAT = 41,
DXGI_FORMAT_R32_UINT = 42,
DXGI_FORMAT_R32_SINT = 43,
DXGI_FORMAT_R24G8_TYPELESS = 44,
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
DXGI_FORMAT_R8G8_TYPELESS = 48,
DXGI_FORMAT_R8G8_UNORM = 49,
DXGI_FORMAT_R8G8_UINT = 50,
DXGI_FORMAT_R8G8_SNORM = 51,
DXGI_FORMAT_R8G8_SINT = 52,
DXGI_FORMAT_R16_TYPELESS = 53,
DXGI_FORMAT_R16_FLOAT = 54,
DXGI_FORMAT_D16_UNORM = 55,
DXGI_FORMAT_R16_UNORM = 56,
DXGI_FORMAT_R16_UINT = 57,
DXGI_FORMAT_R16_SNORM = 58,
DXGI_FORMAT_R16_SINT = 59,
DXGI_FORMAT_R8_TYPELESS = 60,
DXGI_FORMAT_R8_UNORM = 61,
DXGI_FORMAT_R8_UINT = 62,
DXGI_FORMAT_R8_SNORM = 63,
DXGI_FORMAT_R8_SINT = 64,
DXGI_FORMAT_A8_UNORM = 65,
DXGI_FORMAT_R1_UNORM = 66,
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
DXGI_FORMAT_BC1_TYPELESS = 70,
DXGI_FORMAT_BC1_UNORM = 71,
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
DXGI_FORMAT_BC2_TYPELESS = 73,
DXGI_FORMAT_BC2_UNORM = 74,
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
DXGI_FORMAT_BC3_TYPELESS = 76,
DXGI_FORMAT_BC3_UNORM = 77,
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
DXGI_FORMAT_BC4_TYPELESS = 79,
DXGI_FORMAT_BC4_UNORM = 80,
DXGI_FORMAT_BC4_SNORM = 81,
DXGI_FORMAT_BC5_TYPELESS = 82,
DXGI_FORMAT_BC5_UNORM = 83,
DXGI_FORMAT_BC5_SNORM = 84,
DXGI_FORMAT_B5G6R5_UNORM = 85,
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
DXGI_FORMAT_BC6H_TYPELESS = 94,
DXGI_FORMAT_BC6H_UF16 = 95,
DXGI_FORMAT_BC6H_SF16 = 96,
DXGI_FORMAT_BC7_TYPELESS = 97,
DXGI_FORMAT_BC7_UNORM = 98,
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
DXGI_FORMAT_AYUV = 100,
DXGI_FORMAT_Y410 = 101,
DXGI_FORMAT_Y416 = 102,
DXGI_FORMAT_NV12 = 103,
DXGI_FORMAT_P010 = 104,
DXGI_FORMAT_P016 = 105,
DXGI_FORMAT_420_OPAQUE = 106,
DXGI_FORMAT_YUY2 = 107,
DXGI_FORMAT_Y210 = 108,
DXGI_FORMAT_Y216 = 109,
DXGI_FORMAT_NV11 = 110,
DXGI_FORMAT_AI44 = 111,
DXGI_FORMAT_IA44 = 112,
DXGI_FORMAT_P8 = 113,
DXGI_FORMAT_A8P8 = 114,
DXGI_FORMAT_B4G4R4A4_UNORM = 115,
DXGI_FORMAT_P208 = 130,
DXGI_FORMAT_V208 = 131,
DXGI_FORMAT_V408 = 132,
DXGI_FORMAT_FORCE_UINT = 0xffffffff
} DXGI_FORMAT;
#endif // __dxgiformat_h__

View File

@ -0,0 +1,143 @@
//
// Copyright (C) Microsoft. All rights reserved.
//
#ifndef __dxgitype_h__
#define __dxgitype_h__
#include "dxgicommon.h"
#include "dxgiformat.h"
#define _FACDXGI 0x87a
#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
#ifndef DXGI_STATUS_OCCLUDED
#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)
#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)
#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)
#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)
#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)
#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)
#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)
#endif /*DXGI_STATUS_OCCLUDED*/
#ifndef DXGI_ERROR_INVALID_CALL
#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)
#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)
#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)
#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)
#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)
#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)
#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)
#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)
#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)
#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)
#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)
#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)
#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)
#define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35)
#define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36)
#endif /*DXGI_ERROR_INVALID_CALL*/
// DXGI error messages have moved to winerror.h
#define DXGI_CPU_ACCESS_NONE ( 0 )
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
#define DXGI_CPU_ACCESS_FIELD 15
typedef struct DXGI_RGB
{
float Red;
float Green;
float Blue;
} DXGI_RGB;
#ifndef D3DCOLORVALUE_DEFINED
typedef struct _D3DCOLORVALUE {
float r;
float g;
float b;
float a;
} D3DCOLORVALUE;
#define D3DCOLORVALUE_DEFINED
#endif
typedef D3DCOLORVALUE DXGI_RGBA;
typedef struct DXGI_GAMMA_CONTROL
{
DXGI_RGB Scale;
DXGI_RGB Offset;
DXGI_RGB GammaCurve[ 1025 ];
} DXGI_GAMMA_CONTROL;
typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
{
BOOL ScaleAndOffsetSupported;
float MaxConvertedValue;
float MinConvertedValue;
UINT NumGammaControlPoints;
float ControlPointPositions[1025];
} DXGI_GAMMA_CONTROL_CAPABILITIES;
typedef enum DXGI_MODE_SCANLINE_ORDER
{
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
} DXGI_MODE_SCANLINE_ORDER;
typedef enum DXGI_MODE_SCALING
{
DXGI_MODE_SCALING_UNSPECIFIED = 0,
DXGI_MODE_SCALING_CENTERED = 1,
DXGI_MODE_SCALING_STRETCHED = 2
} DXGI_MODE_SCALING;
typedef enum DXGI_MODE_ROTATION
{
DXGI_MODE_ROTATION_UNSPECIFIED = 0,
DXGI_MODE_ROTATION_IDENTITY = 1,
DXGI_MODE_ROTATION_ROTATE90 = 2,
DXGI_MODE_ROTATION_ROTATE180 = 3,
DXGI_MODE_ROTATION_ROTATE270 = 4
} DXGI_MODE_ROTATION;
typedef struct DXGI_MODE_DESC
{
UINT Width;
UINT Height;
DXGI_RATIONAL RefreshRate;
DXGI_FORMAT Format;
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
DXGI_MODE_SCALING Scaling;
} DXGI_MODE_DESC;
typedef struct DXGI_JPEG_DC_HUFFMAN_TABLE
{
BYTE CodeCounts[12];
BYTE CodeValues[12];
} DXGI_JPEG_DC_HUFFMAN_TABLE;
typedef struct DXGI_JPEG_AC_HUFFMAN_TABLE
{
BYTE CodeCounts[16];
BYTE CodeValues[162];
} DXGI_JPEG_AC_HUFFMAN_TABLE;
typedef struct DXGI_JPEG_QUANTIZATION_TABLE
{
BYTE Elements[64];
} DXGI_JPEG_QUANTIZATION_TABLE;
#endif // __dxgitype_h__

View File

@ -0,0 +1,18 @@
/*==========================================================================;
*
*
* File: dxsdkver.h
* Content: DirectX SDK Version Include File
*
****************************************************************************/
#ifndef _DXSDKVER_H_
#define _DXSDKVER_H_
#define _DXSDK_PRODUCT_MAJOR 9
#define _DXSDK_PRODUCT_MINOR 29
#define _DXSDK_BUILD_MAJOR 1962
#define _DXSDK_BUILD_MINOR 0
#endif // _DXSDKVER_H_

733
gfx/include/dxsdk/gameux.h Normal file
View File

@ -0,0 +1,733 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __gameux_h__
#define __gameux_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IGameExplorer_FWD_DEFINED__
#define __IGameExplorer_FWD_DEFINED__
typedef interface IGameExplorer IGameExplorer;
#endif /* __IGameExplorer_FWD_DEFINED__ */
#ifndef __IGameStatistics_FWD_DEFINED__
#define __IGameStatistics_FWD_DEFINED__
typedef interface IGameStatistics IGameStatistics;
#endif /* __IGameStatistics_FWD_DEFINED__ */
#ifndef __IGameStatisticsMgr_FWD_DEFINED__
#define __IGameStatisticsMgr_FWD_DEFINED__
typedef interface IGameStatisticsMgr IGameStatisticsMgr;
#endif /* __IGameStatisticsMgr_FWD_DEFINED__ */
#ifndef __IGameExplorer2_FWD_DEFINED__
#define __IGameExplorer2_FWD_DEFINED__
typedef interface IGameExplorer2 IGameExplorer2;
#endif /* __IGameExplorer2_FWD_DEFINED__ */
#ifndef __GameExplorer_FWD_DEFINED__
#define __GameExplorer_FWD_DEFINED__
#ifdef __cplusplus
typedef class GameExplorer GameExplorer;
#else
typedef struct GameExplorer GameExplorer;
#endif /* __cplusplus */
#endif /* __GameExplorer_FWD_DEFINED__ */
#ifndef __GameStatistics_FWD_DEFINED__
#define __GameStatistics_FWD_DEFINED__
#ifdef __cplusplus
typedef class GameStatistics GameStatistics;
#else
typedef struct GameStatistics GameStatistics;
#endif /* __cplusplus */
#endif /* __GameStatistics_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "shobjidl_core.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_gameux_0000_0000 */
/* [local] */
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define ID_GDF_XML __GDF_XML
#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL
#define ID_ICON_ICO __ICON_ICO
#define ID_GDF_XML_STR L"__GDF_XML"
#define ID_GDF_THUMBNAIL_STR L"__GDF_THUMBNAIL"
typedef /* [v1_enum] */
enum GAME_INSTALL_SCOPE
{
GIS_NOT_INSTALLED = 1,
GIS_CURRENT_USER = 2,
GIS_ALL_USERS = 3
} GAME_INSTALL_SCOPE;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_s_ifspec;
#ifndef __IGameExplorer_INTERFACE_DEFINED__
#define __IGameExplorer_INTERFACE_DEFINED__
/* interface IGameExplorer */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_IGameExplorer;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("E7B2FB72-D728-49B3-A5F2-18EBF5F1349E")
IGameExplorer : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddGame(
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
/* [in] */ GAME_INSTALL_SCOPE installScope,
/* [out][in] */ __RPC__inout GUID *pguidInstanceID) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGame(
/* [in] */ GUID guidInstanceID) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateGame(
/* [in] */ GUID guidInstanceID) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VerifyAccess(
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [out] */ __RPC__out BOOL *pfHasAccess) = 0;
};
#else /* C style interface */
typedef struct IGameExplorerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IGameExplorer * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IGameExplorer * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IGameExplorer * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddGame )(
__RPC__in IGameExplorer * This,
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
/* [in] */ GAME_INSTALL_SCOPE installScope,
/* [out][in] */ __RPC__inout GUID *pguidInstanceID);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGame )(
__RPC__in IGameExplorer * This,
/* [in] */ GUID guidInstanceID);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateGame )(
__RPC__in IGameExplorer * This,
/* [in] */ GUID guidInstanceID);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VerifyAccess )(
__RPC__in IGameExplorer * This,
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [out] */ __RPC__out BOOL *pfHasAccess);
END_INTERFACE
} IGameExplorerVtbl;
interface IGameExplorer
{
CONST_VTBL struct IGameExplorerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGameExplorer_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGameExplorer_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGameExplorer_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGameExplorer_AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) \
( (This)->lpVtbl -> AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) )
#define IGameExplorer_RemoveGame(This,guidInstanceID) \
( (This)->lpVtbl -> RemoveGame(This,guidInstanceID) )
#define IGameExplorer_UpdateGame(This,guidInstanceID) \
( (This)->lpVtbl -> UpdateGame(This,guidInstanceID) )
#define IGameExplorer_VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) \
( (This)->lpVtbl -> VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGameExplorer_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_gameux_0000_0001 */
/* [local] */
typedef /* [v1_enum] */
enum GAMESTATS_OPEN_TYPE
{
GAMESTATS_OPEN_OPENORCREATE = 0,
GAMESTATS_OPEN_OPENONLY = 1
} GAMESTATS_OPEN_TYPE;
typedef /* [v1_enum] */
enum GAMESTATS_OPEN_RESULT
{
GAMESTATS_OPEN_CREATED = 0,
GAMESTATS_OPEN_OPENED = 1
} GAMESTATS_OPEN_RESULT;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_s_ifspec;
#ifndef __IGameStatistics_INTERFACE_DEFINED__
#define __IGameStatistics_INTERFACE_DEFINED__
/* interface IGameStatistics */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_IGameStatistics;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3887C9CA-04A0-42ae-BC4C-5FA6C7721145")
IGameStatistics : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategoryLength(
/* [retval][out] */ __RPC__out UINT *cch) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxNameLength(
/* [retval][out] */ __RPC__out UINT *cch) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxValueLength(
/* [retval][out] */ __RPC__out UINT *cch) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategories(
/* [retval][out] */ __RPC__out WORD *pMax) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxStatsPerCategory(
/* [retval][out] */ __RPC__out WORD *pMax) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCategoryTitle(
/* [in] */ WORD categoryIndex,
/* [string][in] */ __RPC__in_string LPCWSTR title) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCategoryTitle(
/* [in] */ WORD categoryIndex,
/* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStatistic(
/* [in] */ WORD categoryIndex,
/* [in] */ WORD statIndex,
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName,
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStatistic(
/* [in] */ WORD categoryIndex,
/* [in] */ WORD statIndex,
/* [string][in] */ __RPC__in_string LPCWSTR name,
/* [string][in] */ __RPC__in_string LPCWSTR value) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Save(
/* [in] */ BOOL trackChanges) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLastPlayedCategory(
/* [in] */ UINT categoryIndex) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastPlayedCategory(
/* [retval][out] */ __RPC__out UINT *pCategoryIndex) = 0;
};
#else /* C style interface */
typedef struct IGameStatisticsVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IGameStatistics * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IGameStatistics * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IGameStatistics * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategoryLength )(
__RPC__in IGameStatistics * This,
/* [retval][out] */ __RPC__out UINT *cch);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxNameLength )(
__RPC__in IGameStatistics * This,
/* [retval][out] */ __RPC__out UINT *cch);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxValueLength )(
__RPC__in IGameStatistics * This,
/* [retval][out] */ __RPC__out UINT *cch);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategories )(
__RPC__in IGameStatistics * This,
/* [retval][out] */ __RPC__out WORD *pMax);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxStatsPerCategory )(
__RPC__in IGameStatistics * This,
/* [retval][out] */ __RPC__out WORD *pMax);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCategoryTitle )(
__RPC__in IGameStatistics * This,
/* [in] */ WORD categoryIndex,
/* [string][in] */ __RPC__in_string LPCWSTR title);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCategoryTitle )(
__RPC__in IGameStatistics * This,
/* [in] */ WORD categoryIndex,
/* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStatistic )(
__RPC__in IGameStatistics * This,
/* [in] */ WORD categoryIndex,
/* [in] */ WORD statIndex,
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName,
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStatistic )(
__RPC__in IGameStatistics * This,
/* [in] */ WORD categoryIndex,
/* [in] */ WORD statIndex,
/* [string][in] */ __RPC__in_string LPCWSTR name,
/* [string][in] */ __RPC__in_string LPCWSTR value);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Save )(
__RPC__in IGameStatistics * This,
/* [in] */ BOOL trackChanges);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLastPlayedCategory )(
__RPC__in IGameStatistics * This,
/* [in] */ UINT categoryIndex);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLastPlayedCategory )(
__RPC__in IGameStatistics * This,
/* [retval][out] */ __RPC__out UINT *pCategoryIndex);
END_INTERFACE
} IGameStatisticsVtbl;
interface IGameStatistics
{
CONST_VTBL struct IGameStatisticsVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGameStatistics_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGameStatistics_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGameStatistics_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGameStatistics_GetMaxCategoryLength(This,cch) \
( (This)->lpVtbl -> GetMaxCategoryLength(This,cch) )
#define IGameStatistics_GetMaxNameLength(This,cch) \
( (This)->lpVtbl -> GetMaxNameLength(This,cch) )
#define IGameStatistics_GetMaxValueLength(This,cch) \
( (This)->lpVtbl -> GetMaxValueLength(This,cch) )
#define IGameStatistics_GetMaxCategories(This,pMax) \
( (This)->lpVtbl -> GetMaxCategories(This,pMax) )
#define IGameStatistics_GetMaxStatsPerCategory(This,pMax) \
( (This)->lpVtbl -> GetMaxStatsPerCategory(This,pMax) )
#define IGameStatistics_SetCategoryTitle(This,categoryIndex,title) \
( (This)->lpVtbl -> SetCategoryTitle(This,categoryIndex,title) )
#define IGameStatistics_GetCategoryTitle(This,categoryIndex,pTitle) \
( (This)->lpVtbl -> GetCategoryTitle(This,categoryIndex,pTitle) )
#define IGameStatistics_GetStatistic(This,categoryIndex,statIndex,pName,pValue) \
( (This)->lpVtbl -> GetStatistic(This,categoryIndex,statIndex,pName,pValue) )
#define IGameStatistics_SetStatistic(This,categoryIndex,statIndex,name,value) \
( (This)->lpVtbl -> SetStatistic(This,categoryIndex,statIndex,name,value) )
#define IGameStatistics_Save(This,trackChanges) \
( (This)->lpVtbl -> Save(This,trackChanges) )
#define IGameStatistics_SetLastPlayedCategory(This,categoryIndex) \
( (This)->lpVtbl -> SetLastPlayedCategory(This,categoryIndex) )
#define IGameStatistics_GetLastPlayedCategory(This,pCategoryIndex) \
( (This)->lpVtbl -> GetLastPlayedCategory(This,pCategoryIndex) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGameStatistics_INTERFACE_DEFINED__ */
#ifndef __IGameStatisticsMgr_INTERFACE_DEFINED__
#define __IGameStatisticsMgr_INTERFACE_DEFINED__
/* interface IGameStatisticsMgr */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_IGameStatisticsMgr;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("AFF3EA11-E70E-407d-95DD-35E612C41CE2")
IGameStatisticsMgr : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGameStatistics(
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath,
/* [in] */ GAMESTATS_OPEN_TYPE openType,
/* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult,
/* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGameStatistics(
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath) = 0;
};
#else /* C style interface */
typedef struct IGameStatisticsMgrVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IGameStatisticsMgr * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IGameStatisticsMgr * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IGameStatisticsMgr * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGameStatistics )(
__RPC__in IGameStatisticsMgr * This,
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath,
/* [in] */ GAMESTATS_OPEN_TYPE openType,
/* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult,
/* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGameStatistics )(
__RPC__in IGameStatisticsMgr * This,
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath);
END_INTERFACE
} IGameStatisticsMgrVtbl;
interface IGameStatisticsMgr
{
CONST_VTBL struct IGameStatisticsMgrVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGameStatisticsMgr_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGameStatisticsMgr_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGameStatisticsMgr_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGameStatisticsMgr_GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) \
( (This)->lpVtbl -> GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) )
#define IGameStatisticsMgr_RemoveGameStatistics(This,GDFBinaryPath) \
( (This)->lpVtbl -> RemoveGameStatistics(This,GDFBinaryPath) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGameStatisticsMgr_INTERFACE_DEFINED__ */
#ifndef __IGameExplorer2_INTERFACE_DEFINED__
#define __IGameExplorer2_INTERFACE_DEFINED__
/* interface IGameExplorer2 */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_IGameExplorer2;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("86874AA7-A1ED-450d-A7EB-B89E20B2FFF3")
IGameExplorer2 : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InstallGame(
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
/* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory,
/* [in] */ GAME_INSTALL_SCOPE installScope) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UninstallGame(
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckAccess(
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
/* [retval][out] */ __RPC__out BOOL *pHasAccess) = 0;
};
#else /* C style interface */
typedef struct IGameExplorer2Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IGameExplorer2 * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IGameExplorer2 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IGameExplorer2 * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InstallGame )(
__RPC__in IGameExplorer2 * This,
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
/* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory,
/* [in] */ GAME_INSTALL_SCOPE installScope);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UninstallGame )(
__RPC__in IGameExplorer2 * This,
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckAccess )(
__RPC__in IGameExplorer2 * This,
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
/* [retval][out] */ __RPC__out BOOL *pHasAccess);
END_INTERFACE
} IGameExplorer2Vtbl;
interface IGameExplorer2
{
CONST_VTBL struct IGameExplorer2Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGameExplorer2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGameExplorer2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGameExplorer2_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGameExplorer2_InstallGame(This,binaryGDFPath,installDirectory,installScope) \
( (This)->lpVtbl -> InstallGame(This,binaryGDFPath,installDirectory,installScope) )
#define IGameExplorer2_UninstallGame(This,binaryGDFPath) \
( (This)->lpVtbl -> UninstallGame(This,binaryGDFPath) )
#define IGameExplorer2_CheckAccess(This,binaryGDFPath,pHasAccess) \
( (This)->lpVtbl -> CheckAccess(This,binaryGDFPath,pHasAccess) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGameExplorer2_INTERFACE_DEFINED__ */
#ifndef __gameuxLib_LIBRARY_DEFINED__
#define __gameuxLib_LIBRARY_DEFINED__
/* library gameuxLib */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_gameuxLib;
EXTERN_C const CLSID CLSID_GameExplorer;
#ifdef __cplusplus
class DECLSPEC_UUID("9A5EA990-3034-4D6F-9128-01F3C61022BC")
GameExplorer;
#endif
EXTERN_C const CLSID CLSID_GameStatistics;
#ifdef __cplusplus
class DECLSPEC_UUID("DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4")
GameStatistics;
#endif
#endif /* __gameuxLib_LIBRARY_DEFINED__ */
/* interface __MIDL_itf_gameux_0000_0005 */
/* [local] */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0005_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * );
unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,120 @@
//==================================================================================================
// PIXPlugin.h
//
// Microsoft PIX Plugin Header
//
// Copyright (c) Microsoft Corporation, All rights reserved
//==================================================================================================
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
//==================================================================================================
// PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with.
//==================================================================================================
#define PIX_PLUGIN_SYSTEM_VERSION 0x101
//==================================================================================================
// PIXCOUNTERID - A unique identifier for each PIX plugin counter.
//==================================================================================================
typedef int PIXCOUNTERID;
//==================================================================================================
// PIXCOUNTERDATATYPE - Indicates what type of data the counter produces.
//==================================================================================================
enum PIXCOUNTERDATATYPE
{
PCDT_RESERVED,
PCDT_FLOAT,
PCDT_INT,
PCDT_INT64,
PCDT_STRING,
};
//==================================================================================================
// PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX.
//==================================================================================================
struct PIXPLUGININFO
{
// Filled in by caller:
HINSTANCE hinst;
// Filled in by PIXGetPluginInfo:
WCHAR* pstrPluginName; // Name of plugin
int iPluginVersion; // Version of this particular plugin
int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for
};
//==================================================================================================
// PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX
// to allow PIX to determine information about the counters in the plugin.
//==================================================================================================
struct PIXCOUNTERINFO
{
PIXCOUNTERID counterID; // Used to uniquely ID this counter
WCHAR* pstrName; // String name of the counter
PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter
};
//==================================================================================================
// PIXGetPluginInfo - This returns basic information about this plugin to PIX.
//==================================================================================================
BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo );
//==================================================================================================
// PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX.
// These PIXCOUNTERINFOs allow PIX to enumerate the counters contained
// in this plugin.
//==================================================================================================
BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList );
//==================================================================================================
// PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter.
//==================================================================================================
BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc );
//==================================================================================================
// PIXBeginExperiment - This called by PIX once per counter when instrumentation starts.
//==================================================================================================
BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication );
//==================================================================================================
// PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the
// counter value for that frame. Note that the pointer to the return data must
// continue to point to valid counter data until the next call to PIXEndFrame (or
// PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same
// pointer for multiple counters, or point to a local variable that will go out of
// scope. See the sample PIX plugin for an example of how to structure a plugin
// properly.
//==================================================================================================
BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData );
//==================================================================================================
// PIXEndExperiment - This is called by PIX once per counter when instrumentation ends.
//==================================================================================================
BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id );
#ifdef __cplusplus
};
#endif
//==================================================================================================
// eof: PIXPlugin.h
//==================================================================================================

View File

@ -0,0 +1,223 @@
/***************************************************************************
*
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
*
* File: rmxfguid.h
*
* Content: Defines GUIDs of D3DRM's templates.
*
***************************************************************************/
#ifndef __RMXFGUID_H_
#define __RMXFGUID_H_
/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMInfo,
0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMMesh,
0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMVector,
0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMMeshFace,
0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMMaterial,
0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialArray,
0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMFrame,
0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {F6F23F41-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFrameTransformMatrix,
0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F42-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshMaterialList,
0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F40-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshTextureCoords,
0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F43-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshNormals,
0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F44-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMCoords2d,
0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F45-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMatrix4x4,
0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMAnimation,
0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMAnimationSet,
0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {10DD46A8-775B-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMAnimationKey,
0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {10DD46A9-775B-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFloatKeys,
0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {01411840-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialAmbientColor,
0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {01411841-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialDiffuseColor,
0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {01411842-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialSpecularColor,
0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {D3E16E80-7835-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialEmissiveColor,
0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {01411843-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialPower,
0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMColorRGBA,
0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {D3E16E81-7835-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMColorRGB,
0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {A42790E0-7810-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMGuid,
0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {A42790E1-7810-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMTextureFilename,
0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {A42790E2-7810-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMTextureReference,
0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {1630B820-7842-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMIndexedColor,
0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {1630B821-7842-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshVertexColors,
0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {4885AE60-78E8-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialWrap,
0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMBoolean,
0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMMeshFaceWraps,
0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
/* {4885AE63-78E8-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMBoolean2d,
0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F406B180-7B3B-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMTimedFloatKeys,
0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMAnimationOptions,
0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFramePosition,
0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFrameVelocity,
0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFrameRotation,
0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMLight,
0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMCamera,
0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMAppData,
0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMLightUmbra,
0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMLightRange,
0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMLightPenumbra,
0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMLightAttenuation,
0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMInlineData,
0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMUrl,
0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMProgressiveMesh,
0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B);
/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */
DEFINE_GUID(TID_D3DRMExternalVisual,
0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71);
/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */
DEFINE_GUID(TID_D3DRMStringProperty,
0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */
DEFINE_GUID(TID_D3DRMPropertyBag,
0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271}
DEFINE_GUID(TID_D3DRMRightHanded,
0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
#endif /* __RMXFGUID_H_ */

View File

@ -0,0 +1,339 @@
/* D3DRM XFile templates in binary form */
#ifndef _RMXFTMPL_H_
#define _RMXFTMPL_H_
unsigned char D3DRM_XTEMPLATES[] = {
0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62,
0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1,
0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda,
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d,
0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0,
0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14,
0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66,
0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d,
0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71,
0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0,
0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2,
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f,
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0,
0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78,
0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0,
0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0,
0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c,
0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94,
0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72,
0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0,
0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a,
0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75,
0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0,
0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0,
0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52,
0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0,
0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a,
0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65,
0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0,
0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78,
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e,
0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0,
0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41,
0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f,
0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0,
0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0,
0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9,
0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c,
0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61,
0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85,
0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42,
0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0,
0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0,
0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0,
0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f,
0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74,
0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa,
0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf,
0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65,
0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14,
0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f,
0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0,
0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf,
0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0,
0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11,
0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0,
0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65,
0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65,
0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab,
0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20,
0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1,
0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0,
0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14,
0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0,
0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0,
0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14,
0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf,
0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0,
0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa,
0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61,
0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e,
0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29,
0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63,
0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64,
0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0,
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72,
0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73,
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61,
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5,
0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94,
0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1,
0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0,
0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1,
0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57,
0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe,
0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61,
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f,
0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2,
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0,
0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43,
0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1,
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74,
0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72,
0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0,
0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f,
0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65,
0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c,
0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f,
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0,
0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61,
0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0,
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0,
0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1,
0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14,
0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d,
0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d,
0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76,
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e,
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0,
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f,
0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8,
0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc,
0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f,
0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1,
0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46,
0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66,
0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46,
0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65,
0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,
0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78,
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56,
0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0,
0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76,
0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e,
0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62,
0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56,
0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34,
0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63,
0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76,
0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1,
0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74,
0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0,
0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63,
0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0,
0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65,
0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e,
0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe,
0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46,
0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa,
0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf,
0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0,
0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69,
0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5,
0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0,
0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11,
0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0,
0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c,
0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5,
0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f,
0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1,
0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0,
0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54,
0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b,
0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6,
0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0,
0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9,
0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66,
0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0,
0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11,
0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0,
0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54,
0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5,
0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0,
0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69,
0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65,
0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0,
0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41,
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0,
0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0,
0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa,
0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf,
0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0,
0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0,
0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa,
0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe,
0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41,
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65,
0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda,
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41,
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0,
0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0,
0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61,
0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94,
0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49,
0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa,
0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0,
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72,
0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0,
0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0,
0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c,
0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72,
0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68,
0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99,
0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b,
0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72,
0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49,
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf,
0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0,
0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0,
0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0,
0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5,
0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0,
0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61,
0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5,
0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0,
0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0,
0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8,
0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f,
0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72,
0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1,
0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72,
0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b,
0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0,
0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50,
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67,
0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf,
0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71,
0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0,
0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11,
0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0,
0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0,
0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75,
0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0,
0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0,
0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0,
0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc,
0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0
};
#define D3DRM_XTEMPLATE_BYTES 3278
#endif /* _RMXFTMPL_H_ */

330
gfx/include/dxsdk/rpcsal.h Normal file
View File

@ -0,0 +1,330 @@
/****************************************************************\
* *
* rpcsal.h - markers for documenting the semantics of RPC APIs *
* *
* Version 1.0 *
* *
* Copyright (c) 2004 Microsoft Corporation. All rights reserved. *
* *
\****************************************************************/
// -------------------------------------------------------------------------------
// Introduction
//
// rpcsal.h provides a set of annotations to describe how RPC functions use their
// parameters - the assumptions it makes about them, adn the guarantees it makes
// upon finishing. These annotations are similar to those found in specstrings.h,
// but are designed to be used by the MIDL compiler when it generates annotations
// enabled header files.
//
// IDL authors do not need to annotate their functions declarations. The MIDL compiler
// will interpret the IDL directives and use one of the annotations contained
// in this header. This documentation is intended to help those trying to understand
// the MIDL-generated header files or those who maintain their own copies of these files.
//
// -------------------------------------------------------------------------------
// Differences between rpcsal.h and specstrings.h
//
// There are a few important differences between the annotations found in rpcsal.h and
// those in specstrings.h:
//
// 1. [in] parameters are not marked as read-only. They may be used for scratch space
// at the server and changes will not affect the client.
// 2. String versions of each macro alleviates the need for a special type definition
//
// -------------------------------------------------------------------------------
// Interpreting RPC Annotations
//
// These annotations are interpreted precisely in the same way as those in specstrings.h.
// Please refer to that header for information related to general usage in annotations.
//
// To construct an RPC annotation, concatenate the appropriate value from each category
// along with a leading __RPC_. A typical annotation looks like "__RPC__in_string".
//
// |----------------------------------------------------------------------------------|
// | RPC Annotations |
// |------------|------------|---------|--------|----------|----------|---------------|
// | Level | Usage | Size | Output | Optional | String | Parameters |
// |------------|------------|---------|--------|----------|----------|---------------|
// | <> | <> | <> | <> | <> | <> | <> |
// | _deref | _in | _ecount | _full | _opt | _string | (size) |
// | _deref_opt | _out | _bcount | _part | | | (size,length) |
// | | _inout | | | | | |
// | | | | | | | |
// |------------|------------|---------|--------|----------|----------|---------------|
//
// Level: Describes the buffer pointer's level of indirection from the parameter or
// return value 'p'.
//
// <> : p is the buffer pointer.
// _deref : *p is the buffer pointer. p must not be NULL.
// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
// the annotation is ignored.
//
// Usage: Describes how the function uses the buffer.
//
// <> : The buffer is not accessed. If used on the return value or with _deref, the
// function will provide the buffer, and it will be uninitialized at exit.
// Otherwise, the caller must provide the buffer. This should only be used
// for alloc and free functions.
// _in : The function will only read from the buffer. The caller must provide the
// buffer and initialize it. Cannot be used with _deref.
// _out : The function will only write to the buffer. If used on the return value or
// with _deref, the function will provide the buffer and initialize it.
// Otherwise, the caller must provide the buffer, and the function will
// initialize it.
// _inout : The function may freely read from and write to the buffer. The caller must
// provide the buffer and initialize it. If used with _deref, the buffer may
// be reallocated by the function.
//
// Size: Describes the total size of the buffer. This may be less than the space actually
// allocated for the buffer, in which case it describes the accessible amount.
//
// <> : No buffer size is given. If the type specifies the buffer size (such as
// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
// element long. Must be used with _in, _out, or _inout.
// _ecount : The buffer size is an explicit element count.
// _bcount : The buffer size is an explicit byte count.
//
// Output: Describes how much of the buffer will be initialized by the function. For
// _inout buffers, this also describes how much is initialized at entry. Omit this
// category for _in buffers; they must be fully initialized by the caller.
//
// <> : The type specifies how much is initialized. For instance, a function initializing
// an LPWSTR must NULL-terminate the string.
// _full : The function initializes the entire buffer.
// _part : The function initializes part of the buffer, and explicitly indicates how much.
//
// Optional: Describes if the buffer itself is optional.
//
// <> : The pointer to the buffer must not be NULL.
// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
//
// String: Describes if the buffer is NULL terminated
//
// <> : The buffer is not assumed to be NULL terminated
// _string : The buffer is assumed to be NULL terminated once it has been initialized
//
// Parameters: Gives explicit counts for the size and length of the buffer.
//
// <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
// and _bcount_part.
//
// Notes:
//
// 1. Specifying two buffer annotations on a single parameter results in unspecified behavior
// (e.g. __RPC__in_bcount(5) __RPC__out_bcount(6)
//
// 2. The size of the buffer and the amount that has been initialized are separate concepts.
// Specify the size using _ecount or _bcount. Specify the amount that is initialized using
// _full, _part, or _string. As a special case, a single element buffer does not need
// _ecount, _bcount, _full, or _part
//
// 3. The count may be less than the total size of the buffer in which case it describes the
// accessible portion.
//
// 4. "__RPC__opt" and "__RPC_deref" are not valid annotations.
//
// 5. The placement of _opt when using _deref is important:
// __RPC__deref_opt_... : Input may be NULL
// __RPC__deref_..._opt : Output may be NULL
// __RPC__deref_opt_..._opt : Both input and output may be NULL
//
#pragma once
#include <specstrings.h>
#ifndef __RPCSAL_H_VERSION__
#define __RPCSAL_H_VERSION__ ( 100 )
#endif // __RPCSAL_H_VERSION__
#ifdef __REQUIRED_RPCSAL_H_VERSION__
#if ( __RPCSAL_H_VERSION__ < __REQUIRED_RPCSAL_H_VERSION__ )
#error incorrect <rpcsal.h> version. Use the header that matches with the MIDL compiler.
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif // #ifdef __cplusplus
#ifndef _SAL1_2_Source_
#define _SAL1_2_Source_(Name, args, annotes) _SA_annotes3(SAL_name, #Name, "", "1.2") _Group_(annotes _SAL_nop_impl_)
#endif // _SAL1_2_Source_
// [in]
#define __RPC__in _SAL1_2_Source_(__RPC__in, (), _Pre_ _Notref_ _Notnull_ _Pre_ _Valid_)
#define __RPC__in_string _SAL1_2_Source_(__RPC__in_string, (), __RPC__in _Pre_ _Null_terminated_)
#define __RPC__in_ecount(size) _SAL1_2_Source_(__RPC__in_ecount, (size), __RPC__in _Pre_readable_size_(size))
#define __RPC__in_ecount_full(size) _SAL1_2_Source_(__RPC__in_ecount_full, (size), __RPC__in_ecount(size))
#define __RPC__in_ecount_full_string(size) _SAL1_2_Source_(__RPC__in_ecount_full_string, (size), __RPC__in_ecount_full(size) _Pre_ _Null_terminated_)
#define __RPC__in_ecount_part(size, length) _SAL1_2_Source_(__RPC__in_ecount_part, (size,length), __RPC__in_ecount(length) _Pre_writable_size_(size))
#define __RPC__in_xcount(size) _SAL1_2_Source_(__RPC__in_xcount, (size), __RPC__in _Pre_readable_size_(size))
#define __RPC__in_xcount_full(size) _SAL1_2_Source_(__RPC__in_xcount_full, (size), __RPC__in_ecount(size))
#define __RPC__in_xcount_full_string(size) _SAL1_2_Source_(__RPC__in_xcount_full_string, (size), __RPC__in_ecount_full(size) _Pre_ _Null_terminated_)
#define __RPC__in_xcount_part(size, length) _SAL1_2_Source_(__RPC__in_xcount_part, (size,length), __RPC__in_ecount(length) _Pre_writable_size_(size))
#define __RPC__deref_in _SAL1_2_Source_(__RPC__deref_in, (), __RPC__in _At_(*_Curr_, _Pre_ _Notnull_))
#define __RPC__deref_in_string _SAL1_2_Source_(__RPC__deref_in_string, (), __RPC__deref_in _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_in_opt _SAL1_2_Source_(__RPC__deref_in_opt, (), __RPC__in _At_(*_Curr_, _Pre_ _Maybenull_))
#define __RPC__deref_in_opt_string _SAL1_2_Source_(__RPC__deref_in_opt_string, (), __RPC__deref_in_opt _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_opt_in _SAL1_2_Source_(__RPC__deref_opt_in, (), __RPC__in_opt _At_(*_Curr_, _Pre_ _Notnull_))
#define __RPC__deref_opt_in_string _SAL1_2_Source_(__RPC__deref_opt_in_string, (), __RPC__deref_opt_in _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_opt_in_opt _SAL1_2_Source_(__RPC__deref_opt_in_opt, (), __RPC__in_opt _At_(*_Curr_, _Pre_ _Maybenull_))
#define __RPC__deref_opt_in_opt_string _SAL1_2_Source_(__RPC__deref_opt_in_opt_string, (), __RPC__deref_opt_in_opt _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_in_ecount(size) _SAL1_2_Source_(__RPC__deref_in_ecount, (size), __RPC__in _At_(*_Curr_, _Pre_ _Notnull_ _Pre_readable_size_(size)))
#define __RPC__deref_in_ecount_part(size, length) _SAL1_2_Source_(__RPC__deref_in_ecount_part, (size,length), __RPC__deref_in_ecount(size) _At_(*_Curr_, _Pre_readable_size_(length)))
#define __RPC__deref_in_ecount_full(size) _SAL1_2_Source_(__RPC__deref_in_ecount_full, (size), __RPC__deref_in_ecount_part(size, size))
#define __RPC__deref_in_ecount_full_opt(size) _SAL1_2_Source_(__RPC__deref_in_ecount_full_opt, (size), __RPC__deref_in_ecount_part_opt(size, size))
#define __RPC__deref_in_ecount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_in_ecount_full_opt_string, (size), __RPC__deref_in_ecount_full_opt(size) _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_in_ecount_full_string(size) _SAL1_2_Source_(__RPC__deref_in_ecount_full_string, (size), __RPC__deref_in_ecount_full(size) _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_in_ecount_opt(size) _SAL1_2_Source_(__RPC__deref_in_ecount_opt, (size), __RPC__in _At_(*_Curr_, _Pre_ _Maybenull_ _Pre_readable_size_(size)))
#define __RPC__deref_in_ecount_opt_string(size) _SAL1_2_Source_(__RPC__deref_in_ecount_opt_string, (size), __RPC__deref_in_ecount_opt(size) _At_(*_Curr_, _Pre_ _Null_terminated_))
#define __RPC__deref_in_ecount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_in_ecount_part_opt, (size,length), __RPC__deref_in_ecount_opt(size) _At_(*_Curr_, _Pre_readable_size_(length)))
#define __RPC__deref_in_xcount(size) _SAL1_2_Source_(__RPC__deref_in_xcount, (size), __RPC__deref_in_ecount(size))
#define __RPC__deref_in_xcount_part(size, length) _SAL1_2_Source_(__RPC__deref_in_xcount_part, (size,length), __RPC__deref_in_ecount_part(size, length))
#define __RPC__deref_in_xcount_full(size) _SAL1_2_Source_(__RPC__deref_in_xcount_full, (size), __RPC__deref_in_ecount_part(size, size))
#define __RPC__deref_in_xcount_full_opt(size) _SAL1_2_Source_(__RPC__deref_in_xcount_full_opt, (size), __RPC__deref_in_ecount_full_opt(size))
#define __RPC__deref_in_xcount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_in_xcount_full_opt_string, (size), __RPC__deref_in_ecount_full_opt_string(size))
#define __RPC__deref_in_xcount_full_string(size) _SAL1_2_Source_(__RPC__deref_in_xcount_full_string, (size), __RPC__deref_in_ecount_full_string(size))
#define __RPC__deref_in_xcount_opt(size) _SAL1_2_Source_(__RPC__deref_in_xcount_opt, (size), __RPC__deref_in_ecount_opt(size))
#define __RPC__deref_in_xcount_opt_string(size) _SAL1_2_Source_(__RPC__deref_in_xcount_opt_string, (size), __RPC__deref_in_ecount_opt_string(size))
#define __RPC__deref_in_xcount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_in_xcount_part_opt, (size,length), __RPC__deref_in_ecount_part_opt(size))
// [out]
#define __RPC__out _SAL1_2_Source_(__RPC__out, (), _Out_)
#define __RPC__out_ecount(size) _SAL1_2_Source_(__RPC__out_ecount, (size), _Out_writes_(size) _Post_writable_size_(size))
#define __RPC__out_ecount_string(size) _SAL1_2_Source_(__RPC__out_ecount_string, (size), __RPC__out_ecount(size) _Post_ _Null_terminated_)
#define __RPC__out_ecount_part(size, length) _SAL1_2_Source_(__RPC__out_ecount_part, (size,length), __RPC__out_ecount(size) _Post_readable_size_(length))
#define __RPC__out_ecount_full(size) _SAL1_2_Source_(__RPC__out_ecount_full, (size), __RPC__out_ecount_part(size, size))
#define __RPC__out_ecount_full_string(size) _SAL1_2_Source_(__RPC__out_ecount_full_string, (size), __RPC__out_ecount_full(size) _Post_ _Null_terminated_)
#define __RPC__out_xcount(size) _SAL1_2_Source_(__RPC__out_xcount, (size), _Out_)
#define __RPC__out_xcount_string(size) _SAL1_2_Source_(__RPC__out_xcount_string, (size), __RPC__out _Post_ _Null_terminated_)
#define __RPC__out_xcount_part(size, length) _SAL1_2_Source_(__RPC__out_xcount_part, (size,length), __RPC__out)
#define __RPC__out_xcount_full(size) _SAL1_2_Source_(__RPC__out_xcount_full, (size), __RPC__out)
#define __RPC__out_xcount_full_string(size) _SAL1_2_Source_(__RPC__out_xcount_full_string, (size), __RPC__out _Post_ _Null_terminated_)
// [in,out]
#define __RPC__inout _SAL1_2_Source_(__RPC__inout, (), _Inout_)
#define __RPC__inout_string _SAL1_2_Source_(__RPC__inout_string, (), __RPC__inout _Pre_ _Null_terminated_ _Post_ _Null_terminated_)
#define __RPC__inout_ecount(size) _SAL1_2_Source_(__RPC__inout_ecount, (size), _Inout_updates_(size))
#define __RPC__inout_ecount_part(size, length) _SAL1_2_Source_(__RPC__inout_ecount_part, (size,length), _Inout_updates_to_(size, length))
#define __RPC__inout_ecount_full(size) _SAL1_2_Source_(__RPC__inout_ecount_full, (size), __RPC__inout_ecount_part(size, size))
#define __RPC__inout_ecount_full_string(size) _SAL1_2_Source_(__RPC__inout_ecount_full_string, (size), __RPC__inout_ecount_full(size) _Pre_ _Null_terminated_ _Post_ _Null_terminated_)
#define __RPC__inout_xcount(size) _SAL1_2_Source_(__RPC__inout_xcount, (size), _Inout_)
#define __RPC__inout_xcount_part(size, length) _SAL1_2_Source_(__RPC__inout_xcount_part, (size,length), _Inout_)
#define __RPC__inout_xcount_full(size) _SAL1_2_Source_(__RPC__inout_xcount_full, (size), __RPC__inout)
#define __RPC__inout_xcount_full_string(size) _SAL1_2_Source_(__RPC__inout_xcount_full_string, (size), __RPC__inout _Pre_ _Null_terminated_ _Post_ _Null_terminated_)
// [in,unique]
#define __RPC__in_opt _SAL1_2_Source_(__RPC__in_opt, (), _Pre_ _Notref_ _Maybenull_ _Pre_ _Valid_)
#define __RPC__in_opt_string _SAL1_2_Source_(__RPC__in_opt_string, (), __RPC__in_opt _Pre_ _Null_terminated_)
#define __RPC__in_ecount_opt(size) _SAL1_2_Source_(__RPC__in_ecount_opt, (size), __RPC__in_opt _Pre_readable_size_(size))
#define __RPC__in_ecount_opt_string(size) _SAL1_2_Source_(__RPC__in_ecount_opt_string, (size), __RPC__in_ecount_opt(size) _Pre_ _Null_terminated_)
#define __RPC__in_ecount_full_opt(size) _SAL1_2_Source_(__RPC__in_ecount_full_opt, (size), __RPC__in_ecount_opt(size))
#define __RPC__in_ecount_full_opt_string(size) _SAL1_2_Source_(__RPC__in_ecount_full_opt_string, (size), __RPC__in_ecount_full_opt(size) _Pre_ _Null_terminated_)
#define __RPC__in_ecount_part_opt(size, length) _SAL1_2_Source_(__RPC__in_ecount_part_opt, (size,length), __RPC__in_ecount_opt(length) _Pre_writable_size_(size))
#define __RPC__in_xcount_full_opt(size) _SAL1_2_Source_(__RPC__in_xcount_full_opt, (size), __RPC__in_ecount_opt(size))
#define __RPC__in_xcount_full_opt_string(size) _SAL1_2_Source_(__RPC__in_xcount_full_opt_string, (size), __RPC__in_ecount_full_opt(size) _Pre_ _Null_terminated_)
#define __RPC__in_xcount_part_opt(size, length) _SAL1_2_Source_(__RPC__in_xcount_part_opt, (size,length), __RPC__in_ecount_part_opt(size, length))
#define __RPC__in_xcount_opt(size) _SAL1_2_Source_(__RPC__in_xcount_opt, (size), __RPC__in_ecount_opt(size))
#define __RPC__in_xcount_opt_string(size) _SAL1_2_Source_(__RPC__in_xcount_opt_string, (size), __RPC__in_ecount_opt(size) _Pre_ _Null_terminated_)
// [in,out,unique]
#define __RPC__inout_opt _SAL1_2_Source_(__RPC__inout_opt, (), _Inout_opt_)
#define __RPC__inout_opt_string _SAL1_2_Source_(__RPC__inout_opt_string, (), __RPC__inout_opt _Pre_ _Null_terminated_)
#define __RPC__inout_ecount_opt(size) _SAL1_2_Source_(__RPC__inout_ecount_opt, (size), _Inout_updates_opt_(size))
#define __RPC__inout_ecount_part_opt(size, length) _SAL1_2_Source_(__RPC__inout_ecount_part_opt, (size,length), _Inout_updates_to_opt_(size, length))
#define __RPC__inout_ecount_full_opt(size) _SAL1_2_Source_(__RPC__inout_ecount_full_opt, (size), __RPC__inout_ecount_part_opt(size, size))
#define __RPC__inout_ecount_full_opt_string(size) _SAL1_2_Source_(__RPC__inout_ecount_full_opt_string, (size), __RPC__inout_ecount_full_opt(size) _Pre_ _Null_terminated_ _Post_ _Null_terminated_)
#define __RPC__inout_xcount_opt(size) _SAL1_2_Source_(__RPC__inout_xcount_opt, (size), _Inout_opt_)
#define __RPC__inout_xcount_part_opt(size, length) _SAL1_2_Source_(__RPC__inout_xcount_part_opt, (size,length), _Inout_opt_)
#define __RPC__inout_xcount_full_opt(size) _SAL1_2_Source_(__RPC__inout_xcount_full_opt, (size), __RPC__inout_opt)
#define __RPC__inout_xcount_full_opt_string(size) _SAL1_2_Source_(__RPC__inout_xcount_full_opt_string, (size), __RPC__inout_opt _Pre_ _Null_terminated_ _Post_ _Null_terminated_)
// [out] **
#define __RPC__deref_out _SAL1_2_Source_(__RPC__deref_out, (), _Outptr_)
#define __RPC__deref_out_string _SAL1_2_Source_(__RPC__deref_out_string, (), _Outptr_result_z_)
#define __RPC__deref_out_opt _SAL1_2_Source_(__RPC__deref_out_opt, (), __RPC__deref_out)
#define __RPC__deref_out_opt_string _SAL1_2_Source_(__RPC__deref_out_opt_string, (), _Outptr_result_maybenull_z_ _At_(*_Curr_, _Pre_opt_z_))
#define __RPC__deref_out_ecount(size) _SAL1_2_Source_(__RPC__deref_out_ecount, (size), _Outptr_result_buffer_(size))
#define __RPC__deref_out_ecount_part(size, length) _SAL1_2_Source_(__RPC__deref_out_ecount_part, (size,length), _Outptr_result_buffer_to_(size, length))
#define __RPC__deref_out_ecount_full(size) _SAL1_2_Source_(__RPC__deref_out_ecount_full, (size), __RPC__deref_out_ecount_part(size,size))
#define __RPC__deref_out_ecount_full_string(size) _SAL1_2_Source_(__RPC__deref_out_ecount_full_string, (size), __RPC__deref_out_ecount_full(size) _At_(*_Curr_, _Post_ _Null_terminated_))
#define __RPC__deref_out_xcount(size) _SAL1_2_Source_(__RPC__deref_out_xcount, (size), _Outptr_)
#define __RPC__deref_out_xcount_part(size, length) _SAL1_2_Source_(__RPC__deref_out_xcount_part, (size,length), __RPC__deref_out)
#define __RPC__deref_out_xcount_full(size) _SAL1_2_Source_(__RPC__deref_out_xcount_full, (size), __RPC__deref_out)
#define __RPC__deref_out_xcount_full_string(size) _SAL1_2_Source_(__RPC__deref_out_xcount_full_string, (size), __RPC__deref_out _At_(*_Curr_, _Post_ _Null_terminated_))
// [in,out] **, second pointer decoration.
#define __RPC__deref_inout _SAL1_2_Source_(__RPC__deref_inout, (), _Inout_ _At_(*_Curr_, _Pre_ _Notnull_ _Post_ _Notnull_))
#define __RPC__deref_inout_string _SAL1_2_Source_(__RPC__deref_inout_string, (), __RPC__deref_inout _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_inout_opt _SAL1_2_Source_(__RPC__deref_inout_opt, (), _Inout_ _At_(*_Curr_, _Pre_ _Maybenull_ _Post_ _Maybenull_))
#define __RPC__deref_inout_opt_string _SAL1_2_Source_(__RPC__deref_inout_opt_string, (), __RPC__deref_inout_opt _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_inout_ecount_opt(size) _SAL1_2_Source_(__RPC__deref_inout_ecount_opt, (size), __RPC__deref_inout_opt _At_(*_Curr_, _Pre_writable_size_(size) _Post_writable_size_(size)))
#define __RPC__deref_inout_ecount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_inout_ecount_part_opt, (size,length), __RPC__deref_inout_ecount_opt(size) _At_(*_Curr_, _Pre_readable_size_(length) _Post_readable_size_(length)))
#define __RPC__deref_inout_ecount_full_opt(size) _SAL1_2_Source_(__RPC__deref_inout_ecount_full_opt, (size), __RPC__deref_inout_ecount_part_opt(size, size))
#define __RPC__deref_inout_ecount_full(size) _SAL1_2_Source_(__RPC__deref_inout_ecount_full, (size), __RPC__deref_inout _At_(*_Curr_, _Pre_readable_size_(size) _Post_readable_size_(size)))
#define __RPC__deref_inout_ecount_full_string(size) _SAL1_2_Source_(__RPC__deref_inout_ecount_full_string, (size), __RPC__deref_inout_ecount_full(size) _At_(*_Curr_, _Post_ _Null_terminated_))
#define __RPC__deref_inout_ecount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_inout_ecount_full_opt_string, (size), __RPC__deref_inout_ecount_full_opt(size) _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_inout_xcount_opt(size) _SAL1_2_Source_(__RPC__deref_inout_xcount_opt, (size), __RPC__deref_inout_opt)
#define __RPC__deref_inout_xcount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_inout_xcount_part_opt, (size,length), __RPC__deref_inout_opt)
#define __RPC__deref_inout_xcount_full_opt(size) _SAL1_2_Source_(__RPC__deref_inout_xcount_full_opt, (size), __RPC__deref_inout_opt)
#define __RPC__deref_inout_xcount_full(size) _SAL1_2_Source_(__RPC__deref_inout_xcount_full, (size), __RPC__deref_inout)
#define __RPC__deref_inout_xcount_full_string(size) _SAL1_2_Source_(__RPC__deref_inout_xcount_full_string, (size), __RPC__deref_inout _At_(*_Curr_, _Post_ _Null_terminated_))
#define __RPC__deref_inout_xcount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_inout_xcount_full_opt_string, (size), __RPC__deref_inout_opt _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
// #define __RPC_out_opt out_opt is not allowed in rpc
// [in,out,unique]
#define __RPC__deref_opt_inout _SAL1_2_Source_(__RPC__deref_opt_inout, (), _Inout_opt_ _At_(*_Curr_, _Pre_ _Notnull_ _Post_ _Notnull_))
#define __RPC__deref_opt_inout_ecount(size) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount, (size), __RPC__deref_opt_inout _At_(*_Curr_, _Pre_writable_size_(size) _Post_writable_size_(size)))
#define __RPC__deref_opt_inout_string _SAL1_2_Source_(__RPC__deref_opt_inout_string, (), __RPC__deref_opt_inout _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_opt_inout_ecount_part(size, length) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_part, (size,length), __RPC__deref_opt_inout_ecount(size) _At_(*_Curr_, _Pre_readable_size_(length) _Post_readable_size_(length)))
#define __RPC__deref_opt_inout_ecount_full(size) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_full, (size), __RPC__deref_opt_inout_ecount_part(size, size))
#define __RPC__deref_opt_inout_ecount_full_string(size) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_full_string, (size), __RPC__deref_opt_inout_ecount_full(size) _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_opt_inout_xcount_part(size, length) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_part, (size,length), __RPC__deref_opt_inout)
#define __RPC__deref_opt_inout_xcount_full(size) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_full, (size), __RPC__deref_opt_inout)
#define __RPC__deref_opt_inout_xcount_full_string(size) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_full_string, (size), __RPC__deref_opt_inout_string)
#define __RPC__deref_out_ecount_opt(size) _SAL1_2_Source_(__RPC__deref_out_ecount_opt, (size), _Outptr_result_buffer_maybenull_(size) _At_(*_Curr_, _Pre_maybenull_))
#define __RPC__deref_out_ecount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_out_ecount_part_opt, (size,length), _Outptr_result_buffer_to_maybenull_(size, length) _At_(*_Curr_, _Pre_maybenull_))
#define __RPC__deref_out_ecount_full_opt(size) _SAL1_2_Source_(__RPC__deref_out_ecount_full_opt, (size), __RPC__deref_out_ecount_part_opt(size, size))
#define __RPC__deref_out_ecount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_out_ecount_full_opt_string, (size), __RPC__deref_out_ecount_part_opt(size, size) _At_(*_Curr_, _Post_ _Null_terminated_))
#define __RPC__deref_out_xcount_opt(size) _SAL1_2_Source_(__RPC__deref_out_xcount_opt, (size), __RPC__out _At_(*_Curr_, _Pre_maybenull_ _Pre_writable_size_(_Inexpressible_(size)) _Post_ _Maybenull_))
#define __RPC__deref_out_xcount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_out_xcount_part_opt, (size,length), __RPC__deref_out _At_(*_Curr_, _Pre_maybenull_ _Pre_writable_size_(_Inexpressible_(size)) _Post_ _Maybenull_))
#define __RPC__deref_out_xcount_full_opt(size) _SAL1_2_Source_(__RPC__deref_out_xcount_full_opt, (size), __RPC__deref_out_opt _At_(*_Curr_, _Pre_maybenull_ _Pre_writable_size_(_Inexpressible_(size))))
#define __RPC__deref_out_xcount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_out_xcount_full_opt_string, (size), __RPC__deref_out_opt _At_(*_Curr_, _Pre_maybenull_ _Pre_writable_size_(_Inexpressible_(size)) _Post_ _Null_terminated_))
#define __RPC__deref_opt_inout_opt _SAL1_2_Source_(__RPC__deref_opt_inout_opt, (), _Inout_opt_ _At_(*_Curr_, _Pre_ _Maybenull_ _Post_ _Maybenull_))
#define __RPC__deref_opt_inout_opt_string _SAL1_2_Source_(__RPC__deref_opt_inout_opt_string, (), __RPC__deref_opt_inout_opt _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_opt_inout_ecount_opt(size) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_opt, (size), _Inout_opt_ _At_(*_Curr_, _Pre_ _Maybenull_ _Pre_writable_size_(size) _Post_ _Maybenull_ _Post_writable_size_(size)))
#define __RPC__deref_opt_inout_ecount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_part_opt, (size,length), __RPC__deref_opt_inout_ecount_opt(size) _At_(*_Curr_, _Pre_readable_size_(length) _Post_readable_size_(length)))
#define __RPC__deref_opt_inout_ecount_full_opt(size) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_full_opt, (size), __RPC__deref_opt_inout_ecount_part_opt(size, size))
#define __RPC__deref_opt_inout_ecount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_opt_inout_ecount_full_opt_string, (size), __RPC__deref_opt_inout_ecount_full_opt(size) _At_(*_Curr_, _Pre_ _Null_terminated_ _Post_ _Null_terminated_))
#define __RPC__deref_opt_inout_xcount_opt(size) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_opt, (size), __RPC__deref_opt_inout_opt)
#define __RPC__deref_opt_inout_xcount_part_opt(size, length) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_part_opt, (size,length), __RPC__deref_opt_inout_opt)
#define __RPC__deref_opt_inout_xcount_full_opt(size) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_full_opt, (size), __RPC__deref_opt_inout_opt)
#define __RPC__deref_opt_inout_xcount_full_opt_string(size) _SAL1_2_Source_(__RPC__deref_opt_inout_xcount_full_opt_string, (size), __RPC__deref_opt_inout_opt_string)
#define __RPC_full_pointer _SAL1_2_Source_(__RPC_full_pointer, (), _Maybenull_)
#define __RPC_unique_pointer _SAL1_2_Source_(__RPC_unique_pointer, (), _Maybenull_)
#define __RPC_ref_pointer _SAL1_2_Source_(__RPC_ref_pointer, (), _Notnull_)
#define __RPC_string _SAL1_2_Source_(__RPC_string, (), _Null_terminated_)
#define __RPC__range(min,max) _SAL1_2_Source_(__RPC__range, (min,max), __range(min,max))
#define __RPC__in_range(min,max) _SAL1_2_Source_(__RPC__in_range, (min,max), _In_range_(min,max))
#ifdef __cplusplus
}
#endif

643
gfx/include/dxsdk/xapo.h Normal file
View File

@ -0,0 +1,643 @@
/*-========================================================================-_
| - XAPO - |
| Copyright (c) Microsoft Corporation. All rights reserved. |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|PROJECT: XAPO MODEL: Unmanaged User-mode |
|VERSION: 1.0 EXCEPT: No Exceptions |
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|BASE: N / A DIALECT: MSC++ 14.00 |
|>------------------------------------------------------------------------<|
| DUTY: Cross-platform Audio Processing Object interfaces |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
NOTES:
1. Definition of terms:
DSP: Digital Signal Processing.
CBR: Constant BitRate -- DSP that consumes a constant number of
input samples to produce an output sample.
For example, a 22kHz to 44kHz resampler is CBR DSP.
Even though the number of input to output samples differ,
the ratio between input to output rate remains constant.
All user-defined XAPOs are assumed to be CBR as
XAudio2 only allows CBR DSP to be added to an effect chain.
XAPO: Cross-platform Audio Processing Object --
a thin wrapper that manages DSP code, allowing it
to be easily plugged into an XAudio2 effect chain.
Frame: A block of samples, one per channel,
to be played simultaneously.
E.g. a mono stream has one sample per frame.
In-Place: Processing such that the input buffer equals the
output buffer (i.e. input data modified directly).
This form of processing is generally more efficient
than using separate memory for input and output.
However, an XAPO may not perform format conversion
when processing in-place.
2. XAPO member variables are divided into three classifications:
Immutable: Set once via IXAPO::Initialize and remain
constant during the lifespan of the XAPO.
Locked: May change before the XAPO is locked via
IXAPO::LockForProcess but remain constant
until IXAPO::UnlockForProcess is called.
Dynamic: May change from one processing pass to the next,
usually via IXAPOParameters::SetParameters.
XAPOs should assign reasonable defaults to their dynamic
variables during IXAPO::Initialize/LockForProcess so
that calling IXAPOParameters::SetParameters is not
required before processing begins.
When implementing an XAPO, determine the type of each variable and
initialize them in the appropriate method. Immutable variables are
generally preferable over locked which are preferable over dynamic.
That is, one should strive to minimize XAPO state changes for
best performance, maintainability, and ease of use.
3. To minimize glitches, the realtime audio processing thread must
not block. XAPO methods called by the realtime thread are commented
as non-blocking and therefore should not use blocking synchronization,
allocate memory, access the disk, etc. The XAPO interfaces were
designed to allow an effect implementer to move such operations
into other methods called on an application controlled thread.
4. Extending functionality is accomplished through the addition of new
COM interfaces. For example, if a new member is added to a parameter
structure, a new interface using the new structure should be added,
leaving the original interface unchanged.
This ensures consistent communication between future versions of
XAudio2 and various versions of XAPOs that may exist in an application.
5. All audio data is interleaved in XAudio2.
The default audio format for an effect chain is WAVE_FORMAT_IEEE_FLOAT.
6. User-defined XAPOs should assume all input and output buffers are
16-byte aligned.
7. See XAPOBase.h for an XAPO base class which provides a default
implementation for most of the interface methods defined below. */
#ifdef _MSC_VER
#pragma once
#endif
#include <sdkddkver.h>
#if(_WIN32_WINNT < _WIN32_WINNT_WIN8)
#error "This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions."
#endif // (_WIN32_WINNT < _WIN32_WINNT_WIN8)
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_TV_APP | WINAPI_PARTITION_TV_TITLE)*/
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
#include <basetyps.h>
// XAPO interface IDs
interface __declspec(uuid("A410B984-9839-4819-A0BE-2856AE6B3ADB")) IXAPO;
interface __declspec(uuid("26D95C66-80F2-499A-AD54-5AE7F01C6D98")) IXAPOParameters;
#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested
#include <windows.h>
#include <objbase.h>
#include <mmreg.h> // for WAVEFORMATEX etc.
// XAPO error codes
#define FACILITY_XAPO 0x897
#define XAPO_E_FORMAT_UNSUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAPO, 0x01) // requested audio format unsupported
// supported number of channels (samples per frame) range
#define XAPO_MIN_CHANNELS 1
#define XAPO_MAX_CHANNELS 64
// supported framerate range
#define XAPO_MIN_FRAMERATE 1000
#define XAPO_MAX_FRAMERATE 200000
// unicode string length, including terminator, used with XAPO_REGISTRATION_PROPERTIES
#define XAPO_REGISTRATION_STRING_LENGTH 256
// XAPO property flags, used with XAPO_REGISTRATION_PROPERTIES.Flags:
// Number of channels of input and output buffers must match,
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
#define XAPO_FLAG_CHANNELS_MUST_MATCH 0x00000001
// Framerate of input and output buffers must match,
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
#define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x00000002
// Bit depth of input and output buffers must match,
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
// Container size of input and output buffers must also match if
// XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat is WAVEFORMATEXTENSIBLE.
#define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x00000004
// Number of input and output buffers must match,
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.
//
// Also, XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount must
// equal XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount and
// XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount must equal
// XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount when used.
#define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x00000008
// XAPO must be run in-place. Use this flag only if your DSP
// implementation cannot process separate input and output buffers.
// If set, the following flags must also be set:
// XAPO_FLAG_CHANNELS_MUST_MATCH
// XAPO_FLAG_FRAMERATE_MUST_MATCH
// XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH
// XAPO_FLAG_BUFFERCOUNT_MUST_MATCH
// XAPO_FLAG_INPLACE_SUPPORTED
//
// Multiple input and output buffers may be used with in-place XAPOs,
// though the input buffer count must equal the output buffer count.
// When multiple input/output buffers are used, the XAPO may assume
// input buffer [N] equals output buffer [N] for in-place processing.
#define XAPO_FLAG_INPLACE_REQUIRED 0x00000020
// XAPO may be run in-place. If the XAPO is used in a chain
// such that the requirements for XAPO_FLAG_INPLACE_REQUIRED are met,
// XAudio2 will ensure the XAPO is run in-place. If not met, XAudio2
// will still run the XAPO albeit with separate input and output buffers.
//
// For example, consider an effect which may be ran in stereo->5.1 mode or
// mono->mono mode. When set to stereo->5.1, it will be run with separate
// input and output buffers as format conversion is not permitted in-place.
// However, if configured to run mono->mono, the same XAPO can be run
// in-place. Thus the same implementation may be conveniently reused
// for various input/output configurations, while taking advantage of
// in-place processing when possible.
#define XAPO_FLAG_INPLACE_SUPPORTED 0x00000010
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
// XAPO registration properties, describes general XAPO characteristics, used with IXAPO::GetRegistrationProperties
typedef struct XAPO_REGISTRATION_PROPERTIES {
CLSID clsid; // COM class ID, used with CoCreate
WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; // friendly name unicode string
WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; // copyright information unicode string
UINT32 MajorVersion; // major version
UINT32 MinorVersion; // minor version
UINT32 Flags; // XAPO property flags, describes supported input/output configuration
UINT32 MinInputBufferCount; // minimum number of input buffers required for processing, can be 0
UINT32 MaxInputBufferCount; // maximum number of input buffers supported for processing, must be >= MinInputBufferCount
UINT32 MinOutputBufferCount; // minimum number of output buffers required for processing, can be 0, must match MinInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
UINT32 MaxOutputBufferCount; // maximum number of output buffers supported for processing, must be >= MinOutputBufferCount, must match MaxInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
} XAPO_REGISTRATION_PROPERTIES;
// LockForProcess buffer parameters:
// Defines buffer parameters that remain constant while an XAPO is locked.
// Used with IXAPO::LockForProcess.
//
// For CBR XAPOs, MaxFrameCount is the only number of frames
// IXAPO::Process would have to handle for the respective buffer.
typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS {
const WAVEFORMATEX* pFormat; // buffer audio format
UINT32 MaxFrameCount; // maximum number of frames in respective buffer that IXAPO::Process would have to handle, irrespective of dynamic variable settings, can be 0
} XAPO_LOCKFORPROCESS_PARAMETERS;
// Buffer flags:
// Describes assumed content of the respective buffer.
// Used with XAPO_PROCESS_BUFFER_PARAMETERS.BufferFlags.
//
// This meta-data can be used by an XAPO to implement
// optimizations that require knowledge of a buffer's content.
//
// For example, XAPOs that always produce silent output from silent input
// can check the flag on the input buffer to determine if any signal
// processing is necessary. If silent, the XAPO may simply set the flag
// on the output buffer to silent and return, optimizing out the work of
// processing silent data: XAPOs that generate silence for any reason may
// set the buffer's flag accordingly rather than writing out silent
// frames to the buffer itself.
//
// The flags represent what should be assumed is in the respective buffer.
// The flags may not reflect what is actually stored in memory.
typedef enum XAPO_BUFFER_FLAGS {
XAPO_BUFFER_SILENT, // silent data should be assumed, respective memory may be uninitialized
XAPO_BUFFER_VALID, // arbitrary data should be assumed (may or may not be silent frames), respective memory initialized
} XAPO_BUFFER_FLAGS;
// Process buffer parameters:
// Defines buffer parameters that may change from one
// processing pass to the next. Used with IXAPO::Process.
//
// Note the byte size of the respective buffer must be at least:
// XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount * XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat->nBlockAlign
//
// Although the audio format and maximum size of the respective
// buffer is locked (defined by XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS),
// the actual memory address of the buffer given is permitted to change
// from one processing pass to the next.
//
// For CBR XAPOs, ValidFrameCount is constant while locked and equals
// the respective XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount.
typedef struct XAPO_PROCESS_BUFFER_PARAMETERS {
void* pBuffer; // audio data buffer, must be non-NULL
XAPO_BUFFER_FLAGS BufferFlags; // describes assumed content of pBuffer, does not affect ValidFrameCount
UINT32 ValidFrameCount; // number of frames of valid data, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs, does not affect BufferFlags
} XAPO_PROCESS_BUFFER_PARAMETERS;
//--------------<M-A-C-R-O-S>-----------------------------------------------//
// Memory allocation macros that allow one module to allocate memory and
// another to free it, by guaranteeing that the same heap manager is used
// regardless of differences between build environments of the two modules.
//
// Used by IXAPO methods that must allocate arbitrary sized structures
// such as WAVEFORMATEX that are subsequently returned to the application.
#define XAPOAlloc(size) CoTaskMemAlloc(size)
#define XAPOFree(p) CoTaskMemFree(p)
//--------------<I-N-T-E-R-F-A-C-E-S>---------------------------------------//
// IXAPO:
// The only mandatory XAPO COM interface -- a thin wrapper that manages
// DSP code, allowing it to be easily plugged into an XAudio2 effect chain.
#undef INTERFACE
#define INTERFACE IXAPO
DECLARE_INTERFACE_(IXAPO, IUnknown) {
////
// DESCRIPTION:
// Allocates a copy of the registration properties of the XAPO.
//
// PARAMETERS:
// ppRegistrationProperties - [out] receives pointer to copy of registration properties, use XAPOFree to free structure, left untouched on failure
//
// RETURN VALUE:
// COM error code
////
STDMETHOD(GetRegistrationProperties) (THIS_ _Outptr_ XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) PURE;
////
// DESCRIPTION:
// Queries if an input/output configuration is supported.
//
// REMARKS:
// This method allows XAPOs to express dependency of input format
// with respect to output format.
//
// If the input/output format pair configuration is unsupported,
// this method also determines the nearest input format supported.
// Nearest meaning closest bit depth, framerate, and channel count,
// in that order of importance.
//
// The behaviour of this method should remain constant after the
// XAPO has been initialized.
//
// PARAMETERS:
// pOutputFormat - [in] output format known to be supported
// pRequestedInputFormat - [in] input format to examine
// ppSupportedInputFormat - [out] receives pointer to nearest input format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED
//
// RETURN VALUE:
// COM error code, including:
// S_OK - input/output configuration supported, ppSupportedInputFormat left untouched
// XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedInputFormat receives pointer to nearest input format supported if not NULL
// E_INVALIDARG - either audio format invalid, ppSupportedInputFormat left untouched
////
STDMETHOD(IsInputFormatSupported) (THIS_ const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, _Outptr_opt_ WAVEFORMATEX** ppSupportedInputFormat) PURE;
////
// DESCRIPTION:
// Queries if an input/output configuration is supported.
//
// REMARKS:
// This method allows XAPOs to express dependency of output format
// with respect to input format.
//
// If the input/output format pair configuration is unsupported,
// this method also determines the nearest output format supported.
// Nearest meaning closest bit depth, framerate, and channel count,
// in that order of importance.
//
// The behaviour of this method should remain constant after the
// XAPO has been initialized.
//
// PARAMETERS:
// pInputFormat - [in] input format known to be supported
// pRequestedOutputFormat - [in] output format to examine
// ppSupportedOutputFormat - [out] receives pointer to nearest output format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED
//
// RETURN VALUE:
// COM error code, including:
// S_OK - input/output configuration supported, ppSupportedOutputFormat left untouched
// XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedOutputFormat receives pointer to nearest output format supported if not NULL
// E_INVALIDARG - either audio format invalid, ppSupportedOutputFormat left untouched
////
STDMETHOD(IsOutputFormatSupported) (THIS_ const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, _Outptr_opt_ WAVEFORMATEX** ppSupportedOutputFormat) PURE;
////
// DESCRIPTION:
// Performs any effect-specific initialization if required.
//
// REMARKS:
// The contents of pData are defined by the XAPO.
// Immutable variables (constant during the lifespan of the XAPO)
// should be set once via this method.
// Once initialized, an XAPO cannot be initialized again.
//
// An XAPO should be initialized before passing it to XAudio2
// as part of an effect chain. XAudio2 will not call this method;
// it exists for future content-driven initialization.
//
// PARAMETERS:
// pData - [in] effect-specific initialization parameters, may be NULL if DataByteSize == 0
// DataByteSize - [in] size of pData in bytes, may be 0 if pData is NULL
//
// RETURN VALUE:
// COM error code
////
STDMETHOD(Initialize) (THIS_ _In_reads_bytes_opt_(DataByteSize) const void* pData, UINT32 DataByteSize) PURE;
////
// DESCRIPTION:
// Resets variables dependent on frame history.
//
// REMARKS:
// All other variables remain unchanged, including variables set by
// IXAPOParameters::SetParameters.
//
// For example, an effect with delay should zero out its delay line
// during this method, but should not reallocate anything as the
// XAPO remains locked with a constant input/output configuration.
//
// XAudio2 calls this method only if the XAPO is locked.
// This method should not block as it is called from the
// realtime thread.
//
// PARAMETERS:
// void
//
// RETURN VALUE:
// void
////
STDMETHOD_(void, Reset) (THIS) PURE;
////
// DESCRIPTION:
// Locks the XAPO to a specific input/output configuration,
// allowing it to do any final initialization before Process
// is called on the realtime thread.
//
// REMARKS:
// Once locked, the input/output configuration and any other locked
// variables remain constant until UnlockForProcess is called.
//
// XAPOs should assert the input/output configuration is supported
// and that any required effect-specific initialization is complete.
// IsInputFormatSupported, IsOutputFormatSupported, and Initialize
// should be called as necessary before this method is called.
//
// All internal memory buffers required for Process should be
// allocated by the time this method returns successfully
// as Process is non-blocking and should not allocate memory.
//
// Once locked, an XAPO cannot be locked again until
// UnLockForProcess is called.
//
// PARAMETERS:
// InputLockedParameterCount - [in] number of input buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount]
// pInputLockedParameters - [in] array of input locked buffer parameter structures, may be NULL if InputLockedParameterCount == 0, otherwise must have InputLockedParameterCount elements
// OutputLockedParameterCount - [in] number of output buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount], must match InputLockedParameterCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
// pOutputLockedParameters - [in] array of output locked buffer parameter structures, may be NULL if OutputLockedParameterCount == 0, otherwise must have OutputLockedParameterCount elements
//
// RETURN VALUE:
// COM error code
////
STDMETHOD(LockForProcess) (THIS_ UINT32 InputLockedParameterCount, _In_reads_opt_(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, _In_reads_opt_(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) PURE;
////
// DESCRIPTION:
// Opposite of LockForProcess. Variables allocated during
// LockForProcess should be deallocated by this method.
//
// REMARKS:
// Unlocking an XAPO allows an XAPO instance to be reused with
// different input/output configurations.
//
// PARAMETERS:
// void
//
// RETURN VALUE:
// void
////
STDMETHOD_(void, UnlockForProcess) (THIS) PURE;
////
// DESCRIPTION:
// Runs the XAPO's DSP code on the given input/output buffers.
//
// REMARKS:
// In addition to writing to the output buffers as appropriate,
// an XAPO must set the BufferFlags and ValidFrameCount members
// of all elements in pOutputProcessParameters accordingly.
//
// ppInputProcessParameters will not necessarily be the same as
// ppOutputProcessParameters for in-place processing, rather
// the pBuffer members of each will point to the same memory.
//
// Multiple input/output buffers may be used with in-place XAPOs,
// though the input buffer count must equal the output buffer count.
// When multiple input/output buffers are used with in-place XAPOs,
// the XAPO may assume input buffer [N] equals output buffer [N].
//
// When IsEnabled is FALSE, the XAPO should process thru.
// Thru processing means an XAPO should not apply its normal
// processing to the given input/output buffers during Process.
// It should instead pass data from input to output with as little
// modification possible. Effects that perform format conversion
// should continue to do so. The effect must ensure transitions
// between normal and thru processing do not introduce
// discontinuities into the signal.
//
// XAudio2 calls this method only if the XAPO is locked.
// This method should not block as it is called from the
// realtime thread.
//
// PARAMETERS:
// InputProcessParameterCount - [in] number of input buffers, matches respective InputLockedParameterCount parameter given to LockForProcess
// pInputProcessParameters - [in] array of input process buffer parameter structures, may be NULL if InputProcessParameterCount == 0, otherwise must have InputProcessParameterCount elements
// OutputProcessParameterCount - [in] number of output buffers, matches respective OutputLockedParameterCount parameter given to LockForProcess
// pOutputProcessParameters - [in/out] array of output process buffer parameter structures, may be NULL if OutputProcessParameterCount == 0, otherwise must have OutputProcessParameterCount elements
// IsEnabled - [in] TRUE to process normally, FALSE to process thru
//
// RETURN VALUE:
// void
////
STDMETHOD_(void, Process) (THIS_ UINT32 InputProcessParameterCount, _In_reads_opt_(InputProcessParameterCount) const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters, UINT32 OutputProcessParameterCount, _Inout_updates_opt_(OutputProcessParameterCount) XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters, BOOL IsEnabled) PURE;
////
// DESCRIPTION:
// Returns the number of input frames required to generate the
// requested number of output frames.
//
// REMARKS:
// XAudio2 may call this method to determine how many input frames
// an XAPO requires. This is constant for locked CBR XAPOs;
// this method need only be called once while an XAPO is locked.
//
// XAudio2 calls this method only if the XAPO is locked.
// This method should not block as it is called from the
// realtime thread.
//
// PARAMETERS:
// OutputFrameCount - [in] requested number of output frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
//
// RETURN VALUE:
// number of input frames required
////
STDMETHOD_(UINT32, CalcInputFrames) (THIS_ UINT32 OutputFrameCount) PURE;
////
// DESCRIPTION:
// Returns the number of output frames generated for the
// requested number of input frames.
//
// REMARKS:
// XAudio2 may call this method to determine how many output frames
// an XAPO will generate. This is constant for locked CBR XAPOs;
// this method need only be called once while an XAPO is locked.
//
// XAudio2 calls this method only if the XAPO is locked.
// This method should not block as it is called from the
// realtime thread.
//
// PARAMETERS:
// InputFrameCount - [in] requested number of input frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
//
// RETURN VALUE:
// number of output frames generated
////
STDMETHOD_(UINT32, CalcOutputFrames) (THIS_ UINT32 InputFrameCount) PURE;
};
// IXAPOParameters:
// Optional XAPO COM interface that allows an XAPO to use
// effect-specific parameters.
#undef INTERFACE
#define INTERFACE IXAPOParameters
DECLARE_INTERFACE_(IXAPOParameters, IUnknown) {
////
// DESCRIPTION:
// Sets effect-specific parameters.
//
// REMARKS:
// This method may only be called on the realtime thread;
// no synchronization between it and IXAPO::Process is necessary.
//
// This method should not block as it is called from the
// realtime thread.
//
// PARAMETERS:
// pParameters - [in] effect-specific parameter block, must be != NULL
// ParameterByteSize - [in] size of pParameters in bytes, must be > 0
//
// RETURN VALUE:
// void
////
STDMETHOD_(void, SetParameters) (THIS_ _In_reads_bytes_(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize) PURE;
////
// DESCRIPTION:
// Gets effect-specific parameters.
//
// REMARKS:
// Unlike SetParameters, XAudio2 does not call this method on the
// realtime thread. Thus, the XAPO must protect variables shared
// with SetParameters/Process using appropriate synchronization.
//
// PARAMETERS:
// pParameters - [out] receives effect-specific parameter block, must be != NULL
// ParameterByteSize - [in] size of pParameters in bytes, must be > 0
//
// RETURN VALUE:
// void
////
STDMETHOD_(void, GetParameters) (THIS_ _Out_writes_bytes_(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize) PURE;
};
//--------------<M-A-C-R-O-S>-----------------------------------------------//
// macros to allow XAPO interfaces to be used in C code
#if !defined(__cplusplus)
// IXAPO
#define IXAPO_QueryInterface(This, riid, ppInterface) \
( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) )
#define IXAPO_AddRef(This) \
( (This)->lpVtbl->AddRef(This) )
#define IXAPO_Release(This) \
( (This)->lpVtbl->Release(This) )
#define IXAPO_GetRegistrationProperties(This, ppRegistrationProperties) \
( (This)->lpVtbl->GetRegistrationProperties(This, ppRegistrationProperties) )
#define IXAPO_IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) \
( (This)->lpVtbl->IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) )
#define IXAPO_IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) \
( (This)->lpVtbl->IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) )
#define IXAPO_Initialize(This, pData, DataByteSize) \
( (This)->lpVtbl->Initialize(This, pData, DataByteSize) )
#define IXAPO_Reset(This) \
( (This)->lpVtbl->Reset(This) )
#define IXAPO_LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) \
( (This)->lpVtbl->LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) )
#define IXAPO_UnlockForProcess(This) \
( (This)->lpVtbl->UnlockForProcess(This) )
#define IXAPO_Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) \
( (This)->lpVtbl->Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) )
#define IXAPO_CalcInputFrames(This, OutputFrameCount) \
( (This)->lpVtbl->CalcInputFrames(This, OutputFrameCount) )
#define IXAPO_CalcOutputFrames(This, InputFrameCount) \
( (This)->lpVtbl->CalcOutputFrames(This, InputFrameCount) )
// IXAPOParameters
#define IXAPOParameters_QueryInterface(This, riid, ppInterface) \
( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) )
#define IXAPOParameters_AddRef(This) \
( (This)->lpVtbl->AddRef(This) )
#define IXAPOParameters_Release(This) \
( (This)->lpVtbl->Release(This) )
#define IXAPOParameters_SetParameters(This, pParameters, ParameterByteSize) \
( (This)->lpVtbl->SetParameters(This, pParameters, ParameterByteSize) )
#define IXAPOParameters_GetParameters(This, pParameters, ParameterByteSize) \
( (This)->lpVtbl->GetParameters(This, pParameters, ParameterByteSize) )
#endif // !defined(__cplusplus)
#pragma pack(pop) // revert packing alignment
#endif // !defined(GUID_DEFS_ONLY)
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_TV_APP | WINAPI_PARTITION_TV_TITLE) */
/*#pragma endregion*/
//---------------------------------<-EOF->----------------------------------//

View File

@ -0,0 +1,352 @@
/*-========================================================================-_
| - XAPO - |
| Copyright (c) Microsoft Corporation. All rights reserved. |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|PROJECT: XAPO MODEL: Unmanaged User-mode |
|VERSION: 1.0 EXCEPT: No Exceptions |
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|BASE: N / A DIALECT: MSC++ 14.00 |
|>------------------------------------------------------------------------<|
| DUTY: XAPO base classes |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
NOTES:
1. See XAPO.h for the rules governing XAPO interface behaviour. */
#ifdef _MSC_VER
#pragma once
#endif
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
#include "XAPO.h"
// default audio format ranges supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat
#define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT // 32-bit float only, applies to WAVEFORMATEX.wFormatTag or WAVEFORMATEXTENSIBLE.SubFormat when used
#define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS // minimum channel count, applies to WAVEFORMATEX.nChannels
#define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS // maximum channel count, applies to WAVEFORMATEX.nChannels
#define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE // minimum framerate, applies to WAVEFORMATEX.nSamplesPerSec
#define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE // maximum framerate, applies to WAVEFORMATEX.nSamplesPerSec
#define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 // 32-bit float only, applies to WAVEFORMATEX.wBitsPerSample and WAVEFORMATEXTENSIBLE.wValidBitsPerSample when used
// default XAPO property flags supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS
#define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED)
// default number of input and output buffers supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS
#define XAPOBASE_DEFAULT_BUFFER_COUNT 1
//--------------<M-A-C-R-O-S>-----------------------------------------------//
// assertion
#if !defined(XAPOASSERT)
#if XAPODEBUG
#define XAPOASSERT(exp) if (!(exp)) { OutputDebugStringA("XAPO ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); }
#else
#define XAPOASSERT(exp) __assume(exp)
#endif
#endif
#if !defined(XAPOASSERT_NO_OUTPUT)
#if XAPODEBUG
#define XAPOASSERT_NO_OUTPUT(exp) if (!(exp)) { __debugbreak(); }
#else
#define XAPOASSERT_NO_OUTPUT(exp) __assume(exp)
#endif
#endif
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
#pragma pack(push, 8) // set packing alignment to ensure consistency across arbitrary build environments, and ensure synchronization variables used by Interlocked functionality are correctly aligned
// primitive types
typedef float FLOAT32; // 32-bit IEEE float
////
// DESCRIPTION:
// Default implementation of the IXAPO and IUnknown interfaces.
// Provides overridable implementations for all methods save IXAPO::Process.
////
class __declspec(novtable) CXAPOBase: public IXAPO {
private:
const XAPO_REGISTRATION_PROPERTIES* m_pRegistrationProperties; // pointer to registration properties of the XAPO, set via constructor
void* m_pfnMatrixMixFunction; // optimal matrix function pointer, used for thru processing
FLOAT32* m_pfl32MatrixCoefficients; // matrix coefficient table, used for thru processing
UINT32 m_nSrcFormatType; // input format type, used for thru processing
BOOL m_fIsScalarMatrix; // TRUE if m_pfl32MatrixCoefficients is diagonal matrix with all main diagonal entries equal, i.e. m_pfnMatrixMixFunction only used for type conversion (no channel conversion), used for thru processing
BOOL m_fIsLocked; // TRUE if XAPO locked via CXAPOBase.LockForProcess
protected:
LONG m_lReferenceCount; // COM reference count, must be aligned for atomic operations
////
// DESCRIPTION:
// Verifies an audio format falls within the default ranges supported.
//
// REMARKS:
// If pFormat is unsupported, and fOverwrite is TRUE,
// pFormat is overwritten with the nearest format supported.
// Nearest meaning closest bit depth, framerate, and channel count,
// in that order of importance.
//
// PARAMETERS:
// pFormat - [in/out] audio format to examine
// fOverwrite - [in] TRUE to overwrite pFormat if audio format unsupported
//
// RETURN VALUE:
// COM error code, including:
// S_OK - audio format supported, pFormat left untouched
// XAPO_E_FORMAT_UNSUPPORTED - audio format unsupported, pFormat overwritten with nearest audio format supported if fOverwrite TRUE
// E_INVALIDARG - audio format invalid, pFormat left untouched
////
virtual HRESULT ValidateFormatDefault (_Inout_ WAVEFORMATEX* pFormat, BOOL fOverwrite);
////
// DESCRIPTION:
// Verifies that an input/output format pair configuration is supported
// with respect to the XAPO property flags.
//
// REMARKS:
// If pRequestedFormat is unsupported, and fOverwrite is TRUE,
// pRequestedFormat is overwritten with the nearest format supported.
// Nearest meaning closest bit depth, framerate, and channel count,
// in that order of importance.
//
// PARAMETERS:
// pSupportedFormat - [in] audio format known to be supported
// pRequestedFormat - [in/out] audio format to examine, must be WAVEFORMATEXTENSIBLE if fOverwrite TRUE
// fOverwrite - [in] TRUE to overwrite pRequestedFormat if input/output configuration unsupported
//
// RETURN VALUE:
// COM error code, including:
// S_OK - input/output configuration supported, pRequestedFormat left untouched
// XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, pRequestedFormat overwritten with nearest audio format supported if fOverwrite TRUE
// E_INVALIDARG - either audio format invalid, pRequestedFormat left untouched
////
HRESULT ValidateFormatPair (const WAVEFORMATEX* pSupportedFormat, _Inout_ WAVEFORMATEX* pRequestedFormat, BOOL fOverwrite);
////
// DESCRIPTION:
// This method may be called by an IXAPO::Process implementation
// for thru processing. It copies/mixes data from source to
// destination, making as few changes as possible to the audio data.
//
// REMARKS:
// However, this method is capable of channel upmix/downmix and uses
// the same matrix coefficient table used by windows Vista to do so.
//
// For in-place processing (input buffer == output buffer)
// this method does nothing.
//
// This method should be called only if the XAPO is locked and
// XAPO_FLAG_FRAMERATE_MUST_MATCH is used.
//
// PARAMETERS:
// pInputBuffer - [in] input buffer, format may be INT8, INT16, INT20 (contained in 24 or 32 bits), INT24 (contained in 24 or 32 bits), INT32, or FLOAT32
// pOutputBuffer - [out] output buffer, format must be FLOAT32
// FrameCount - [in] number of frames to process
// InputChannelCount - [in] number of input channels
// OutputChannelCount - [in] number of output channels
// MixWithOutput - [in] TRUE to mix with output, FALSE to overwrite output
//
// RETURN VALUE:
// void
////
void ProcessThru (const void* pInputBuffer, _Inout_updates_(FrameCount*OutputChannelCount) FLOAT32* pOutputBuffer, UINT32 FrameCount, UINT32 InputChannelCount, UINT32 OutputChannelCount, BOOL MixWithOutput);
// accessors
const XAPO_REGISTRATION_PROPERTIES* GetRegistrationPropertiesInternal () { return m_pRegistrationProperties; }
BOOL IsLocked () { return m_fIsLocked; }
public:
CXAPOBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties);
virtual ~CXAPOBase ();
// IUnknown methods:
// retrieves the requested interface pointer if supported
STDMETHOD(QueryInterface) (REFIID riid, _Outptr_ void** ppInterface)
{
XAPOASSERT(ppInterface != NULL);
HRESULT hr = S_OK;
if (riid == __uuidof(IXAPO)) {
*ppInterface = static_cast<IXAPO*>(this);
AddRef();
} else if (riid == __uuidof(IUnknown)) {
*ppInterface = static_cast<IUnknown*>(this);
AddRef();
} else {
*ppInterface = NULL;
hr = E_NOINTERFACE;
}
return hr;
}
// increments reference count
STDMETHOD_(ULONG, AddRef) ()
{
return (ULONG)InterlockedIncrement(&m_lReferenceCount);
}
// decrements reference count and deletes the object if the reference count falls to zero
STDMETHOD_(ULONG, Release) ()
{
ULONG uTmpReferenceCount = (ULONG)InterlockedDecrement(&m_lReferenceCount);
if (uTmpReferenceCount == 0) {
delete this;
}
return uTmpReferenceCount;
}
// IXAPO methods:
// Allocates a copy of the registration properties of the XAPO.
// This default implementation returns a copy of the registration
// properties given to the constructor, allocated via XAPOAlloc.
STDMETHOD(GetRegistrationProperties) (_Outptr_ XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties);
// Queries if a specific input format is supported for a given output format.
// This default implementation assumes only the format described by the
// XAPOBASE_DEFAULT_FORMAT values are supported for both input and output.
STDMETHOD(IsInputFormatSupported) (const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, _Outptr_opt_ WAVEFORMATEX** ppSupportedInputFormat);
// Queries if a specific output format is supported for a given input format.
// This default implementation assumes only the format described by the
// XAPOBASE_DEFAULT_FORMAT values are supported for both input and output.
STDMETHOD(IsOutputFormatSupported) (const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, _Outptr_opt_ WAVEFORMATEX** ppSupportedOutputFormat);
// Performs any effect-specific initialization.
// This default implementation is a no-op and only returns S_OK.
STDMETHOD(Initialize) (_In_reads_bytes_opt_(DataByteSize) const void*, UINT32 DataByteSize)
{
UNREFERENCED_PARAMETER(DataByteSize);
return S_OK;
}
// Resets variables dependent on frame history.
// This default implementation is a no-op: this base class contains no
// relevant state to reset.
STDMETHOD_(void, Reset) () { return; }
// Notifies XAPO of buffer formats Process() will be given.
// This default implementation performs basic input/output format
// validation against the XAPO's registration properties.
// Derived XAPOs should call the base implementation first.
STDMETHOD(LockForProcess) (_Pre_equal_to_(OutputLockedParameterCount) UINT32 InputLockedParameterCount, _In_reads_opt_(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, _Pre_equal_to_(InputLockedParameterCount) UINT32 OutputLockedParameterCount, _In_reads_opt_(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters);
// Opposite of LockForProcess.
// Derived XAPOs should call the base implementation first.
STDMETHOD_(void, UnlockForProcess) ();
// Returns the number of input frames required to generate the requested number of output frames.
// By default, this method returns the same number of frames it was passed.
STDMETHOD_(UINT32, CalcInputFrames) (UINT32 OutputFrameCount) { return OutputFrameCount; }
// Returns the number of output frames generated for the requested number of input frames.
// By default, this method returns the same number of frames it was passed.
STDMETHOD_(UINT32, CalcOutputFrames) (UINT32 InputFrameCount) { return InputFrameCount; }
};
//--------------------------------------------------------------------------//
////
// DESCRIPTION:
// Extends CXAPOBase, providing a default implementation of the
// IXAPOParameters interface with appropriate synchronization to
// protect variables shared between IXAPOParameters::GetParameters
// and IXAPOParameters::SetParameters/IXAPO::Process.
//
// This class is for parameter blocks whose size is larger than 4 bytes.
// For smaller parameter blocks, use atomic operations directly
// on the parameters for synchronization.
////
class __declspec(novtable) CXAPOParametersBase: public CXAPOBase, public IXAPOParameters {
private:
BYTE* m_pParameterBlocks; // three contiguous process parameter blocks used for synchronization, user responsible for initialization of parameter blocks before IXAPO::Process/SetParameters/GetParameters called
BYTE* m_pCurrentParameters; // pointer to current process parameters, must be aligned for atomic operations
BYTE* m_pCurrentParametersInternal; // pointer to current process parameters (temp pointer read by SetParameters/BeginProcess/EndProcess)
UINT32 m_uCurrentParametersIndex; // index of current process parameters
UINT32 m_uParameterBlockByteSize; // size of a single parameter block in bytes, must be > 0
BOOL m_fNewerResultsReady; // TRUE if there exists new processing results not yet picked up by GetParameters(), must be aligned for atomic operations
BOOL m_fProducer; // TRUE if IXAPO::Process produces data to be returned by GetParameters(), SetParameters() and ParametersChanged() disallowed
public:
////
// PARAMETERS:
// pRegistrationProperties - [in] registration properties of the XAPO
// pParameterBlocks - [in] three contiguous process parameter blocks used for synchronization
// uParameterBlockByteSize - [in] size of one of the parameter blocks, must be > 0, should be > 4
// fProducer - [in] TRUE if IXAPO::Process produces data to be returned by GetParameters() (SetParameters() and ParametersChanged() disallowed)
////
CXAPOParametersBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties, _In_reads_bytes_opt_(3*uParameterBlockByteSize) BYTE* pParameterBlocks, UINT32 uParameterBlockByteSize, BOOL fProducer);
virtual ~CXAPOParametersBase ();
// IUnknown methods:
// retrieves the requested interface pointer if supported
STDMETHOD(QueryInterface) (REFIID riid, _Outptr_result_maybenull_ void** ppInterface)
{
XAPOASSERT(ppInterface != NULL);
HRESULT hr = S_OK;
if (riid == __uuidof(IXAPOParameters)) {
*ppInterface = static_cast<IXAPOParameters*>(this);
CXAPOBase::AddRef();
} else {
hr = CXAPOBase::QueryInterface(riid, ppInterface);
}
return hr;
}
// increments reference count
STDMETHOD_(ULONG, AddRef)() { return CXAPOBase::AddRef(); }
// decrements reference count and deletes the object if the reference count falls to zero
STDMETHOD_(ULONG, Release)() { return CXAPOBase::Release(); }
// IXAPOParameters methods:
// Sets effect-specific parameters.
// This method may only be called on the realtime audio processing thread.
STDMETHOD_(void, SetParameters) (_In_reads_bytes_(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize);
// Gets effect-specific parameters.
// This method may block and should not be called from the realtime thread.
// Get the current parameters via BeginProcess.
STDMETHOD_(void, GetParameters) (_Out_writes_bytes_(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize);
// Called by SetParameters() to allow for user-defined parameter validation.
// SetParameters validates that ParameterByteSize == m_uParameterBlockByteSize
// so the user may assume/assert ParameterByteSize == m_uParameterBlockByteSize.
// This method should not block as it is called from the realtime thread.
virtual void OnSetParameters (_In_reads_bytes_(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize)
{
XAPOASSERT(m_uParameterBlockByteSize > 0);
XAPOASSERT(pParameters != NULL);
XAPOASSERT(ParameterByteSize == m_uParameterBlockByteSize);
}
// Returns TRUE if SetParameters() has been called since the last processing pass.
// May only be used within the XAPO's IXAPO::Process implementation,
// before BeginProcess is called.
BOOL ParametersChanged ();
// Returns latest process parameters.
// XAPOs must call this method within their IXAPO::Process
// implementation to access latest process parameters in threadsafe manner.
BYTE* BeginProcess ();
// Notifies CXAPOParametersBase that the XAPO has finished accessing
// the latest process parameters.
// XAPOs must call this method within their IXAPO::Process
// implementation to access latest process parameters in threadsafe manner.
void EndProcess ();
};
#pragma pack(pop) // revert packing alignment
//---------------------------------<-EOF->----------------------------------//

184
gfx/include/dxsdk/xapofx.h Normal file
View File

@ -0,0 +1,184 @@
/*-========================================================================-_
| - XAPOFX - |
| Copyright (c) Microsoft Corporation. All rights reserved. |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|PROJECT: XAPOFX MODEL: Unmanaged User-mode |
|VERSION: 1.3 EXCEPT: No Exceptions |
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|BASE: N / A DIALECT: MSC++ 14.00 |
|>------------------------------------------------------------------------<|
| DUTY: Cross-platform Audio Processing Objects |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
*/
#ifdef _MSC_VER
#pragma once
#endif
#include <sdkddkver.h>
#if(_WIN32_WINNT < _WIN32_WINNT_WIN8)
#error "This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions."
#endif // (_WIN32_WINNT < _WIN32_WINNT_WIN8)
/*#include <winapifamily.h>*/
/*#pragma region Application Family*/
/*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_TV_APP | WINAPI_PARTITION_TV_TITLE)*/
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
// FX class IDs
class __declspec(uuid("F5E01117-D6C4-485A-A3F5-695196F3DBFA")) FXEQ;
class __declspec(uuid("C4137916-2BE1-46FD-8599-441536F49856")) FXMasteringLimiter;
class __declspec(uuid("7D9ACA56-CB68-4807-B632-B137352E8596")) FXReverb;
class __declspec(uuid("5039D740-F736-449A-84D3-A56202557B87")) FXEcho;
#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested
#include <windows.h>
#include <objbase.h>
#include <float.h> // float bounds
// EQ parameter bounds (inclusive), used with FXEQ:
#define FXEQ_MIN_FRAMERATE 22000
#define FXEQ_MAX_FRAMERATE 48000
#define FXEQ_MIN_FREQUENCY_CENTER 20.0f
#define FXEQ_MAX_FREQUENCY_CENTER 20000.0f
#define FXEQ_DEFAULT_FREQUENCY_CENTER_0 100.0f // band 0
#define FXEQ_DEFAULT_FREQUENCY_CENTER_1 800.0f // band 1
#define FXEQ_DEFAULT_FREQUENCY_CENTER_2 2000.0f // band 2
#define FXEQ_DEFAULT_FREQUENCY_CENTER_3 10000.0f // band 3
#define FXEQ_MIN_GAIN 0.126f // -18dB
#define FXEQ_MAX_GAIN 7.94f // +18dB
#define FXEQ_DEFAULT_GAIN 1.0f // 0dB change, all bands
#define FXEQ_MIN_BANDWIDTH 0.1f
#define FXEQ_MAX_BANDWIDTH 2.0f
#define FXEQ_DEFAULT_BANDWIDTH 1.0f // all bands
// Mastering limiter parameter bounds (inclusive), used with FXMasteringLimiter:
#define FXMASTERINGLIMITER_MIN_RELEASE 1
#define FXMASTERINGLIMITER_MAX_RELEASE 20
#define FXMASTERINGLIMITER_DEFAULT_RELEASE 6
#define FXMASTERINGLIMITER_MIN_LOUDNESS 1
#define FXMASTERINGLIMITER_MAX_LOUDNESS 1800
#define FXMASTERINGLIMITER_DEFAULT_LOUDNESS 1000
// Reverb parameter bounds (inclusive), used with FXReverb:
#define FXREVERB_MIN_DIFFUSION 0.0f
#define FXREVERB_MAX_DIFFUSION 1.0f
#define FXREVERB_DEFAULT_DIFFUSION 0.9f
#define FXREVERB_MIN_ROOMSIZE 0.0001f
#define FXREVERB_MAX_ROOMSIZE 1.0f
#define FXREVERB_DEFAULT_ROOMSIZE 0.6f
// Echo initialization data/parameter bounds (inclusive), used with FXEcho:
#define FXECHO_MIN_WETDRYMIX 0.0f
#define FXECHO_MAX_WETDRYMIX 1.0f
#define FXECHO_DEFAULT_WETDRYMIX 0.5f
#define FXECHO_MIN_FEEDBACK 0.0f
#define FXECHO_MAX_FEEDBACK 1.0f
#define FXECHO_DEFAULT_FEEDBACK 0.5f
#define FXECHO_MIN_DELAY 1.0f
#define FXECHO_MAX_DELAY 2000.0f
#define FXECHO_DEFAULT_DELAY 500.0f
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
// EQ parameters (4 bands), used with IXAPOParameters::SetParameters:
// The EQ supports only FLOAT32 audio foramts.
// The framerate must be within [22000, 48000] Hz.
typedef struct FXEQ_PARAMETERS {
float FrequencyCenter0; // center frequency in Hz, band 0
float Gain0; // boost/cut
float Bandwidth0; // bandwidth, region of EQ is center frequency +/- bandwidth/2
float FrequencyCenter1; // band 1
float Gain1;
float Bandwidth1;
float FrequencyCenter2; // band 2
float Gain2;
float Bandwidth2;
float FrequencyCenter3; // band 3
float Gain3;
float Bandwidth3;
} FXEQ_PARAMETERS;
// Mastering limiter parameters, used with IXAPOParameters::SetParameters:
// The mastering limiter supports only FLOAT32 audio formats.
typedef struct FXMASTERINGLIMITER_PARAMETERS {
UINT32 Release; // release time (tuning factor with no specific units)
UINT32 Loudness; // loudness target (threshold)
} FXMASTERINGLIMITER_PARAMETERS;
// Reverb parameters, used with IXAPOParameters::SetParameters:
// The reverb supports only FLOAT32 audio formats with the following
// channel configurations:
// Input: Mono Output: Mono
// Input: Stereo Output: Stereo
typedef struct FXREVERB_PARAMETERS {
float Diffusion; // diffusion
float RoomSize; // room size
} FXREVERB_PARAMETERS;
// Echo initialization data, used with CreateFX:
// Use of this structure is optional, the default MaxDelay is FXECHO_DEFAULT_DELAY.
typedef struct FXECHO_INITDATA {
float MaxDelay; // maximum delay (all channels) in milliseconds, must be within [FXECHO_MIN_DELAY, FXECHO_MAX_DELAY]
} FXECHO_INITDATA;
// Echo parameters, used with IXAPOParameters::SetParameters:
// The echo supports only FLOAT32 audio formats.
typedef struct FXECHO_PARAMETERS {
float WetDryMix; // ratio of wet (processed) signal to dry (original) signal
float Feedback; // amount of output fed back into input
float Delay; // delay (all channels) in milliseconds, must be within [FXECHO_MIN_DELAY, FXECHO_PARAMETERS.MaxDelay]
} FXECHO_PARAMETERS;
//--------------<M-A-C-R-O-S>-----------------------------------------------//
// function storage-class attribute and calltype
#if !defined(FXDLL)
#define FX_API_(type) EXTERN_C type STDAPIVCALLTYPE
#else
#if defined(FXEXPORT)
#define FX_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE
#else
#define FX_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE
#endif
#endif
#define FX_IMP_(type) type STDMETHODVCALLTYPE
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
// creates instance of requested XAPO, use Release to free instance
// pInitData - [in] effect-specific initialization parameters, may be NULL if InitDataByteSize == 0
// InitDataByteSize - [in] size of pInitData in bytes, may be 0 if pInitData is NULL
FX_API_(HRESULT) CreateFX (REFCLSID clsid, _Outptr_ IUnknown** pEffect, _In_reads_bytes_opt_(InitDataByteSize) const void* pInitData=NULL, UINT32 InitDataByteSize=0);
#pragma pack(pop) // revert packing alignment
#endif // !defined(GUID_DEFS_ONLY)
/*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_TV_APP | WINAPI_PARTITION_TV_TITLE) */
/*#pragma endregion*/
//---------------------------------<-EOF->----------------------------------//

754
gfx/include/dxsdk/xdsp.h Normal file
View File

@ -0,0 +1,754 @@
/*-========================================================================-_
| - XDSP - |
| Copyright (c) Microsoft Corporation. All rights reserved. |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|PROJECT: XDSP MODEL: Unmanaged User-mode |
|VERSION: 1.2 EXCEPT: No Exceptions |
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|BASE: N / A DIALECT: MSC++ 14.00 |
|>------------------------------------------------------------------------<|
| DUTY: DSP functions with CPU extension specific optimizations |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
NOTES:
1. Definition of terms:
DSP: Digital Signal Processing.
FFT: Fast Fourier Transform.
Frame: A block of samples, one per channel,
to be played simultaneously.
2. All buffer parameters must be 16-byte aligned.
3. All FFT functions support only FLOAT32 audio. */
#pragma once
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
#include <windef.h> // general windows types
#include <math.h> // trigonometric functions
#if defined(_XBOX) // SIMD intrinsics
#include <ppcintrinsics.h>
#else
#include <emmintrin.h>
#endif
//--------------<M-A-C-R-O-S>-----------------------------------------------//
// assertion
#if !defined(DSPASSERT)
#if DBG
#define DSPASSERT(exp) if (!(exp)) { OutputDebugStringA("XDSP ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); }
#else
#define DSPASSERT(exp) __assume(exp)
#endif
#endif
// true if n is a power of 2
#if !defined(ISPOWEROF2)
#define ISPOWEROF2(n) ( ((n)&((n)-1)) == 0 && (n) != 0 )
#endif
//--------------<H-E-L-P-E-R-S>---------------------------------------------//
namespace XDSP {
#pragma warning(push)
#pragma warning(disable: 4328 4640) // disable "indirection alignment of formal parameter", "construction of local static object is not thread-safe" compile warnings
// Helper functions, used by the FFT functions.
// The application need not call them directly.
// primitive types
typedef __m128 XVECTOR;
typedef XVECTOR& XVECTORREF;
typedef const XVECTOR& XVECTORREFC;
// Parallel multiplication of four complex numbers, assuming
// real and imaginary values are stored in separate vectors.
__forceinline void vmulComplex (__out XVECTORREF rResult, __out XVECTORREF iResult, __in XVECTORREFC r1, __in XVECTORREFC i1, __in XVECTORREFC r2, __in XVECTORREFC i2)
{
// (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
XVECTOR vi1i2 = _mm_mul_ps(i1, i2);
XVECTOR vr1r2 = _mm_mul_ps(r1, r2);
XVECTOR vr1i2 = _mm_mul_ps(r1, i2);
XVECTOR vr2i1 = _mm_mul_ps(r2, i1);
rResult = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2)
iResult = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1)
}
__forceinline void vmulComplex (__inout XVECTORREF r1, __inout XVECTORREF i1, __in XVECTORREFC r2, __in XVECTORREFC i2)
{
// (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
XVECTOR vi1i2 = _mm_mul_ps(i1, i2);
XVECTOR vr1r2 = _mm_mul_ps(r1, r2);
XVECTOR vr1i2 = _mm_mul_ps(r1, i2);
XVECTOR vr2i1 = _mm_mul_ps(r2, i1);
r1 = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2)
i1 = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1)
}
// Radix-4 decimation-in-time FFT butterfly.
// This version assumes that all four elements of the butterfly are
// adjacent in a single vector.
//
// Compute the product of the complex input vector and the
// 4-element DFT matrix:
// | 1 1 1 1 | | (r1X,i1X) |
// | 1 -j -1 j | | (r1Y,i1Y) |
// | 1 -1 1 -1 | | (r1Z,i1Z) |
// | 1 j -1 -j | | (r1W,i1W) |
//
// This matrix can be decomposed into two simpler ones to reduce the
// number of additions needed. The decomposed matrices look like this:
// | 1 0 1 0 | | 1 0 1 0 |
// | 0 1 0 -j | | 1 0 -1 0 |
// | 1 0 -1 0 | | 0 1 0 1 |
// | 0 1 0 j | | 0 1 0 -1 |
//
// Combine as follows:
// | 1 0 1 0 | | (r1X,i1X) | | (r1X + r1Z, i1X + i1Z) |
// Temp = | 1 0 -1 0 | * | (r1Y,i1Y) | = | (r1X - r1Z, i1X - i1Z) |
// | 0 1 0 1 | | (r1Z,i1Z) | | (r1Y + r1W, i1Y + i1W) |
// | 0 1 0 -1 | | (r1W,i1W) | | (r1Y - r1W, i1Y - i1W) |
//
// | 1 0 1 0 | | (rTempX,iTempX) | | (rTempX + rTempZ, iTempX + iTempZ) |
// Result = | 0 1 0 -j | * | (rTempY,iTempY) | = | (rTempY + iTempW, iTempY - rTempW) |
// | 1 0 -1 0 | | (rTempZ,iTempZ) | | (rTempX - rTempZ, iTempX - iTempZ) |
// | 0 1 0 j | | (rTempW,iTempW) | | (rTempY - iTempW, iTempY + rTempW) |
__forceinline void ButterflyDIT4_1 (__inout XVECTORREF r1, __inout XVECTORREF i1)
{
// sign constants for radix-4 butterflies
const static XVECTOR vDFT4SignBits1 = { 0.0f, -0.0f, 0.0f, -0.0f };
const static XVECTOR vDFT4SignBits2 = { 0.0f, 0.0f, -0.0f, -0.0f };
const static XVECTOR vDFT4SignBits3 = { 0.0f, -0.0f, -0.0f, 0.0f };
// calculating Temp
XVECTOR rTemp = _mm_add_ps( _mm_shuffle_ps(r1, r1, _MM_SHUFFLE(1, 1, 0, 0)), // [r1X| r1X|r1Y| r1Y] +
_mm_xor_ps(_mm_shuffle_ps(r1, r1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [r1Z|-r1Z|r1W|-r1W]
XVECTOR iTemp = _mm_add_ps( _mm_shuffle_ps(i1, i1, _MM_SHUFFLE(1, 1, 0, 0)), // [i1X| i1X|i1Y| i1Y] +
_mm_xor_ps(_mm_shuffle_ps(i1, i1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [i1Z|-i1Z|i1W|-i1W]
// calculating Result
XVECTOR rZrWiZiW = _mm_shuffle_ps(rTemp, iTemp, _MM_SHUFFLE(3, 2, 3, 2)); // [rTempZ|rTempW|iTempZ|iTempW]
XVECTOR rZiWrZiW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(3, 0, 3, 0)); // [rTempZ|iTempW|rTempZ|iTempW]
XVECTOR iZrWiZrW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(1, 2, 1, 2)); // [rTempZ|iTempW|rTempZ|iTempW]
r1 = _mm_add_ps( _mm_shuffle_ps(rTemp, rTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [rTempX| rTempY| rTempX| rTempY] +
_mm_xor_ps(rZiWrZiW, vDFT4SignBits2) ); // [rTempZ| iTempW|-rTempZ|-iTempW]
i1 = _mm_add_ps( _mm_shuffle_ps(iTemp, iTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [iTempX| iTempY| iTempX| iTempY] +
_mm_xor_ps(iZrWiZrW, vDFT4SignBits3) ); // [iTempZ|-rTempW|-iTempZ| rTempW]
}
// Radix-4 decimation-in-time FFT butterfly.
// This version assumes that elements of the butterfly are
// in different vectors, so that each vector in the input
// contains elements from four different butterflies.
// The four separate butterflies are processed in parallel.
//
// The calculations here are the same as the ones in the single-vector
// radix-4 DFT, but instead of being done on a single vector (X,Y,Z,W)
// they are done in parallel on sixteen independent complex values.
// There is no interdependence between the vector elements:
// | 1 0 1 0 | | (rIn0,iIn0) | | (rIn0 + rIn2, iIn0 + iIn2) |
// | 1 0 -1 0 | * | (rIn1,iIn1) | = Temp = | (rIn0 - rIn2, iIn0 - iIn2) |
// | 0 1 0 1 | | (rIn2,iIn2) | | (rIn1 + rIn3, iIn1 + iIn3) |
// | 0 1 0 -1 | | (rIn3,iIn3) | | (rIn1 - rIn3, iIn1 - iIn3) |
//
// | 1 0 1 0 | | (rTemp0,iTemp0) | | (rTemp0 + rTemp2, iTemp0 + iTemp2) |
// Result = | 0 1 0 -j | * | (rTemp1,iTemp1) | = | (rTemp1 + iTemp3, iTemp1 - rTemp3) |
// | 1 0 -1 0 | | (rTemp2,iTemp2) | | (rTemp0 - rTemp2, iTemp0 - iTemp2) |
// | 0 1 0 j | | (rTemp3,iTemp3) | | (rTemp1 - iTemp3, iTemp1 + rTemp3) |
__forceinline void ButterflyDIT4_4 (__inout XVECTORREF r0,
__inout XVECTORREF r1,
__inout XVECTORREF r2,
__inout XVECTORREF r3,
__inout XVECTORREF i0,
__inout XVECTORREF i1,
__inout XVECTORREF i2,
__inout XVECTORREF i3,
__in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableReal,
__in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableImaginary,
const UINT32 uStride, const BOOL fLast)
{
DSPASSERT(pUnityTableReal != NULL);
DSPASSERT(pUnityTableImaginary != NULL);
DSPASSERT((UINT_PTR)pUnityTableReal % 16 == 0);
DSPASSERT((UINT_PTR)pUnityTableImaginary % 16 == 0);
DSPASSERT(ISPOWEROF2(uStride));
XVECTOR rTemp0, rTemp1, rTemp2, rTemp3, rTemp4, rTemp5, rTemp6, rTemp7;
XVECTOR iTemp0, iTemp1, iTemp2, iTemp3, iTemp4, iTemp5, iTemp6, iTemp7;
// calculating Temp
rTemp0 = _mm_add_ps(r0, r2); iTemp0 = _mm_add_ps(i0, i2);
rTemp2 = _mm_add_ps(r1, r3); iTemp2 = _mm_add_ps(i1, i3);
rTemp1 = _mm_sub_ps(r0, r2); iTemp1 = _mm_sub_ps(i0, i2);
rTemp3 = _mm_sub_ps(r1, r3); iTemp3 = _mm_sub_ps(i1, i3);
rTemp4 = _mm_add_ps(rTemp0, rTemp2); iTemp4 = _mm_add_ps(iTemp0, iTemp2);
rTemp5 = _mm_add_ps(rTemp1, iTemp3); iTemp5 = _mm_sub_ps(iTemp1, rTemp3);
rTemp6 = _mm_sub_ps(rTemp0, rTemp2); iTemp6 = _mm_sub_ps(iTemp0, iTemp2);
rTemp7 = _mm_sub_ps(rTemp1, iTemp3); iTemp7 = _mm_add_ps(iTemp1, rTemp3);
// calculating Result
// vmulComplex(rTemp0, iTemp0, rTemp0, iTemp0, pUnityTableReal[0], pUnityTableImaginary[0]); // first one is always trivial
vmulComplex(rTemp5, iTemp5, pUnityTableReal[uStride], pUnityTableImaginary[uStride]);
vmulComplex(rTemp6, iTemp6, pUnityTableReal[uStride*2], pUnityTableImaginary[uStride*2]);
vmulComplex(rTemp7, iTemp7, pUnityTableReal[uStride*3], pUnityTableImaginary[uStride*3]);
if (fLast) {
ButterflyDIT4_1(rTemp4, iTemp4);
ButterflyDIT4_1(rTemp5, iTemp5);
ButterflyDIT4_1(rTemp6, iTemp6);
ButterflyDIT4_1(rTemp7, iTemp7);
}
r0 = rTemp4; i0 = iTemp4;
r1 = rTemp5; i1 = iTemp5;
r2 = rTemp6; i2 = iTemp6;
r3 = rTemp7; i3 = iTemp7;
}
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
////
// DESCRIPTION:
// 4-sample FFT.
//
// PARAMETERS:
// pReal - [inout] real components, must have at least uCount elements
// pImaginary - [inout] imaginary components, must have at least uCount elements
// uCount - [in] number of FFT iterations
//
// RETURN VALUE:
// void
////
__forceinline void FFT4 (__inout_ecount(uCount) XVECTOR* __restrict pReal, __inout_ecount(uCount) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
{
DSPASSERT(pReal != NULL);
DSPASSERT(pImaginary != NULL);
DSPASSERT((UINT_PTR)pReal % 16 == 0);
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
DSPASSERT(ISPOWEROF2(uCount));
for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
ButterflyDIT4_1(pReal[uIndex], pImaginary[uIndex]);
}
}
////
// DESCRIPTION:
// 8-sample FFT.
//
// PARAMETERS:
// pReal - [inout] real components, must have at least uCount*2 elements
// pImaginary - [inout] imaginary components, must have at least uCount*2 elements
// uCount - [in] number of FFT iterations
//
// RETURN VALUE:
// void
////
__forceinline void FFT8 (__inout_ecount(uCount*2) XVECTOR* __restrict pReal, __inout_ecount(uCount*2) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
{
DSPASSERT(pReal != NULL);
DSPASSERT(pImaginary != NULL);
DSPASSERT((UINT_PTR)pReal % 16 == 0);
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
DSPASSERT(ISPOWEROF2(uCount));
static XVECTOR wr1 = { 1.0f, 0.70710677f, 0.0f, -0.70710677f };
static XVECTOR wi1 = { 0.0f, -0.70710677f, -1.0f, -0.70710677f };
static XVECTOR wr2 = { -1.0f, -0.70710677f, 0.0f, 0.70710677f };
static XVECTOR wi2 = { 0.0f, 0.70710677f, 1.0f, 0.70710677f };
for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
XVECTOR* __restrict pR = pReal + uIndex*2;
XVECTOR* __restrict pI = pImaginary + uIndex*2;
XVECTOR oddsR = _mm_shuffle_ps(pR[0], pR[1], _MM_SHUFFLE(3, 1, 3, 1));
XVECTOR evensR = _mm_shuffle_ps(pR[0], pR[1], _MM_SHUFFLE(2, 0, 2, 0));
XVECTOR oddsI = _mm_shuffle_ps(pI[0], pI[1], _MM_SHUFFLE(3, 1, 3, 1));
XVECTOR evensI = _mm_shuffle_ps(pI[0], pI[1], _MM_SHUFFLE(2, 0, 2, 0));
ButterflyDIT4_1(oddsR, oddsI);
ButterflyDIT4_1(evensR, evensI);
XVECTOR r, i;
vmulComplex(r, i, oddsR, oddsI, wr1, wi1);
pR[0] = _mm_add_ps(evensR, r);
pI[0] = _mm_add_ps(evensI, i);
vmulComplex(r, i, oddsR, oddsI, wr2, wi2);
pR[1] = _mm_add_ps(evensR, r);
pI[1] = _mm_add_ps(evensI, i);
}
}
////
// DESCRIPTION:
// 16-sample FFT.
//
// PARAMETERS:
// pReal - [inout] real components, must have at least uCount*4 elements
// pImaginary - [inout] imaginary components, must have at least uCount*4 elements
// uCount - [in] number of FFT iterations
//
// RETURN VALUE:
// void
////
__forceinline void FFT16 (__inout_ecount(uCount*4) XVECTOR* __restrict pReal, __inout_ecount(uCount*4) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
{
DSPASSERT(pReal != NULL);
DSPASSERT(pImaginary != NULL);
DSPASSERT((UINT_PTR)pReal % 16 == 0);
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
DSPASSERT(ISPOWEROF2(uCount));
XVECTOR aUnityTableReal[4] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.92387950f, 0.70710677f, 0.38268343f, 1.0f, 0.70710677f, -4.3711388e-008f, -0.70710677f, 1.0f, 0.38268343f, -0.70710677f, -0.92387950f };
XVECTOR aUnityTableImaginary[4] = { -0.0f, -0.0f, -0.0f, -0.0f, -0.0f, -0.38268343f, -0.70710677f, -0.92387950f, -0.0f, -0.70710677f, -1.0f, -0.70710677f, -0.0f, -0.92387950f, -0.70710677f, 0.38268343f };
for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
ButterflyDIT4_4(pReal[uIndex*4],
pReal[uIndex*4 + 1],
pReal[uIndex*4 + 2],
pReal[uIndex*4 + 3],
pImaginary[uIndex*4],
pImaginary[uIndex*4 + 1],
pImaginary[uIndex*4 + 2],
pImaginary[uIndex*4 + 3],
aUnityTableReal,
aUnityTableImaginary,
1, TRUE);
}
}
////
// DESCRIPTION:
// 2^N-sample FFT.
//
// REMARKS:
// For FFTs length 16 and below, call FFT16(), FFT8(), or FFT4().
//
// PARAMETERS:
// pReal - [inout] real components, must have at least (uLength*uCount)/4 elements
// pImaginary - [inout] imaginary components, must have at least (uLength*uCount)/4 elements
// pUnityTable - [in] unity table, must have at least uLength*uCount elements, see FFTInitializeUnityTable()
// uLength - [in] FFT length in samples, must be a power of 2 > 16
// uCount - [in] number of FFT iterations
//
// RETURN VALUE:
// void
////
inline void FFT (__inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pReal, __inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(uLength*uCount) const XVECTOR* __restrict pUnityTable, const UINT32 uLength, const UINT32 uCount=1)
{
DSPASSERT(pReal != NULL);
DSPASSERT(pImaginary != NULL);
DSPASSERT(pUnityTable != NULL);
DSPASSERT((UINT_PTR)pReal % 16 == 0);
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
DSPASSERT(uLength > 16);
DSPASSERT(ISPOWEROF2(uLength));
DSPASSERT(ISPOWEROF2(uCount));
const XVECTOR* __restrict pUnityTableReal = pUnityTable;
const XVECTOR* __restrict pUnityTableImaginary = pUnityTable + (uLength>>2);
const UINT32 uTotal = uCount * uLength;
const UINT32 uTotal_vectors = uTotal >> 2;
const UINT32 uStage_vectors = uLength >> 2;
const UINT32 uStage_vectors_mask = uStage_vectors - 1;
const UINT32 uStride = uLength >> 4; // stride between butterfly elements
const UINT32 uStrideMask = uStride - 1;
const UINT32 uStride2 = uStride * 2;
const UINT32 uStride3 = uStride * 3;
const UINT32 uStrideInvMask = ~uStrideMask;
for (UINT32 uIndex=0; uIndex<(uTotal_vectors>>2); ++uIndex) {
const UINT32 n = ((uIndex & uStrideInvMask) << 2) + (uIndex & uStrideMask);
ButterflyDIT4_4(pReal[n],
pReal[n + uStride],
pReal[n + uStride2],
pReal[n + uStride3],
pImaginary[n ],
pImaginary[n + uStride],
pImaginary[n + uStride2],
pImaginary[n + uStride3],
pUnityTableReal + (n & uStage_vectors_mask),
pUnityTableImaginary + (n & uStage_vectors_mask),
uStride, FALSE);
}
if (uLength > 16*4) {
FFT(pReal, pImaginary, pUnityTable+(uLength>>1), uLength>>2, uCount*4);
} else if (uLength == 16*4) {
FFT16(pReal, pImaginary, uCount*4);
} else if (uLength == 8*4) {
FFT8(pReal, pImaginary, uCount*4);
} else if (uLength == 4*4) {
FFT4(pReal, pImaginary, uCount*4);
}
}
//--------------------------------------------------------------------------//
////
// DESCRIPTION:
// Initializes unity roots lookup table used by FFT functions.
// Once initialized, the table need not be initialized again unless a
// different FFT length is desired.
//
// REMARKS:
// The unity tables of FFT length 16 and below are hard coded into the
// respective FFT functions and so need not be initialized.
//
// PARAMETERS:
// pUnityTable - [out] unity table, receives unity roots lookup table, must have at least uLength elements
// uLength - [in] FFT length in frames, must be a power of 2 > 16
//
// RETURN VALUE:
// void
////
inline void FFTInitializeUnityTable (__out_ecount(uLength) XVECTOR* __restrict pUnityTable, UINT32 uLength)
{
DSPASSERT(pUnityTable != NULL);
DSPASSERT(uLength > 16);
DSPASSERT(ISPOWEROF2(uLength));
FLOAT32* __restrict pfUnityTable = (FLOAT32* __restrict)pUnityTable;
// initialize unity table for recursive FFT lengths: uLength, uLength/4, uLength/16... > 16
do {
FLOAT32 flStep = 6.283185307f / uLength; // 2PI / FFT length
uLength >>= 2;
// pUnityTable[0 to uLength*4-1] contains real components for current FFT length
// pUnityTable[uLength*4 to uLength*8-1] contains imaginary components for current FFT length
for (UINT32 i=0; i<4; ++i) {
for (UINT32 j=0; j<uLength; ++j) {
UINT32 uIndex = (i*uLength) + j;
pfUnityTable[uIndex] = cosf(FLOAT32(i)*FLOAT32(j)*flStep); // real component
pfUnityTable[uIndex + uLength*4] = -sinf(FLOAT32(i)*FLOAT32(j)*flStep); // imaginary component
}
}
pfUnityTable += uLength*8;
} while (uLength > 16);
}
////
// DESCRIPTION:
// The FFT functions generate output in bit reversed order.
// Use this function to re-arrange them into order of increasing frequency.
//
// REMARKS:
//
// PARAMETERS:
// pOutput - [out] output buffer, receives samples in order of increasing frequency, cannot overlap pInput, must have at least (1<<uLog2Length)/4 elements
// pInput - [in] input buffer, samples in bit reversed order as generated by FFT functions, cannot overlap pOutput, must have at least (1<<uLog2Length)/4 elements
// uLog2Length - [in] LOG (base 2) of FFT length in samples, must be >= 2
//
// RETURN VALUE:
// void
////
inline void FFTUnswizzle (__out_ecount((1<<uLog2Length)/4) XVECTOR* __restrict pOutput, __in_ecount((1<<uLog2Length)/4) const XVECTOR* __restrict pInput, const UINT32 uLog2Length)
{
DSPASSERT(pOutput != NULL);
DSPASSERT(pInput != NULL);
DSPASSERT(uLog2Length >= 2);
FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
const UINT32 uLength = UINT32(1 << uLog2Length);
if ((uLog2Length & 0x1) == 0) {
// even powers of two
for (UINT32 uIndex=0; uIndex<uLength; ++uIndex) {
UINT32 n = uIndex;
n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 );
n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 );
n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 );
n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 );
n >>= (32 - uLog2Length);
pfOutput[n] = pfInput[uIndex];
}
} else {
// odd powers of two
for (UINT32 uIndex=0; uIndex<uLength; ++uIndex) {
UINT32 n = (uIndex>>3);
n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 );
n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 );
n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 );
n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 );
n >>= (32 - (uLog2Length-3));
n |= ((uIndex & 0x7) << (uLog2Length - 3));
pfOutput[n] = pfInput[uIndex];
}
}
}
////
// DESCRIPTION:
// Convert complex components to polar form.
//
// PARAMETERS:
// pOutput - [out] output buffer, receives samples in polar form, must have at least uLength/4 elements
// pInputReal - [in] input buffer (real components), must have at least uLength/4 elements
// pInputImaginary - [in] input buffer (imaginary components), must have at least uLength/4 elements
// uLength - [in] FFT length in samples, must be a power of 2 >= 4
//
// RETURN VALUE:
// void
////
inline void FFTPolar (__out_ecount(uLength/4) XVECTOR* __restrict pOutput, __in_ecount(uLength/4) const XVECTOR* __restrict pInputReal, __in_ecount(uLength/4) const XVECTOR* __restrict pInputImaginary, const UINT32 uLength)
{
DSPASSERT(pOutput != NULL);
DSPASSERT(pInputReal != NULL);
DSPASSERT(pInputImaginary != NULL);
DSPASSERT(uLength >= 4);
DSPASSERT(ISPOWEROF2(uLength));
FLOAT32 flOneOverLength = 1.0f / uLength;
// result = sqrtf((real/uLength)^2 + (imaginary/uLength)^2) * 2
XVECTOR vOneOverLength = _mm_set_ps1(flOneOverLength);
for (UINT32 uIndex=0; uIndex<(uLength>>2); ++uIndex) {
XVECTOR vReal = _mm_mul_ps(pInputReal[uIndex], vOneOverLength);
XVECTOR vImaginary = _mm_mul_ps(pInputImaginary[uIndex], vOneOverLength);
XVECTOR vRR = _mm_mul_ps(vReal, vReal);
XVECTOR vII = _mm_mul_ps(vImaginary, vImaginary);
XVECTOR vRRplusII = _mm_add_ps(vRR, vII);
XVECTOR vTotal = _mm_sqrt_ps(vRRplusII);
pOutput[uIndex] = _mm_add_ps(vTotal, vTotal);
}
}
//--------------------------------------------------------------------------//
////
// DESCRIPTION:
// Deinterleaves audio samples such that all samples corresponding to
//
// REMARKS:
// For example, audio of the form [LRLRLR] becomes [LLLRRR].
//
// PARAMETERS:
// pOutput - [out] output buffer, receives samples in deinterleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements
// pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements
// uChannelCount - [in] number of channels, must be > 1
// uFrameCount - [in] number of frames of valid data, must be > 0
//
// RETURN VALUE:
// void
////
inline void Deinterleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount)
{
DSPASSERT(pOutput != NULL);
DSPASSERT(pInput != NULL);
DSPASSERT(uChannelCount > 1);
DSPASSERT(uFrameCount > 0);
FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
for (UINT32 uFrame=0; uFrame<uFrameCount; ++uFrame) {
pfOutput[uChannel * uFrameCount + uFrame] = pfInput[uFrame * uChannelCount + uChannel];
}
}
}
////
// DESCRIPTION:
// Interleaves audio samples such that all samples corresponding to
//
// REMARKS:
// For example, audio of the form [LLLRRR] becomes [LRLRLR].
//
// PARAMETERS:
// pOutput - [out] output buffer, receives samples in interleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements
// pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements
// uChannelCount - [in] number of channels, must be > 1
// uFrameCount - [in] number of frames of valid data, must be > 0
//
// RETURN VALUE:
// void
////
inline void Interleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount)
{
DSPASSERT(pOutput != NULL);
DSPASSERT(pInput != NULL);
DSPASSERT(uChannelCount > 1);
DSPASSERT(uFrameCount > 0);
FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
for (UINT32 uFrame=0; uFrame<uFrameCount; ++uFrame) {
pfOutput[uFrame * uChannelCount + uChannel] = pfInput[uChannel * uFrameCount + uFrame];
}
}
}
//--------------------------------------------------------------------------//
////
// DESCRIPTION:
// This function applies a 2^N-sample FFT and unswizzles the result such
// that the samples are in order of increasing frequency.
// Audio is first deinterleaved if multichannel.
//
// PARAMETERS:
// pReal - [inout] real components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
// pImaginary - [out] imaginary components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
// pUnityTable - [in] unity table, must have at least (1<<uLog2Length) elements, see FFTInitializeUnityTable()
// uChannelCount - [in] number of channels, must be within [1, 6]
// uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 9]
//
// RETURN VALUE:
// void
////
inline void FFTInterleaved (__inout_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pReal, __out_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(1<<uLog2Length) const XVECTOR* __restrict pUnityTable, const UINT32 uChannelCount, const UINT32 uLog2Length)
{
DSPASSERT(pReal != NULL);
DSPASSERT(pImaginary != NULL);
DSPASSERT(pUnityTable != NULL);
DSPASSERT((UINT_PTR)pReal % 16 == 0);
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
DSPASSERT(uChannelCount > 0 && uChannelCount <= 6);
DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9);
XVECTOR vRealTemp[768];
XVECTOR vImaginaryTemp[768];
const UINT32 uLength = UINT32(1 << uLog2Length);
if (uChannelCount > 1) {
Deinterleave(vRealTemp, pReal, uChannelCount, uLength);
} else {
CopyMemory(vRealTemp, pReal, (uLength>>2)*sizeof(XVECTOR));
}
for (UINT32 u=0; u<uChannelCount*(uLength>>2); u++) {
vImaginaryTemp[u] = _mm_setzero_ps();
}
if (uLength > 16) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength);
}
} else if (uLength == 16) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT16(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
}
} else if (uLength == 8) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT8(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
}
} else if (uLength == 4) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT4(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
}
}
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFTUnswizzle(&pReal[uChannel*(uLength>>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length);
FFTUnswizzle(&pImaginary[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], uLog2Length);
}
}
////
// DESCRIPTION:
// This function applies a 2^N-sample inverse FFT.
// Audio is interleaved if multichannel.
//
// PARAMETERS:
// pReal - [inout] real components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
// pImaginary - [out] imaginary components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
// pUnityTable - [in] unity table, must have at least (1<<uLog2Length) elements, see FFTInitializeUnityTable()
// uChannelCount - [in] number of channels, must be > 0
// uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 10]
//
// RETURN VALUE:
// void
////
inline void IFFTDeinterleaved (__inout_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pReal, __out_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(1<<uLog2Length) const XVECTOR* __restrict pUnityTable, const UINT32 uChannelCount, const UINT32 uLog2Length)
{
DSPASSERT(pReal != NULL);
DSPASSERT(pImaginary != NULL);
DSPASSERT(pUnityTable != NULL);
DSPASSERT((UINT_PTR)pReal % 16 == 0);
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
DSPASSERT(uChannelCount > 0 && uChannelCount <= 6);
DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9);
XVECTOR vRealTemp[768];
XVECTOR vImaginaryTemp[768];
const UINT32 uLength = UINT32(1 << uLog2Length);
const XVECTOR vRnp = _mm_set_ps1(1.0f/uLength);
const XVECTOR vRnm = _mm_set_ps1(-1.0f/uLength);
for (UINT32 u=0; u<uChannelCount*(uLength>>2); u++) {
vRealTemp[u] = _mm_mul_ps(pReal[u], vRnp);
vImaginaryTemp[u] = _mm_mul_ps(pImaginary[u], vRnm);
}
if (uLength > 16) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength);
}
} else if (uLength == 16) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT16(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
}
} else if (uLength == 8) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT8(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
}
} else if (uLength == 4) {
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFT4(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
}
}
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
FFTUnswizzle(&vImaginaryTemp[uChannel*(uLength>>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length);
}
if (uChannelCount > 1) {
Interleave(pReal, vImaginaryTemp, uChannelCount, uLength);
} else {
CopyMemory(pReal, vImaginaryTemp, (uLength>>2)*sizeof(XVECTOR));
}
}
#pragma warning(pop)
}; // namespace XDSP
//---------------------------------<-EOF->----------------------------------//

View File

@ -0,0 +1,718 @@
/***************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: xma2defs.h
* Content: Constants, data types and functions for XMA2 compressed audio.
*
***************************************************************************/
#ifndef __XMA2DEFS_INCLUDED__
#define __XMA2DEFS_INCLUDED__
#include <sal.h> // Markers for documenting API semantics
#include <winerror.h> // For S_OK, E_FAIL
#include <audiodefs.h> // Basic data types and constants for audio work
/***************************************************************************
* Overview
***************************************************************************/
// A typical XMA2 file contains these RIFF chunks:
//
// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure
// and characteristics (length, channels, sample rate, loops, block size, etc).
//
// 'seek' chunk: A seek table to help navigate the XMA data.
//
// 'data' chunk: The encoded XMA2 data.
//
// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS,
// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames
// in a file may also be divided into several subsets, called STREAMS.
//
// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono
// or stereo PCM samples. This is the smallest unit of XMA data that can
// be decoded in isolation. Frames are an arbitrary number of bits in
// length, and need not be byte-aligned. See "XMA frame structure" below.
//
// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo
// samples. The XMA decoder cannot decode a subframe in isolation; it needs
// a whole frame to work with. However, it can begin emitting the frame's
// decoded samples at any one of the four subframe boundaries. Subframes
// can be addressed for seeking and looping purposes.
//
// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames
// can (and usually do) span packets. A packet's header includes the offset
// in bits of the first frame that begins within that packet. All of the
// frames that begin in a given packet belong to the same "stream" (see the
// Multichannel Audio section below).
//
// STREAM: A set of packets within an XMA file that all contain data for the
// same mono or stereo component of a PCM file with more than two channels.
// The packets comprising a given stream may be interleaved with each other
// more or less arbitrarily; see Multichannel Audio.
//
// BLOCK: An array of XMA packets; or, to break it down differently, a series of
// consecutive XMA frames, padded at the end with reserved data. A block
// must contain at least one 2Kb packet per stream, and it can hold up to
// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range.
// (The size chosen involves a trade-off between memory use and efficiency
// of reading from permanent storage.)
//
// XMA frames do not span blocks, so a block is guaranteed to begin with a
// set of complete frames, one per stream. Also, a block in a multi-stream
// XMA2 file always contains the same number of samples for each stream;
// see Multichannel Audio.
//
// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA
// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes)
// except for the last one, which may be shorter.
// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either
// mono or stereo PCM data. In order to encode a 6-channel file (say), the file
// must be deinterleaved into 3 stereo streams that are encoded independently,
// producing 3 encoded XMA data streams. Then the packets in these 3 streams
// are interleaved to produce a single XMA2 file, and some information is added
// to the file so that the original 6-channel audio can be reconstructed at
// decode time. This works using the concept of an XMA stream (see above).
//
// The frames for all the streams in an XMA file are interleaved in an arbitrary
// order. To locate a frame that belongs to a given stream in a given XMA block,
// you must examine the first few packets in the block. Here (and only here) the
// packets are guaranteed to be presented in stream order, so that all frames
// beginning in packet 0 belong to stream 0 (the first stereo pair), etc.
//
// (This means that when decoding multi-stream XMA files, only entire XMA blocks
// should be submitted to the decoder; otherwise it cannot know which frames
// belong to which stream.)
//
// Once you have one frame that belongs to a given stream, you can find the next
// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in
// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function
// uses this technique.
// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and
// subframe in an XMA2 file which will contain sample S when decoded.
//
// 1. Traverse the seek table to find the XMA2 block containing sample S. The
// seek table is an array of big-endian DWORDs, one per block in the file.
// The Nth DWORD is the total number of PCM samples that would be obtained
// by decoding the entire XMA file up to the end of block N. Hence, the
// block we want is the first one whose seek table entry is greater than S.
// (See the GetXmaBlockContainingSample helper function.)
//
// 2. Calculate which frame F within the block found above contains sample S.
// Since each frame decodes to 512 samples, this is straightforward. The
// first frame in the block produces samples X to X + 512, where X is the
// seek table entry for the prior block. So F is (S - X) / 512.
//
// 3. Find the bit offset within the block where frame F starts. Since frames
// are variable-sized, this can only be done by traversing all the frames in
// the block until we reach frame F. (See GetXmaFrameBitPosition.)
//
// 4. Frame F has four 128-sample subframes. To find the subframe containing S,
// we can use the formula (S % 512) / 128.
//
// In the case of multi-stream XMA files, sample S is a multichannel sample with
// parts coming from several frames, one per stream. To find all these frames,
// steps 2-4 need to be repeated for each stream N, using the knowledge that the
// first packets in a block are presented in stream order. The frame traversal
// in step 3 must be started at the first frame in the Nth packet of the block,
// which will be the first frame for stream N. (And the packet header will tell
// you the first frame's start position within the packet.)
//
// Step 1 can be performed using the GetXmaBlockContainingSample function below,
// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream.
/***************************************************************************
* XMA constants
***************************************************************************/
// Size of the PCM samples produced by the XMA decoder
#define XMA_OUTPUT_SAMPLE_BYTES 2u
#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u)
// Size of an XMA packet
#define XMA_BYTES_PER_PACKET 2048u
#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u)
// Size of an XMA packet header
#define XMA_PACKET_HEADER_BYTES 4u
#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u)
// Sample blocks in a decoded XMA frame
#define XMA_SAMPLES_PER_FRAME 512u
// Sample blocks in a decoded XMA subframe
#define XMA_SAMPLES_PER_SUBFRAME 128u
// Maximum encoded data that can be submitted to the XMA decoder at a time
#define XMA_READBUFFER_MAX_PACKETS 4095u
#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET)
// Maximum size allowed for the XMA decoder's output buffers
#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u)
// Required byte alignment of the XMA decoder's output buffers
#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u
// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field
#define XMA_MIN_SUBFRAMES_TO_DECODE 1u
#define XMA_MAX_SUBFRAMES_TO_DECODE 8u
#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u
// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping
#define XMA_MAX_LOOPCOUNT 254u
#define XMA_INFINITE_LOOP 255u
/***************************************************************************
* XMA format structures
***************************************************************************/
// The currently recommended way to express format information for XMA2 files
// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with
// the WAVEFORMATEX standard and contains all the information needed to parse
// and manage XMA2 files in a compact way.
#define WAVE_FORMAT_XMA2 0x166
typedef struct XMA2WAVEFORMATEX
{
WAVEFORMATEX wfx;
// Meaning of the WAVEFORMATEX fields here:
// wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2
// nChannels; // Channel count of the decoded audio
// nSamplesPerSec; // Sample rate of the decoded audio
// nAvgBytesPerSec; // Used internally by the XMA encoder
// nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8
// wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA
// cbSize; // Size in bytes of the rest of this structure (34)
WORD NumStreams; // Number of audio streams (1 or 2 channels each)
DWORD ChannelMask; // Spatial positions of the channels in this file,
// stored as SPEAKER_xxx values (see audiodefs.h)
DWORD SamplesEncoded; // Total number of PCM samples the file decodes to
DWORD BytesPerBlock; // XMA block size (but the last one may be shorter)
DWORD PlayBegin; // First valid sample in the decoded audio
DWORD PlayLength; // Length of the valid part of the decoded audio
DWORD LoopBegin; // Beginning of the loop region in decoded sample terms
DWORD LoopLength; // Length of the loop region in decoded sample terms
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
BYTE EncoderVersion; // Version of XMA encoder that generated the file
WORD BlockCount; // XMA blocks in file (and entries in its seek table)
} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX;
// The legacy XMA format structures are described here for reference, but they
// should not be used in new content. XMAWAVEFORMAT was the structure used in
// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not
// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk.
#ifndef WAVE_FORMAT_XMA
#define WAVE_FORMAT_XMA 0x0165
// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx
// values defined in audiodefs.h, but modified to fit in a single byte.
#ifndef XMA_SPEAKER_LEFT
#define XMA_SPEAKER_LEFT 0x01
#define XMA_SPEAKER_RIGHT 0x02
#define XMA_SPEAKER_CENTER 0x04
#define XMA_SPEAKER_LFE 0x08
#define XMA_SPEAKER_LEFT_SURROUND 0x10
#define XMA_SPEAKER_RIGHT_SURROUND 0x20
#define XMA_SPEAKER_LEFT_BACK 0x40
#define XMA_SPEAKER_RIGHT_BACK 0x80
#endif
// Used in XMAWAVEFORMAT for per-stream data
typedef struct XMASTREAMFORMAT
{
DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons)
DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files,
// this is the same for all streams in the file).
DWORD LoopStart; // Bit offset of the frame containing the loop start
// point, relative to the beginning of the stream.
DWORD LoopEnd; // Bit offset of the frame containing the loop end.
BYTE SubframeData; // Two 4-bit numbers specifying the exact location of
// the loop points within the frames that contain them.
// SubframeEnd: Subframe of the loop end frame where
// the loop ends. Ranges from 0 to 3.
// SubframeSkip: Subframes to skip in the start frame to
// reach the loop. Ranges from 0 to 4.
BYTE Channels; // Number of channels in the stream (1 or 2)
WORD ChannelMask; // Spatial positions of the channels in the stream
} XMASTREAMFORMAT;
// Legacy XMA1 format structure
typedef struct XMAWAVEFORMAT
{
WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA)
WORD BitsPerSample; // Bit depth (currently required to be 16)
WORD EncodeOptions; // Options for XMA encoder/decoder
WORD LargestSkip; // Largest skip used in interleaving streams
WORD NumStreams; // Number of interleaved audio streams
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
BYTE Version; // XMA encoder version that generated the file.
// Always 3 or higher for XMA2 files.
XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual
// array length is in the NumStreams field.
} XMAWAVEFORMAT;
// Used in XMA2WAVEFORMAT for per-stream data
typedef struct XMA2STREAMFORMAT
{
BYTE Channels; // Number of channels in the stream (1 or 2)
BYTE RESERVED; // Reserved for future use
WORD ChannelMask; // Spatial positions of the channels in the stream
} XMA2STREAMFORMAT;
// Legacy XMA2 format structure (big-endian byte ordering)
typedef struct XMA2WAVEFORMAT
{
BYTE Version; // XMA encoder version that generated the file.
// Always 3 or higher for XMA2 files.
BYTE NumStreams; // Number of interleaved audio streams
BYTE RESERVED; // Reserved for future use
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
DWORD LoopBegin; // Loop begin point, in samples
DWORD LoopEnd; // Loop end point, in samples
DWORD SampleRate; // The file's decoded sample rate
DWORD EncodeOptions; // Options for the XMA encoder/decoder
DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder
DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except
// possibly the last one). Always a multiple of
// 2Kb, since XMA blocks are arrays of 2Kb packets.
DWORD SamplesEncoded; // Total number of PCM samples encoded in this file
DWORD SamplesInSource; // Actual number of PCM samples in the source
// material used to generate this file
DWORD BlockCount; // Number of XMA blocks in this file (and hence
// also the number of entries in its seek table)
XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual
// array length is in the NumStreams field.
} XMA2WAVEFORMAT;
#endif // #ifndef WAVE_FORMAT_XMA
/***************************************************************************
* XMA packet structure (in big-endian form)
***************************************************************************/
typedef struct XMA2PACKET
{
int FrameCount : 6; // Number of XMA frames that begin in this packet
int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins
int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2)
int PacketSkipCount : 8; // How many packets belonging to other streams must be
// skipped to find the next packet belonging to this one
BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data
} XMA2PACKET;
// E.g. if the first DWORD of a packet is 0x30107902:
//
// 001100 000001000001111 001 00000010
// | | | |____ Skip 2 packets to find the next one for this stream
// | | |___________ XMA2 signature (always 001)
// | |_____________________ First frame starts 527 bits into packet
// |________________________________ Packet contains 12 frames
// Helper functions to extract the fields above from an XMA packet. (Note that
// the bitfields cannot be read directly on little-endian architectures such as
// the Intel x86, as they are laid out in big-endian form.)
__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket)
{
return (DWORD)(pPacket[0] >> 2);
}
__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket)
{
return ((DWORD)(pPacket[0] & 0x3) << 13) |
((DWORD)(pPacket[1]) << 5) |
((DWORD)(pPacket[2]) >> 3);
}
__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket)
{
return (DWORD)(pPacket[2] & 0x7);
}
__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket)
{
return (DWORD)(pPacket[3]);
}
/***************************************************************************
* XMA frame structure
***************************************************************************/
// There is no way to represent the XMA frame as a C struct, since it is a
// variable-sized string of bits that need not be stored at a byte-aligned
// position in memory. This is the layout:
//
// XMAFRAME
// {
// LengthInBits: A 15-bit number representing the length of this frame.
// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15).
// }
// Size in bits of the frame's initial LengthInBits field
#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15
// Special LengthInBits value that marks an invalid final frame
#define XMA_FINAL_FRAME_MARKER 0x7FFF
/***************************************************************************
* XMA helper functions
***************************************************************************/
// We define a local ASSERT macro to equal the global one if it exists.
// You can define XMA2DEFS_ASSERT in advance to override this default.
#ifndef XMA2DEFS_ASSERT
#ifdef ASSERT
#define XMA2DEFS_ASSERT ASSERT
#else
#define XMA2DEFS_ASSERT(a) /* No-op by default */
#endif
#endif
// GetXmaBlockContainingSample: Use a given seek table to find the XMA block
// containing a given decoded sample. Note that the seek table entries in an
// XMA file are stored in big-endian form and may need to be converted prior
// to calling this function.
__inline HRESULT GetXmaBlockContainingSample
(
DWORD nBlockCount, // Blocks in the file (= seek table entries)
__in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data
DWORD nDesiredSample, // Decoded sample to locate
__out DWORD* pnBlockContainingSample, // Index of the block containing the sample
__out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block
)
{
DWORD nPreviousTotalSamples = 0;
DWORD nBlock;
DWORD nTotalSamplesSoFar;
XMA2DEFS_ASSERT(pSeekTable);
XMA2DEFS_ASSERT(pnBlockContainingSample);
XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock);
for (nBlock = 0; nBlock < nBlockCount; ++nBlock)
{
nTotalSamplesSoFar = pSeekTable[nBlock];
if (nTotalSamplesSoFar > nDesiredSample)
{
*pnBlockContainingSample = nBlock;
*pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples;
return S_OK;
}
nPreviousTotalSamples = nTotalSamplesSoFar;
}
return E_FAIL;
}
// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field.
__inline DWORD GetXmaFrameLengthInBits
(
__in_bcount(nBitPosition / 8 + 3)
__in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame
DWORD nBitPosition // Bit offset of the frame within this packet
)
{
DWORD nRegion;
DWORD nBytePosition = nBitPosition / 8;
DWORD nBitOffset = nBitPosition % 8;
if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more)
{
nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 |
(DWORD)(pPacket[nBytePosition+1]);
return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits
}
else // Need to read 3 bytes
{
nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 |
(DWORD)(pPacket[nBytePosition+1]) << 8 |
(DWORD)(pPacket[nBytePosition+2]);
return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits
}
}
// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within
// an XMA block or set of blocks. Returns 0 on failure.
__inline DWORD GetXmaFrameBitPosition
(
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
DWORD nXmaDataBytes, // Size of pXmaData in bytes
DWORD nStreamIndex, // Stream within which to seek
DWORD nDesiredFrame // Frame sought
)
{
const BYTE* pCurrentPacket;
DWORD nPacketsExamined = 0;
DWORD nFrameCountSoFar = 0;
DWORD nFramesToSkip;
DWORD nFrameBitOffset;
XMA2DEFS_ASSERT(pXmaData);
XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
// Get the first XMA packet belonging to the desired stream, relying on the
// fact that the first packets for each stream are in consecutive order at
// the beginning of an XMA block.
pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
for (;;)
{
// If we have exceeded the size of the XMA data, return failure
if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
{
return 0;
}
// If the current packet contains the frame we are looking for...
if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame)
{
// See how many frames in this packet we need to skip to get to it
XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar);
nFramesToSkip = nDesiredFrame - nFrameCountSoFar;
// Get the bit offset of the first frame in this packet
nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket);
// Advance nFrameBitOffset to the frame of interest
while (nFramesToSkip--)
{
nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset);
}
// The bit offset to return is the number of bits from pXmaData to
// pCurrentPacket plus the bit offset of the frame of interest
return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset;
}
// If we haven't found the right packet yet, advance our counters
++nPacketsExamined;
nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket);
// And skip to the next packet belonging to the same stream
pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1);
}
}
// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete
// frame in an XMA block or set of blocks.
__inline DWORD GetLastXmaFrameBitPosition
(
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
DWORD nXmaDataBytes, // Size of pXmaData in bytes
DWORD nStreamIndex // Stream within which to seek
)
{
const BYTE* pLastPacket;
DWORD nBytesToNextPacket;
DWORD nFrameBitOffset;
DWORD nFramesInLastPacket;
XMA2DEFS_ASSERT(pXmaData);
XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1));
// Get the first XMA packet belonging to the desired stream, relying on the
// fact that the first packets for each stream are in consecutive order at
// the beginning of an XMA block.
pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
// Search for the last packet belonging to the desired stream
for (;;)
{
nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1);
XMA2DEFS_ASSERT(nBytesToNextPacket);
if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
{
break; // The next packet would extend beyond the end of pXmaData
}
pLastPacket += nBytesToNextPacket;
}
// The last packet can sometimes have no seekable frames, in which case we
// have to use the previous one
if (GetXmaPacketFrameCount(pLastPacket) == 0)
{
pLastPacket -= nBytesToNextPacket;
}
// Found the last packet. Get the bit offset of its first frame.
nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket);
// Traverse frames until we reach the last one
nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket);
while (--nFramesInLastPacket)
{
nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset);
}
// The bit offset to return is the number of bits from pXmaData to
// pLastPacket plus the offset of the last frame in this packet.
return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset;
}
// GetXmaDecodePositionForSample: Obtains the information needed to make the
// decoder generate audio starting at a given sample position relative to the
// beginning of the given XMA block: the bit offset of the appropriate frame,
// and the right subframe within that frame. This data can be passed directly
// to the XMAPlaybackSetDecodePosition function.
__inline HRESULT GetXmaDecodePositionForSample
(
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
DWORD nXmaDataBytes, // Size of pXmaData in bytes
DWORD nStreamIndex, // Stream within which to seek
DWORD nDesiredSample, // Sample sought
__out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of
// the frame containing the sample sought
__out DWORD* pnSubFrame // Returns the subframe containing the sample
)
{
DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME;
DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME;
DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame);
XMA2DEFS_ASSERT(pnBitOffset);
XMA2DEFS_ASSERT(pnSubFrame);
if (nBitOffset)
{
*pnBitOffset = nBitOffset;
*pnSubFrame = nSubFrame;
return S_OK;
}
else
{
return E_FAIL;
}
}
// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz)
// corresponding to a generic sample rate.
__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate)
{
DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz
if (dwGeneralRate <= 24000) dwXmaRate = 24000;
else if (dwGeneralRate <= 32000) dwXmaRate = 32000;
else if (dwGeneralRate <= 44100) dwXmaRate = 44100;
return dwXmaRate;
}
// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations
// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which
// are limited to eight possible speaker positions: left, right, center, low
// frequency, side left, side right, back left and back right).
__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask)
{
DWORD dwStandardMask = 0;
if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT;
if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT;
if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER;
if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY;
if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT;
if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT;
if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT;
if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT;
return dwStandardMask;
}
__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask)
{
BYTE bXmaMask = 0;
if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT;
if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT;
if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER;
if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE;
if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND;
if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND;
if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK;
if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK;
return bXmaMask;
}
// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply
// with the current platform's byte-ordering rules (little- or big-endian).
__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format)
{
#define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8)))
#define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8))
if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2)
{
return S_OK;
}
else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2)
{
pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag);
pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels);
pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec);
pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec);
pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign);
pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample);
pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize);
pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams);
pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask);
pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded);
pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock);
pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin);
pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength);
pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin);
pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength);
pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount);
return S_OK;
}
else
{
return E_FAIL; // Not a recognizable XMA2 format
}
#undef XMASWAP2BYTES
#undef XMASWAP4BYTES
}
#endif // #ifndef __XMA2DEFS_INCLUDED__

2938
gfx/include/dxsdk/xnamath.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,7 @@ HAVE_MINIUPNPC=auto # Mini UPnP client library (for NAT traversal)
HAVE_BUILTINMINIUPNPC=yes # Bake in Mini UPnP client library (for NAT traversal)
C89_BUILTINMINIUPNPC=no
HAVE_D3D9=yes # Direct3D 9 support
HAVE_D3D10=no # Direct3D 10 support
HAVE_D3D11=no # Direct3D 11 support
HAVE_D3D12=no # Direct3D 11 support
HAVE_D3DX=yes # Direct3DX support