Moved ddraw into exe, temp added libsmacker to test out movie event code. Movies work if converted to SMK.

This commit is contained in:
Justin Marshall
2020-06-02 23:31:13 -07:00
parent 22f3ea37de
commit 41bb81ff93
137 changed files with 165660 additions and 629 deletions
+3722
View File
File diff suppressed because it is too large Load Diff
+2523
View File
File diff suppressed because it is too large Load Diff
+919
View File
@@ -0,0 +1,919 @@
/*=========================================================================*\
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
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 // #ifndef D2D_USE_C_DEFINITIONS
#endif // #ifndef _D2D1_HELPER_H_
+199
View File
@@ -0,0 +1,199 @@
//---------------------------------------------------------------------------
// 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_
#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
#include <d2d1_2helper.h>
#endif // #ifndef _D2D1_2_H_
+60
View File
@@ -0,0 +1,60 @@
/*=========================================================================*\
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
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 // #ifndef D2D_USE_C_DEFINITIONS
#endif // #if NTDDI_VERSION >= NTDDI_WINBLUE
#endif // #ifndef _D2D1_HELPER_H_
+1855
View File
File diff suppressed because it is too large Load Diff
+255
View File
@@ -0,0 +1,255 @@
/*=========================================================================*\
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
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 // #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
+98
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_
+405
View File
@@ -0,0 +1,405 @@
//---------------------------------------------------------------------------
// 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 <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 // #ifndef _D2D1_AUTHOR_H_
File diff suppressed because it is too large Load Diff
+80
View File
@@ -0,0 +1,80 @@
//---------------------------------------------------------------------------
// 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_
// 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.
/// Effect description: An effect that takes a Y plane as input 0 and a CbCr plane
/// as input 1 and outputs RGBA. The CbCr plane can be chroma subsampled. Useful
/// for JPEG color conversion.
/// </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 // #ifndef _D2D1_EFFECTS_1_
File diff suppressed because it is too large Load Diff
+25
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
+63
View File
@@ -0,0 +1,63 @@
/*=========================================================================*\
Copyright (c) Microsoft Corporation. All rights reserved.
\*=========================================================================*/
#pragma once
/*=========================================================================*\
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)
//
// D2D specific codes now live in winerror.h
//
+1691
View File
File diff suppressed because it is too large Load Diff
+6800
View File
File diff suppressed because it is too large Load Diff
+1788
View File
File diff suppressed because it is too large Load Diff
+305
View File
@@ -0,0 +1,305 @@
//////////////////////////////////////////////////////////////////////////////
//
// 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"
//----------------------------------------------------------------------------
// 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
+146
View File
@@ -0,0 +1,146 @@
//////////////////////////////////////////////////////////////////////////////
//
// 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
///////////////////////////////////////////////////////////////////////////
// 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);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10EFFECT_H__
File diff suppressed because it is too large Load Diff
+555
View File
@@ -0,0 +1,555 @@
//////////////////////////////////////////////////////////////////////////////
//
// 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"
//---------------------------------------------------------------------------
// 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 //__D3D10SHADER_H__
+14600
View File
File diff suppressed because it is too large Load Diff
+5220
View File
File diff suppressed because it is too large Load Diff
+2721
View File
File diff suppressed because it is too large Load Diff
+6826
View File
File diff suppressed because it is too large Load Diff
+4759
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+601
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__
+570
View File
@@ -0,0 +1,570 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.01.0622 */
/* @@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__ 500
#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
+17253
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+459
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
+1279
View File
File diff suppressed because it is too large Load Diff
+364
View File
@@ -0,0 +1,364 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3d8caps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _D3D8CAPS_H
#define _D3D8CAPS_H
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0800
#endif //DIRECT3D_VERSION
// include this file content only if compiling for DX8 interfaces
#if(DIRECT3D_VERSION >= 0x0800)
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
typedef struct _D3DCAPS8
{
/* Device Info */
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
/* Caps from DX7 Draw */
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
/* Cursor Caps */
DWORD CursorCaps;
/* 3D Device Caps */
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's
DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's
DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's
DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's
DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's
DWORD LineCaps; // D3DLINECAPS
DWORD MaxTextureWidth, MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride; // max stride for SetStreamSource
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst; // number of vertex shader constant registers
DWORD PixelShaderVersion;
float MaxPixelShaderValue; // max value of pixel shader arithmetic component
} D3DCAPS8;
//
// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS
//
//
// Caps
//
#define D3DCAPS_READ_SCANLINE 0x00020000L
//
// Caps2
//
#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L
#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L
#define D3DCAPS2_RESERVED 0x02000000L
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L
//
// Caps3
//
#define D3DCAPS3_RESERVED 0x8000001fL
// Indicates that the device can respect the ALPHABLENDENABLE render state
// when fullscreen while using the FLIP or DISCARD swap effect.
// COPY and COPYVSYNC swap effects work whether or not this flag is set.
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L
//
// PresentationIntervals
//
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L
#define D3DPRESENT_INTERVAL_ONE 0x00000001L
#define D3DPRESENT_INTERVAL_TWO 0x00000002L
#define D3DPRESENT_INTERVAL_THREE 0x00000004L
#define D3DPRESENT_INTERVAL_FOUR 0x00000008L
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L
//
// CursorCaps
//
// Driver supports HW color cursor in at least hi-res modes(height >=400)
#define D3DCURSORCAPS_COLOR 0x00000001L
// Driver supports HW cursor also in low-res modes(height < 400)
#define D3DCURSORCAPS_LOWRES 0x00000002L
//
// DevCaps
//
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */
#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */
#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */
#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */
//
// PrimitiveMiscCaps
//
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */
#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */
#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */
//
// LineCaps
//
#define D3DLINECAPS_TEXTURE 0x00000001L
#define D3DLINECAPS_ZTEST 0x00000002L
#define D3DLINECAPS_BLEND 0x00000004L
#define D3DLINECAPS_ALPHACMP 0x00000008L
#define D3DLINECAPS_FOG 0x00000010L
//
// RasterCaps
//
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */
#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L
//
// ZCmpCaps, AlphaCmpCaps
//
#define D3DPCMPCAPS_NEVER 0x00000001L
#define D3DPCMPCAPS_LESS 0x00000002L
#define D3DPCMPCAPS_EQUAL 0x00000004L
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
#define D3DPCMPCAPS_GREATER 0x00000010L
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
#define D3DPCMPCAPS_ALWAYS 0x00000080L
//
// SourceBlendCaps, DestBlendCaps
//
#define D3DPBLENDCAPS_ZERO 0x00000001L
#define D3DPBLENDCAPS_ONE 0x00000002L
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
//
// ShadeCaps
//
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
//
// TextureCaps
//
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */
#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */
#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */
// Device can use non-POW2 textures if:
// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
// 2) D3DRS_WRAP(N) is zero for this texture's coordinates
// 3) mip mapping is not enabled (use magnification filter only)
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */
#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */
#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */
//
// TextureFilterCaps
//
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
//
// TextureAddressCaps
//
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L
//
// StencilCaps
//
#define D3DSTENCILCAPS_KEEP 0x00000001L
#define D3DSTENCILCAPS_ZERO 0x00000002L
#define D3DSTENCILCAPS_REPLACE 0x00000004L
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
//
// TextureOpCaps
//
#define D3DTEXOPCAPS_DISABLE 0x00000001L
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
#define D3DTEXOPCAPS_MODULATE 0x00000008L
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
#define D3DTEXOPCAPS_ADD 0x00000040L
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L
#define D3DTEXOPCAPS_LERP 0x02000000L
//
// FVFCaps
//
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */
//
// VertexProcessingCaps
//
#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */
#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */
#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */
#pragma pack()
#endif /* (DIRECT3D_VERSION >= 0x0800) */
#endif /* _D3D8CAPS_H_ */
+1684
View File
File diff suppressed because it is too large Load Diff
+2794
View File
File diff suppressed because it is too large Load Diff
+571
View File
@@ -0,0 +1,571 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3d9caps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _d3d9CAPS_H
#define _d3d9CAPS_H
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0900
#endif //DIRECT3D_VERSION
// include this file content only if compiling for DX9 interfaces
#if(DIRECT3D_VERSION >= 0x0900)
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
typedef struct _D3DVSHADERCAPS2_0
{
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
} D3DVSHADERCAPS2_0;
#define D3DVS20CAPS_PREDICATION (1<<0)
#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DVS20_MAX_NUMTEMPS 32
#define D3DVS20_MIN_NUMTEMPS 12
#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1
typedef struct _D3DPSHADERCAPS2_0
{
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
INT NumInstructionSlots;
} D3DPSHADERCAPS2_0;
#define D3DPS20CAPS_ARBITRARYSWIZZLE (1<<0)
#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1<<1)
#define D3DPS20CAPS_PREDICATION (1<<2)
#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1<<3)
#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1<<4)
#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMTEMPS 32
#define D3DPS20_MIN_NUMTEMPS 12
#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512
#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96
#define D3DMIN30SHADERINSTRUCTIONS 512
#define D3DMAX30SHADERINSTRUCTIONS 32768
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
typedef struct _D3DOVERLAYCAPS
{
UINT Caps;
UINT MaxOverlayDisplayWidth;
UINT MaxOverlayDisplayHeight;
} D3DOVERLAYCAPS;
#define D3DOVERLAYCAPS_FULLRANGERGB 0x00000001
#define D3DOVERLAYCAPS_LIMITEDRANGERGB 0x00000002
#define D3DOVERLAYCAPS_YCbCr_BT601 0x00000004
#define D3DOVERLAYCAPS_YCbCr_BT709 0x00000008
#define D3DOVERLAYCAPS_YCbCr_BT601_xvYCC 0x00000010
#define D3DOVERLAYCAPS_YCbCr_BT709_xvYCC 0x00000020
#define D3DOVERLAYCAPS_STRETCHX 0x00000040
#define D3DOVERLAYCAPS_STRETCHY 0x00000080
typedef struct _D3DCONTENTPROTECTIONCAPS
{
DWORD Caps;
GUID KeyExchangeType;
UINT BufferAlignmentStart;
UINT BlockAlignmentSize;
ULONGLONG ProtectedMemorySize;
} D3DCONTENTPROTECTIONCAPS;
#define D3DCPCAPS_SOFTWARE 0x00000001
#define D3DCPCAPS_HARDWARE 0x00000002
#define D3DCPCAPS_PROTECTIONALWAYSON 0x00000004
#define D3DCPCAPS_PARTIALDECRYPTION 0x00000008
#define D3DCPCAPS_CONTENTKEY 0x00000010
#define D3DCPCAPS_FRESHENSESSIONKEY 0x00000020
#define D3DCPCAPS_ENCRYPTEDREADBACK 0x00000040
#define D3DCPCAPS_ENCRYPTEDREADBACKKEY 0x00000080
#define D3DCPCAPS_SEQUENTIAL_CTR_IV 0x00000100
#define D3DCPCAPS_ENCRYPTSLICEDATAONLY 0x00000200
DEFINE_GUID(D3DCRYPTOTYPE_AES128_CTR,
0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f);
DEFINE_GUID(D3DCRYPTOTYPE_PROPRIETARY,
0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x8, 0x69, 0x91, 0x7b, 0xd, 0xe8);
DEFINE_GUID(D3DKEYEXCHANGE_RSAES_OAEP,
0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20);
DEFINE_GUID(D3DKEYEXCHANGE_DXVA,
0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b);
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
typedef struct _D3DCAPS9
{
/* Device Info */
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
/* Caps from DX7 Draw */
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
/* Cursor Caps */
DWORD CursorCaps;
/* 3D Device Caps */
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's
DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture9's
DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture9's
DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture9's
DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture9's
DWORD LineCaps; // D3DLINECAPS
DWORD MaxTextureWidth, MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride; // max stride for SetStreamSource
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst; // number of vertex shader constant registers
DWORD PixelShaderVersion;
float PixelShader1xMaxValue; // max value storable in registers of ps.1.x shaders
// Here are the DX9 specific ones
DWORD DevCaps2;
float MaxNpatchTessellationLevel;
DWORD Reserved5;
UINT MasterAdapterOrdinal; // ordinal of master adaptor for adapter group
UINT AdapterOrdinalInGroup; // ordinal inside the adapter group
UINT NumberOfAdaptersInGroup; // number of adapters in this adapter group (only if master)
DWORD DeclTypes; // Data types, supported in vertex declarations
DWORD NumSimultaneousRTs; // Will be at least 1
DWORD StretchRectFilterCaps; // Filter caps supported by StretchRect
D3DVSHADERCAPS2_0 VS20Caps;
D3DPSHADERCAPS2_0 PS20Caps;
DWORD VertexTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's for texture, used in vertex shaders
DWORD MaxVShaderInstructionsExecuted; // maximum number of vertex shader instructions that can be executed
DWORD MaxPShaderInstructionsExecuted; // maximum number of pixel shader instructions that can be executed
DWORD MaxVertexShader30InstructionSlots;
DWORD MaxPixelShader30InstructionSlots;
} D3DCAPS9;
//
// BIT DEFINES FOR D3DCAPS9 DWORD MEMBERS
//
//
// Caps
//
#define D3DCAPS_OVERLAY 0x00000800L
#define D3DCAPS_READ_SCANLINE 0x00020000L
//
// Caps2
//
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L
#define D3DCAPS2_RESERVED 0x02000000L
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L
#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DCAPS2_CANSHARERESOURCE 0x80000000L
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
//
// Caps3
//
#define D3DCAPS3_RESERVED 0x8000001fL
// Indicates that the device can respect the ALPHABLENDENABLE render state
// when fullscreen while using the FLIP or DISCARD swap effect.
// COPY and COPYVSYNC swap effects work whether or not this flag is set.
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L
// Indicates that the device can perform a gamma correction from
// a windowed back buffer containing linear content to the sRGB desktop.
#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080L
#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */
#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */
#define D3DCAPS3_DXVAHD 0x00000400L
#define D3DCAPS3_DXVAHD_LIMITED 0x00000800L
//
// PresentationIntervals
//
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L
#define D3DPRESENT_INTERVAL_ONE 0x00000001L
#define D3DPRESENT_INTERVAL_TWO 0x00000002L
#define D3DPRESENT_INTERVAL_THREE 0x00000004L
#define D3DPRESENT_INTERVAL_FOUR 0x00000008L
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L
//
// CursorCaps
//
// Driver supports HW color cursor in at least hi-res modes(height >=400)
#define D3DCURSORCAPS_COLOR 0x00000001L
// Driver supports HW cursor also in low-res modes(height < 400)
#define D3DCURSORCAPS_LOWRES 0x00000002L
//
// DevCaps
//
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */
#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */
#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */
#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */
//
// PrimitiveMiscCaps
//
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */
#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */
#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */
#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000L /* Device supports independent write masks for MET or MRT */
#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L /* Device supports per-stage constants */
#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000L /* Device supports separate fog and specular alpha (many devices
use the specular alpha channel to store fog factor) */
#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000L /* Device supports separate blend settings for the alpha channel */
#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L /* Device supports different bit depths for MRT */
#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L /* Device supports post-pixel shader operations for MRT */
#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000L /* Indicates device can perform conversion to sRGB after blending. */
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
//
// LineCaps
//
#define D3DLINECAPS_TEXTURE 0x00000001L
#define D3DLINECAPS_ZTEST 0x00000002L
#define D3DLINECAPS_BLEND 0x00000004L
#define D3DLINECAPS_ALPHACMP 0x00000008L
#define D3DLINECAPS_FOG 0x00000010L
#define D3DLINECAPS_ANTIALIAS 0x00000020L
//
// RasterCaps
//
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */
#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L
#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L
//
// ZCmpCaps, AlphaCmpCaps
//
#define D3DPCMPCAPS_NEVER 0x00000001L
#define D3DPCMPCAPS_LESS 0x00000002L
#define D3DPCMPCAPS_EQUAL 0x00000004L
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
#define D3DPCMPCAPS_GREATER 0x00000010L
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
#define D3DPCMPCAPS_ALWAYS 0x00000080L
//
// SourceBlendCaps, DestBlendCaps
//
#define D3DPBLENDCAPS_ZERO 0x00000001L
#define D3DPBLENDCAPS_ONE 0x00000002L
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000L /* Supports both D3DBLEND_BLENDFACTOR and D3DBLEND_INVBLENDFACTOR */
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DPBLENDCAPS_SRCCOLOR2 0x00004000L
#define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000L
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
//
// ShadeCaps
//
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
//
// TextureCaps
//
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */
#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */
#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */
// Device can use non-POW2 textures if:
// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
// 2) D3DRS_WRAP(N) is zero for this texture's coordinates
// 3) mip mapping is not enabled (use magnification filter only)
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */
#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */
#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L /* Device does not support projected bump env lookup operation
in programmable and fixed function pixel shaders */
//
// TextureFilterCaps, StretchRectFilterCaps
//
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800L
#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000L
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DPTFILTERCAPS_CONVOLUTIONMONO 0x00040000L /* Min and Mag for the convolution mono filter */
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000L
//
// TextureAddressCaps
//
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L
//
// StencilCaps
//
#define D3DSTENCILCAPS_KEEP 0x00000001L
#define D3DSTENCILCAPS_ZERO 0x00000002L
#define D3DSTENCILCAPS_REPLACE 0x00000004L
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
#define D3DSTENCILCAPS_TWOSIDED 0x00000100L
//
// TextureOpCaps
//
#define D3DTEXOPCAPS_DISABLE 0x00000001L
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
#define D3DTEXOPCAPS_MODULATE 0x00000008L
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
#define D3DTEXOPCAPS_ADD 0x00000040L
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L
#define D3DTEXOPCAPS_LERP 0x02000000L
//
// FVFCaps
//
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */
//
// VertexProcessingCaps
//
#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */
#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L /* device supports D3DTSS_TCI_SPHEREMAP */
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200L /* device does not support TexGen in non-local
viewer mode */
//
// DevCaps2
//
#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L /* Device supports offsets in streams. Must be set by DX9 drivers */
#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L /* Device supports displacement maps for N-Patches*/
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L /* Device supports adaptive tesselation of RT-patches*/
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L /* Device supports adaptive tesselation of N-patches*/
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L /* Device supports StretchRect calls with a texture as the source*/
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L /* Device supports presampled displacement maps for N-Patches */
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L /* Vertex elements in a vertex declaration can share the same stream offset */
//
// DeclTypes
//
#define D3DDTCAPS_UBYTE4 0x00000001L
#define D3DDTCAPS_UBYTE4N 0x00000002L
#define D3DDTCAPS_SHORT2N 0x00000004L
#define D3DDTCAPS_SHORT4N 0x00000008L
#define D3DDTCAPS_USHORT2N 0x00000010L
#define D3DDTCAPS_USHORT4N 0x00000020L
#define D3DDTCAPS_UDEC3 0x00000040L
#define D3DDTCAPS_DEC3N 0x00000080L
#define D3DDTCAPS_FLOAT16_2 0x00000100L
#define D3DDTCAPS_FLOAT16_4 0x00000200L
#pragma pack()
#endif /* (DIRECT3D_VERSION >= 0x0900) */
#endif /* _d3d9CAPS_H_ */
+2442
View File
File diff suppressed because it is too large Load Diff
+604
View File
@@ -0,0 +1,604 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3dcaps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _D3DCAPS_H
#define _D3DCAPS_H
/*
* Pull in DirectDraw include file automatically:
*/
#include "ddraw.h"
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0700
#endif
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
/* Description of capabilities of transform */
typedef struct _D3DTRANSFORMCAPS {
DWORD dwSize;
DWORD dwCaps;
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
/* Description of capabilities of lighting */
typedef struct _D3DLIGHTINGCAPS {
DWORD dwSize;
DWORD dwCaps; /* Lighting caps */
DWORD dwLightingModel; /* Lighting model - RGB or mono */
DWORD dwNumLights; /* Number of lights that can be handled */
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
#define D3DLIGHTINGMODEL_RGB 0x00000001L
#define D3DLIGHTINGMODEL_MONO 0x00000002L
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
#if(DIRECT3D_VERSION < 0x700)
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
#endif
#if(DIRECT3D_VERSION < 0x500)
#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
#endif
/* Description of capabilities for each primitive type */
typedef struct _D3DPrimCaps {
DWORD dwSize;
DWORD dwMiscCaps; /* Capability flags */
DWORD dwRasterCaps;
DWORD dwZCmpCaps;
DWORD dwSrcBlendCaps;
DWORD dwDestBlendCaps;
DWORD dwAlphaCmpCaps;
DWORD dwShadeCaps;
DWORD dwTextureCaps;
DWORD dwTextureFilterCaps;
DWORD dwTextureBlendCaps;
DWORD dwTextureAddressCaps;
DWORD dwStippleWidth; /* maximum width and height of */
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
/* D3DPRIMCAPS dwMiscCaps */
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
/* D3DPRIMCAPS dwRasterCaps */
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_ROP2 0x00000002L
#define D3DPRASTERCAPS_XOR 0x00000004L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#endif /* DIRECT3D_VERSION >= 0x0600 */
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
#define D3DPCMPCAPS_NEVER 0x00000001L
#define D3DPCMPCAPS_LESS 0x00000002L
#define D3DPCMPCAPS_EQUAL 0x00000004L
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
#define D3DPCMPCAPS_GREATER 0x00000010L
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
#define D3DPCMPCAPS_ALWAYS 0x00000080L
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
#define D3DPBLENDCAPS_ZERO 0x00000001L
#define D3DPBLENDCAPS_ONE 0x00000002L
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
/* D3DPRIMCAPS dwShadeCaps */
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
/* D3DPRIMCAPS dwTextureCaps */
/*
* Perspective-correct texturing is supported
*/
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
/*
* Power-of-2 texture dimensions are required
*/
#define D3DPTEXTURECAPS_POW2 0x00000002L
/*
* Alpha in texture pixels is supported
*/
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
/*
* Color-keyed textures are supported
*/
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
/*
* obsolete, see D3DPTADDRESSCAPS_BORDER
*/
#define D3DPTEXTURECAPS_BORDER 0x00000010L
/*
* Only square textures are supported
*/
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
#if(DIRECT3D_VERSION >= 0x0600)
/*
* Texture indices are not scaled by the texture size prior
* to interpolation.
*/
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
/*
* Device can draw alpha from texture palettes
*/
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
/*
* Device can use non-POW2 textures if:
* 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
* 2) D3DRS_WRAP(N) is zero for this texture's coordinates
* 3) mip mapping is not enabled (use magnification filter only)
*/
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
// 0x00000200L unused
/*
* Device can divide transformed texture coordinates by the
* COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
*/
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L
/*
* Device can do cubemap textures
*/
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L
#endif /* DIRECT3D_VERSION >= 0x0700 */
/* D3DPRIMCAPS dwTextureFilterCaps */
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
#if(DIRECT3D_VERSION >= 0x0600)
/* Device3 Min Filter */
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
/* Device3 Mip Filter */
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
/* Device3 Mag Filter */
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
#endif /* DIRECT3D_VERSION >= 0x0600 */
/* D3DPRIMCAPS dwTextureBlendCaps */
#define D3DPTBLENDCAPS_DECAL 0x00000001L
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
#define D3DPTBLENDCAPS_COPY 0x00000040L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPTBLENDCAPS_ADD 0x00000080L
#endif /* DIRECT3D_VERSION >= 0x0500 */
/* D3DPRIMCAPS dwTextureAddressCaps */
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
/* D3DDEVICEDESC dwStencilCaps */
#define D3DSTENCILCAPS_KEEP 0x00000001L
#define D3DSTENCILCAPS_ZERO 0x00000002L
#define D3DSTENCILCAPS_REPLACE 0x00000004L
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
/* D3DDEVICEDESC dwTextureOpCaps */
#define D3DTEXOPCAPS_DISABLE 0x00000001L
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
#define D3DTEXOPCAPS_MODULATE 0x00000008L
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
#define D3DTEXOPCAPS_ADD 0x00000040L
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
/* D3DDEVICEDESC dwFVFCaps flags */
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
#endif /* DIRECT3D_VERSION >= 0x0600 */
/*
* Description for a device.
* This is used to describe a device that is to be created or to query
* the current device.
*/
typedef struct _D3DDeviceDesc {
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
DWORD dwFlags; /* Indicates which fields have valid data */
D3DCOLORMODEL dcmColorModel; /* Color model of device */
DWORD dwDevCaps; /* Capabilities of device */
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
BOOL bClipping; /* Device can do 3D clipping */
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
DWORD dwMaxVertexCount; /* Maximum vertex count */
#if(DIRECT3D_VERSION >= 0x0500)
// *** New fields for DX5 *** //
// Width and height caps are 0 for legacy HALs.
DWORD dwMinTextureWidth, dwMinTextureHeight;
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
DWORD dwMinStippleWidth, dwMaxStippleWidth;
DWORD dwMinStippleHeight, dwMaxStippleHeight;
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
// New fields for DX6
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
// Guard band that the rasterizer can accommodate
// Screen-space vertices inside this space but outside the viewport
// will get clipped properly.
D3DVALUE dvGuardBandLeft;
D3DVALUE dvGuardBandTop;
D3DVALUE dvGuardBandRight;
D3DVALUE dvGuardBandBottom;
D3DVALUE dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
#endif /* DIRECT3D_VERSION >= 0x0600 */
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DDeviceDesc7 {
DWORD dwDevCaps; /* Capabilities of device */
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
DWORD dwMinTextureWidth, dwMinTextureHeight;
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
D3DVALUE dvGuardBandLeft;
D3DVALUE dvGuardBandTop;
D3DVALUE dvGuardBandRight;
D3DVALUE dvGuardBandBottom;
D3DVALUE dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
DWORD dwMaxActiveLights;
D3DVALUE dvMaxVertexW;
GUID deviceGUID;
WORD wMaxUserClipPlanes;
WORD wMaxVertexBlendMatrices;
DWORD dwVertexProcessingCaps;
DWORD dwReserved1;
DWORD dwReserved2;
DWORD dwReserved3;
DWORD dwReserved4;
} D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
#if(DIRECT3D_VERSION >= 0x0700)
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
#endif /* DIRECT3D_VERSION >= 0x0700 */
/* D3DDEVICEDESC dwFlags indicating valid fields */
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
/* D3DDEVICEDESC dwDevCaps flags */
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
/* for post-transform vertex data */
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
/*
* These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
*/
/* device can do texgen */
#define D3DVTXPCAPS_TEXGEN 0x00000001L
/* device can do IDirect3DDevice7 colormaterialsource ops */
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
/* device can do vertex fog */
#define D3DVTXPCAPS_VERTEXFOG 0x00000004L
/* device can do directional lights */
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
/* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
/* device can do local viewer */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
#define D3DFDS_GUID 0x00000002L /* Match guid */
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
/*
* FindDevice arguments
*/
typedef struct _D3DFINDDEVICESEARCH {
DWORD dwSize;
DWORD dwFlags;
BOOL bHardware;
D3DCOLORMODEL dcmColorModel;
GUID guid;
DWORD dwCaps;
D3DPRIMCAPS dpcPrimCaps;
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
typedef struct _D3DFINDDEVICERESULT {
DWORD dwSize;
GUID guid; /* guid which matched */
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
/*
* Description of execute buffer.
*/
typedef struct _D3DExecuteBufferDesc {
DWORD dwSize; /* size of this structure */
DWORD dwFlags; /* flags indicating which fields are valid */
DWORD dwCaps; /* capabilities of execute buffer */
DWORD dwBufferSize; /* size of execute buffer data */
LPVOID lpData; /* pointer to actual data */
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
#define D3DDEB_CAPS 0x00000002l /* caps valid */
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
/* D3DEXECUTEBUFFER dwCaps */
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
#if(DIRECT3D_VERSION < 0x0800)
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DDEVINFO_TEXTUREMANAGER {
BOOL bThrashing; /* indicates if thrashing */
DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */
DWORD dwNumEvicts; /* number of textures evicted */
DWORD dwNumVidCreates; /* number of textures created in video memory */
DWORD dwNumTexturesUsed; /* number of textures used */
DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */
DWORD dwWorkingSet; /* number of textures in video memory */
DWORD dwWorkingSetBytes; /* number of bytes in video memory */
DWORD dwTotalManaged; /* total number of managed textures */
DWORD dwTotalBytes; /* total number of bytes of managed textures */
DWORD dwLastPri; /* priority of last texture evicted */
} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
typedef struct _D3DDEVINFO_TEXTURING {
DWORD dwNumLoads; /* counts Load() API calls */
DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */
DWORD dwNumPreLoads; /* counts PreLoad() API calls */
DWORD dwNumSet; /* counts SetTexture() API calls */
DWORD dwNumCreates; /* counts texture creates */
DWORD dwNumDestroys; /* counts texture destroys */
DWORD dwNumSetPriorities; /* counts SetPriority() API calls */
DWORD dwNumSetLODs; /* counts SetLOD() API calls */
DWORD dwNumLocks; /* counts number of texture locks */
DWORD dwNumGetDCs; /* counts number of GetDCs to textures */
} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#endif //(DIRECT3D_VERSION < 0x0800)
#pragma pack()
#endif /* _D3DCAPS_H_ */
+1009
View File
File diff suppressed because it is too large Load Diff
+577
View File
@@ -0,0 +1,577 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DCompiler.h
// Content: D3D Compilation Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3DCOMPILER_H__
#define __D3DCOMPILER_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
//----------------------------------------------------------------------------
// 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);
//----------------------------------------------------------------------------
// 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);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // #ifndef __D3DCOMPILER_H__
+411
View File
@@ -0,0 +1,411 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DX11GPGPU.h
// Content: D3DX11 General Purpose GPU computing algorithms
//
//////////////////////////////////////////////////////////////////////////////
#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__
+2128
View File
File diff suppressed because it is too large Load Diff
+257
View File
@@ -0,0 +1,257 @@
/******************************************************************
* *
* D3DVec.inl *
* *
* Float-valued 3D vector class for Direct3D. *
* *
* Copyright (c) Microsoft Corp. All rights reserved. *
* *
******************************************************************/
#include <math.h>
// =====================================
// Constructors
// =====================================
inline
_D3DVECTOR::_D3DVECTOR(D3DVALUE f)
{
x = y = z = f;
}
inline
_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
{
x = _x; y = _y; z = _z;
}
inline
_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3])
{
x = f[0]; y = f[1]; z = f[2];
}
// =====================================
// Access grants
// =====================================
inline const D3DVALUE&
_D3DVECTOR::operator[](int i) const
{
return (&x)[i];
}
inline D3DVALUE&
_D3DVECTOR::operator[](int i)
{
return (&x)[i];
}
// =====================================
// Assignment operators
// =====================================
inline _D3DVECTOR&
_D3DVECTOR::operator += (const _D3DVECTOR& v)
{
x += v.x; y += v.y; z += v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator -= (const _D3DVECTOR& v)
{
x -= v.x; y -= v.y; z -= v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator *= (const _D3DVECTOR& v)
{
x *= v.x; y *= v.y; z *= v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator /= (const _D3DVECTOR& v)
{
x /= v.x; y /= v.y; z /= v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator *= (D3DVALUE s)
{
x *= s; y *= s; z *= s;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator /= (D3DVALUE s)
{
x /= s; y /= s; z /= s;
return *this;
}
inline _D3DVECTOR
operator + (const _D3DVECTOR& v)
{
return v;
}
inline _D3DVECTOR
operator - (const _D3DVECTOR& v)
{
return _D3DVECTOR(-v.x, -v.y, -v.z);
}
inline _D3DVECTOR
operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
}
inline _D3DVECTOR
operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
}
inline _D3DVECTOR
operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
}
inline _D3DVECTOR
operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
}
inline int
operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2];
}
inline int
operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2];
}
inline _D3DVECTOR
operator * (const _D3DVECTOR& v, D3DVALUE s)
{
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
}
inline _D3DVECTOR
operator * (D3DVALUE s, const _D3DVECTOR& v)
{
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
}
inline _D3DVECTOR
operator / (const _D3DVECTOR& v, D3DVALUE s)
{
return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
}
inline int
operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z;
}
inline D3DVALUE
Magnitude (const _D3DVECTOR& v)
{
return (D3DVALUE) sqrt(SquareMagnitude(v));
}
inline D3DVALUE
SquareMagnitude (const _D3DVECTOR& v)
{
return v.x*v.x + v.y*v.y + v.z*v.z;
}
inline _D3DVECTOR
Normalize (const _D3DVECTOR& v)
{
return v / Magnitude(v);
}
inline D3DVALUE
Min (const _D3DVECTOR& v)
{
D3DVALUE ret = v.x;
if (v.y < ret) ret = v.y;
if (v.z < ret) ret = v.z;
return ret;
}
inline D3DVALUE
Max (const _D3DVECTOR& v)
{
D3DVALUE ret = v.x;
if (ret < v.y) ret = v.y;
if (ret < v.z) ret = v.z;
return ret;
}
inline _D3DVECTOR
Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0],
v1[1] < v2[1] ? v1[1] : v2[1],
v1[2] < v2[2] ? v1[2] : v2[2]);
}
inline _D3DVECTOR
Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0],
v1[1] > v2[1] ? v1[1] : v2[1],
v1[2] > v2[2] ? v1[2] : v2[2]);
}
inline D3DVALUE
DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z;
}
inline _D3DVECTOR
CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
_D3DVECTOR result;
result[0] = v1[1] * v2[2] - v1[2] * v2[1];
result[1] = v1[2] * v2[0] - v1[0] * v2[2];
result[2] = v1[0] * v2[1] - v1[1] * v2[0];
return result;
}
inline _D3DMATRIX
operator* (const _D3DMATRIX& a, const _D3DMATRIX& b)
{
_D3DMATRIX ret;
for (int i=0; i<4; i++) {
for (int j=0; j<4; j++) {
ret(i, j) = 0.0f;
for (int k=0; k<4; k++) {
ret(i, j) += a(i, k) * b(k, j);
}
}
}
return ret;
}
+72
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__
+290
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__
+444
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
+286
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__
+766
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__
+74
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__
+164
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__
+128
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__
+772
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__
+78
View File
@@ -0,0 +1,78 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9.h
// Content: D3DX utility library
//
//////////////////////////////////////////////////////////////////////////////
#ifdef __D3DX_INTERNAL__
#error Incorrect D3DX header used
#endif
#ifndef __D3DX9_H__
#define __D3DX9_H__
// Defines
#include <limits.h>
#define D3DX_DEFAULT ((UINT) -1)
#define D3DX_DEFAULT_NONPOW2 ((UINT) -2)
#define D3DX_DEFAULT_FLOAT FLT_MAX
#define D3DX_FROM_FILE ((UINT) -3)
#define D3DFMT_FROM_FILE ((D3DFORMAT) -3)
#ifndef D3DXINLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DXINLINE __forceinline
#else
#define D3DXINLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DXINLINE inline
#else
#define D3DXINLINE
#endif
#endif
#endif
// Includes
#include "d3d9.h"
#include "d3dx9math.h"
#include "d3dx9core.h"
#include "d3dx9xof.h"
#include "d3dx9mesh.h"
#include "d3dx9shader.h"
#include "d3dx9effect.h"
#include "d3dx9tex.h"
#include "d3dx9shape.h"
#include "d3dx9anim.h"
// Errors
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
enum _D3DXERR {
D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901),
D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902),
D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903),
D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904),
D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905),
D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906),
D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907),
D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908),
};
#endif //__D3DX9_H__
+1114
View File
File diff suppressed because it is too large Load Diff
+753
View File
@@ -0,0 +1,753 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9core.h
// Content: D3DX core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#ifndef __D3DX9CORE_H__
#define __D3DX9CORE_H__
///////////////////////////////////////////////////////////////////////////
// D3DX_SDK_VERSION:
// -----------------
// This identifier is passed to D3DXCheckVersion 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,
// D3DXCheckVersion will return FALSE. (The number itself has no meaning.)
///////////////////////////////////////////////////////////////////////////
#define D3DX_VERSION 0x0902
#define D3DX_SDK_VERSION 43
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
BOOL WINAPI
D3DXCheckVersion(UINT D3DSdkVersion, UINT D3DXSdkVersion);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3DXDebugMute
// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute)
//
// returns previous mute value
//
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
BOOL WINAPI
D3DXDebugMute(BOOL Mute);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3DXGetDriverLevel:
// Returns driver version information:
//
// 700 - DX7 level driver
// 800 - DX8 level driver
// 900 - DX9 level driver
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
UINT WINAPI
D3DXGetDriverLevel(LPDIRECT3DDEVICE9 pDevice);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXBuffer:
// ------------
// The buffer object is used by D3DX to return arbitrary size data.
//
// GetBufferPointer -
// Returns a pointer to the beginning of the buffer.
//
// GetBufferSize -
// Returns the size of the buffer, in bytes.
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXBuffer ID3DXBuffer;
typedef interface ID3DXBuffer *LPD3DXBUFFER;
// {8BA5FB08-5195-40e2-AC58-0D989C3A0102}
DEFINE_GUID(IID_ID3DXBuffer,
0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
#undef INTERFACE
#define INTERFACE ID3DXBuffer
DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBuffer
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// D3DXSPRITE flags:
// -----------------
// D3DXSPRITE_DONOTSAVESTATE
// Specifies device state is not to be saved and restored in Begin/End.
// D3DXSPRITE_DONOTMODIFY_RENDERSTATE
// Specifies device render state is not to be changed in Begin. The device
// is assumed to be in a valid state to draw vertices containing POSITION0,
// TEXCOORD0, and COLOR0 data.
// D3DXSPRITE_OBJECTSPACE
// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The
// transforms currently set to the device are used to transform the sprites
// when the batch is drawn (at Flush or End). If this is not specified,
// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are
// drawn in screenspace coordinates.
// D3DXSPRITE_BILLBOARD
// Rotates each sprite about its center so that it is facing the viewer.
// D3DXSPRITE_ALPHABLEND
// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0).
// ID3DXFont expects this to be set when drawing text.
// D3DXSPRITE_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 ID3DXFont.
// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK
// Sprites are sorted by depth front-to-back prior to drawing. This is
// recommended when drawing opaque sprites of varying depths.
// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT
// Sprites are sorted by depth back-to-front prior to drawing. This is
// recommended when drawing transparent sprites of varying depths.
// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE
// Disables calling AddRef() on every draw, and Release() on Flush() for
// better performance.
//////////////////////////////////////////////////////////////////////////////
#define D3DXSPRITE_DONOTSAVESTATE (1 << 0)
#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE (1 << 1)
#define D3DXSPRITE_OBJECTSPACE (1 << 2)
#define D3DXSPRITE_BILLBOARD (1 << 3)
#define D3DXSPRITE_ALPHABLEND (1 << 4)
#define D3DXSPRITE_SORT_TEXTURE (1 << 5)
#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6)
#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7)
#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8)
//////////////////////////////////////////////////////////////////////////////
// ID3DXSprite:
// ------------
// This object intends to provide an easy way to drawing sprites using D3D.
//
// Begin -
// Prepares device for drawing sprites.
//
// Draw -
// Draws a sprite. Before transformation, the sprite is the size of
// SrcRect, with its top-left corner specified by Position. The color
// and alpha channels are modulated by Color.
//
// Flush -
// Forces all batched sprites to submitted to the device.
//
// End -
// Restores device state to how it was when Begin was called.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXSprite ID3DXSprite;
typedef interface ID3DXSprite *LPD3DXSPRITE;
// {BA0B762D-7D28-43ec-B9DC-2F84443B0614}
DEFINE_GUID(IID_ID3DXSprite,
0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
#undef INTERFACE
#define INTERFACE ID3DXSprite
DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXSprite
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *pTransform) PURE;
STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *pTransform) PURE;
STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE;
STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE;
STDMETHOD(Begin)(THIS_ DWORD Flags) PURE;
STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) PURE;
STDMETHOD(Flush)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateSprite(
LPDIRECT3DDEVICE9 pDevice,
LPD3DXSPRITE* ppSprite);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// ID3DXFont:
// ----------
// 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.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
//////////////////////////////////////////////////////////////////////////////
typedef struct _D3DXFONT_DESCA
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
CHAR FaceName[LF_FACESIZE];
} D3DXFONT_DESCA, *LPD3DXFONT_DESCA;
typedef struct _D3DXFONT_DESCW
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
WCHAR FaceName[LF_FACESIZE];
} D3DXFONT_DESCW, *LPD3DXFONT_DESCW;
#ifdef UNICODE
typedef D3DXFONT_DESCW D3DXFONT_DESC;
typedef LPD3DXFONT_DESCW LPD3DXFONT_DESC;
#else
typedef D3DXFONT_DESCA D3DXFONT_DESC;
typedef LPD3DXFONT_DESCA LPD3DXFONT_DESC;
#endif
typedef interface ID3DXFont ID3DXFont;
typedef interface ID3DXFont *LPD3DXFONT;
// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
DEFINE_GUID(IID_ID3DXFont,
0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
#undef INTERFACE
#define INTERFACE ID3DXFont
DECLARE_INTERFACE_(ID3DXFont, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXFont
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE;
STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE;
STDMETHOD(GetDescW)(THIS_ D3DXFONT_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, LPDIRECT3DTEXTURE9 *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_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
#ifdef __cplusplus
#ifdef UNICODE
HRESULT GetDesc(D3DXFONT_DESCW *pDesc) { return GetDescW(pDesc); }
HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
#else
HRESULT GetDesc(D3DXFONT_DESCA *pDesc) { return GetDescA(pDesc); }
HRESULT 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
D3DXCreateFontA(
LPDIRECT3DDEVICE9 pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
DWORD CharSet,
DWORD OutputPrecision,
DWORD Quality,
DWORD PitchAndFamily,
LPCSTR pFaceName,
LPD3DXFONT* ppFont);
HRESULT WINAPI
D3DXCreateFontW(
LPDIRECT3DDEVICE9 pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
DWORD CharSet,
DWORD OutputPrecision,
DWORD Quality,
DWORD PitchAndFamily,
LPCWSTR pFaceName,
LPD3DXFONT* ppFont);
#ifdef UNICODE
#define D3DXCreateFont D3DXCreateFontW
#else
#define D3DXCreateFont D3DXCreateFontA
#endif
HRESULT WINAPI
D3DXCreateFontIndirectA(
LPDIRECT3DDEVICE9 pDevice,
CONST D3DXFONT_DESCA* pDesc,
LPD3DXFONT* ppFont);
HRESULT WINAPI
D3DXCreateFontIndirectW(
LPDIRECT3DDEVICE9 pDevice,
CONST D3DXFONT_DESCW* pDesc,
LPD3DXFONT* ppFont);
#ifdef UNICODE
#define D3DXCreateFontIndirect D3DXCreateFontIndirectW
#else
#define D3DXCreateFontIndirect D3DXCreateFontIndirectA
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXRenderToSurface:
// ---------------------
// This object abstracts rendering to surfaces. These surfaces do not
// necessarily need to be render targets. If they are not, a compatible
// render target is used, and the result copied into surface at end scene.
//
// BeginScene, EndScene -
// Call BeginScene() and EndScene() at the beginning and ending of your
// scene. These calls will setup and restore render targets, viewports,
// etc..
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTS_DESC
{
UINT Width;
UINT Height;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTS_DESC, *LPD3DXRTS_DESC;
typedef interface ID3DXRenderToSurface ID3DXRenderToSurface;
typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
// {6985F346-2C3D-43b3-BE8B-DAAE8A03D894}
DEFINE_GUID(IID_ID3DXRenderToSurface,
0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94);
#undef INTERFACE
#define INTERFACE ID3DXRenderToSurface
DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToSurface
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE;
STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE;
STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToSurface(
LPDIRECT3DDEVICE9 pDevice,
UINT Width,
UINT Height,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRENDERTOSURFACE* ppRenderToSurface);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXRenderToEnvMap:
// --------------------
// This object abstracts rendering to environment maps. These surfaces
// do not necessarily need to be render targets. If they are not, a
// compatible render target is used, and the result copied into the
// environment map at end scene.
//
// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic -
// This function initiates the rendering of the environment map. As
// parameters, you pass the textures in which will get filled in with
// the resulting environment map.
//
// Face -
// Call this function to initiate the drawing of each face. For each
// environment map, you will call this six times.. once for each face
// in D3DCUBEMAP_FACES.
//
// End -
// This will restore all render targets, and if needed compose all the
// rendered faces into the environment map surfaces.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTE_DESC
{
UINT Size;
UINT MipLevels;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTE_DESC, *LPD3DXRTE_DESC;
typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap;
typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
// {313F1B4B-C7B0-4fa2-9D9D-8D380B64385E}
DEFINE_GUID(IID_ID3DXRenderToEnvMap,
0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e);
#undef INTERFACE
#define INTERFACE ID3DXRenderToEnvMap
DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToEnvMap
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE;
STDMETHOD(BeginCube)(THIS_
LPDIRECT3DCUBETEXTURE9 pCubeTex) PURE;
STDMETHOD(BeginSphere)(THIS_
LPDIRECT3DTEXTURE9 pTex) PURE;
STDMETHOD(BeginHemisphere)(THIS_
LPDIRECT3DTEXTURE9 pTexZPos,
LPDIRECT3DTEXTURE9 pTexZNeg) PURE;
STDMETHOD(BeginParabolic)(THIS_
LPDIRECT3DTEXTURE9 pTexZPos,
LPDIRECT3DTEXTURE9 pTexZNeg) PURE;
STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face, DWORD MipFilter) PURE;
STDMETHOD(End)(THIS_ DWORD MipFilter) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToEnvMap(
LPDIRECT3DDEVICE9 pDevice,
UINT Size,
UINT MipLevels,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRenderToEnvMap* ppRenderToEnvMap);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXLine:
// ------------
// This object intends to provide an easy way to draw lines using D3D.
//
// Begin -
// Prepares device for drawing lines
//
// Draw -
// Draws a line strip in screen-space.
// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2
//
// DrawTransform -
// Draws a line in screen-space with a specified input transformation matrix.
//
// End -
// Restores device state to how it was when Begin was called.
//
// SetPattern -
// Applies a stipple pattern to the line. Input is one 32-bit
// DWORD which describes the stipple pattern. 1 is opaque, 0 is
// transparent.
//
// SetPatternScale -
// Stretches the stipple pattern in the u direction. Input is one
// floating-point value. 0.0f is no scaling, whereas 1.0f doubles
// the length of the stipple pattern.
//
// SetWidth -
// Specifies the thickness of the line in the v direction. Input is
// one floating-point value.
//
// SetAntialias -
// Toggles line antialiasing. Input is a BOOL.
// TRUE = Antialiasing on.
// FALSE = Antialiasing off.
//
// SetGLLines -
// Toggles non-antialiased OpenGL line emulation. Input is a BOOL.
// TRUE = OpenGL line emulation on.
// FALSE = OpenGL line emulation off.
//
// OpenGL line: Regular line:
// *\ *\
// | \ / \
// | \ *\ \
// *\ \ \ \
// \ \ \ \
// \ * \ *
// \ | \ /
// \| *
// *
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXLine ID3DXLine;
typedef interface ID3DXLine *LPD3DXLINE;
// {D379BA7F-9042-4ac4-9F5E-58192A4C6BD8}
DEFINE_GUID(IID_ID3DXLine,
0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8);
#undef INTERFACE
#define INTERFACE ID3DXLine
DECLARE_INTERFACE_(ID3DXLine, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXLine
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList,
DWORD dwVertexListCount, D3DCOLOR Color) PURE;
STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList,
DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform,
D3DCOLOR Color) PURE;
STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE;
STDMETHOD_(DWORD, GetPattern)(THIS) PURE;
STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE;
STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE;
STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE;
STDMETHOD_(FLOAT, GetWidth)(THIS) PURE;
STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE;
STDMETHOD_(BOOL, GetAntialias)(THIS) PURE;
STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE;
STDMETHOD_(BOOL, GetGLLines)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateLine(
LPDIRECT3DDEVICE9 pDevice,
LPD3DXLINE* ppLine);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX9CORE_H__
+873
View File
@@ -0,0 +1,873 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: d3dx9effect.h
// Content: D3DX effect types and Shaders
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#ifndef __D3DX9EFFECT_H__
#define __D3DX9EFFECT_H__
//----------------------------------------------------------------------------
// D3DXFX_DONOTSAVESTATE
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
// is specified, device state is not saved or restored in Begin/End.
// D3DXFX_DONOTSAVESHADERSTATE
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
// is specified, shader device state is not saved or restored in Begin/End.
// This includes pixel/vertex shaders and shader constants
// D3DXFX_DONOTSAVESAMPLERSTATE
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
// is specified, sampler device state is not saved or restored in Begin/End.
// D3DXFX_NOT_CLONEABLE
// This flag is used as a parameter to the D3DXCreateEffect family of APIs.
// When this flag is specified, the effect will be non-cloneable and will not
// contain any shader binary data.
// Furthermore, GetPassDesc will not return shader function pointers.
// Setting this flag reduces effect memory usage by about 50%.
//----------------------------------------------------------------------------
#define D3DXFX_DONOTSAVESTATE (1 << 0)
#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1)
#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2)
#define D3DXFX_NOT_CLONEABLE (1 << 11)
#define D3DXFX_LARGEADDRESSAWARE (1 << 17)
//----------------------------------------------------------------------------
// D3DX_PARAMETER_SHARED
// Indicates that the value of a parameter will be shared with all effects
// which share the same namespace. Changing the value in one effect will
// change it in all.
//
// D3DX_PARAMETER_LITERAL
// Indicates that the value of this parameter can be treated as literal.
// Literal parameters can be marked when the effect is compiled, and their
// cannot be changed after the effect is compiled. Shared parameters cannot
// be literal.
//----------------------------------------------------------------------------
#define D3DX_PARAMETER_SHARED (1 << 0)
#define D3DX_PARAMETER_LITERAL (1 << 1)
#define D3DX_PARAMETER_ANNOTATION (1 << 2)
//----------------------------------------------------------------------------
// D3DXEFFECT_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXEFFECT_DESC
{
LPCSTR Creator; // Creator string
UINT Parameters; // Number of parameters
UINT Techniques; // Number of techniques
UINT Functions; // Number of function entrypoints
} D3DXEFFECT_DESC;
//----------------------------------------------------------------------------
// D3DXPARAMETER_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXPARAMETER_DESC
{
LPCSTR Name; // Parameter name
LPCSTR Semantic; // Parameter semantic
D3DXPARAMETER_CLASS Class; // Class
D3DXPARAMETER_TYPE Type; // Component type
UINT Rows; // Number of rows
UINT Columns; // Number of columns
UINT Elements; // Number of array elements
UINT Annotations; // Number of annotations
UINT StructMembers; // Number of structure member sub-parameters
DWORD Flags; // D3DX_PARAMETER_* flags
UINT Bytes; // Parameter size, in bytes
} D3DXPARAMETER_DESC;
//----------------------------------------------------------------------------
// D3DXTECHNIQUE_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXTECHNIQUE_DESC
{
LPCSTR Name; // Technique name
UINT Passes; // Number of passes
UINT Annotations; // Number of annotations
} D3DXTECHNIQUE_DESC;
//----------------------------------------------------------------------------
// D3DXPASS_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXPASS_DESC
{
LPCSTR Name; // Pass name
UINT Annotations; // Number of annotations
CONST DWORD *pVertexShaderFunction; // Vertex shader function
CONST DWORD *pPixelShaderFunction; // Pixel shader function
} D3DXPASS_DESC;
//----------------------------------------------------------------------------
// D3DXFUNCTION_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXFUNCTION_DESC
{
LPCSTR Name; // Function name
UINT Annotations; // Number of annotations
} D3DXFUNCTION_DESC;
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffectPool ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffectPool ID3DXEffectPool;
typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL;
// {9537AB04-3250-412e-8213-FCD2F8677933}
DEFINE_GUID(IID_ID3DXEffectPool,
0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
#undef INTERFACE
#define INTERFACE ID3DXEffectPool
DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// No public methods
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXBaseEffect ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXBaseEffect ID3DXBaseEffect;
typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT;
// {017C18AC-103F-4417-8C51-6BF6EF1E56BE}
DEFINE_GUID(IID_ID3DXBaseEffect,
0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe);
#undef INTERFACE
#define INTERFACE ID3DXBaseEffect
DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Descs
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
// Handle operations
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
// Get/Set Parameters
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
//Set Range of an Array to pass to device
//Useful for sending only a subrange of an array down to the device
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
};
//----------------------------------------------------------------------------
// ID3DXEffectStateManager:
// ------------------------
// This is a user implemented interface that can be used to manage device
// state changes made by an Effect.
//----------------------------------------------------------------------------
typedef interface ID3DXEffectStateManager ID3DXEffectStateManager;
typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER;
// {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE}
DEFINE_GUID(IID_ID3DXEffectStateManager,
0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce);
#undef INTERFACE
#define INTERFACE ID3DXEffectStateManager
DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
{
// The user must correctly implement QueryInterface, AddRef, and Release.
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// The following methods are called by the Effect when it wants to make
// the corresponding device call. Note that:
// 1. Users manage the state and are therefore responsible for making the
// the corresponding device calls themselves inside their callbacks.
// 2. Effects pay attention to the return values of the callbacks, and so
// users must pay attention to what they return in their callbacks.
STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE;
STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE;
STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE;
STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE;
STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE;
STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE;
STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE;
STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE;
STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE;
STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffect ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffect ID3DXEffect;
typedef interface ID3DXEffect *LPD3DXEFFECT;
// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5}
DEFINE_GUID(IID_ID3DXEffect,
0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
#undef INTERFACE
#define INTERFACE ID3DXEffect
DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
{
// ID3DXBaseEffect
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Descs
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
// Handle operations
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
// Get/Set Parameters
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
//Set Range of an Array to pass to device
//Usefull for sending only a subrange of an array down to the device
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
// ID3DXBaseEffect
// Pool
STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE;
// Selecting and setting a technique
STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE;
STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE;
STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE;
// Using current technique
// Begin starts active technique
// BeginPass begins a pass
// CommitChanges updates changes to any set calls in the pass. This should be called before
// any DrawPrimitive call to d3d
// EndPass ends a pass
// End ends active technique
STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE;
STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE;
STDMETHOD(CommitChanges)(THIS) PURE;
STDMETHOD(EndPass)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
// Managing D3D Device
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
// Logging device calls
STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE;
STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE;
// Parameter blocks
STDMETHOD(BeginParameterBlock)(THIS) PURE;
STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
// Cloning
STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE;
// Fast path for setting variables directly in ID3DXEffect
STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffectCompiler ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffectCompiler ID3DXEffectCompiler;
typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;
// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0}
DEFINE_GUID(IID_ID3DXEffectCompiler,
0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0);
#undef INTERFACE
#define INTERFACE ID3DXEffectCompiler
DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
{
// ID3DXBaseEffect
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Descs
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
// Handle operations
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
// Get/Set Parameters
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
//Set Range of an Array to pass to device
//Usefull for sending only a subrange of an array down to the device
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
// ID3DXBaseEffect
// Parameter sharing, specialization, and information
STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE;
STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE;
// Compilation
STDMETHOD(CompileEffect)(THIS_ DWORD Flags,
LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE;
STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags,
LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DXCreateEffectPool:
// ---------------------
// Creates an effect pool. Pools are used for sharing parameters between
// multiple effects. For all effects within a pool, shared parameters of the
// same name all share the same value.
//
// Parameters:
// ppPool
// Returns the created pool.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectPool(
LPD3DXEFFECTPOOL* ppPool);
//----------------------------------------------------------------------------
// D3DXCreateEffect:
// -----------------
// Creates an effect from an ascii or binary effect description.
//
// Parameters:
// pDevice
// Pointer of the device on which to create the effect
// pSrcFile
// Name of the file containing the effect description
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to effect description
// SrcDataSize
// Size of the effect description in bytes
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// Flags
// See D3DXSHADER_xxx flags.
// pSkipConstants
// A list of semi-colon delimited variable names. The effect will
// not set these variables to the device when they are referenced
// by a shader. NOTE: the variables specified here must be
// register bound in the file and must not be used in expressions
// in passes or samplers or the file will not load.
// 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.
// pPool
// Pointer to ID3DXEffectPool object to use for shared parameters.
// If NULL, no parameters will be shared.
// ppEffect
// Returns a buffer containing created effect.
// ppCompilationErrors
// Returns a buffer containing any error messages which occurred during
// compile. Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectFromFileA(
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromFileW(
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW
#else
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA
#endif
HRESULT WINAPI
D3DXCreateEffectFromResourceA(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromResourceW(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW
#else
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA
#endif
HRESULT WINAPI
D3DXCreateEffect(
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataLen,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
//
// Ex functions that accept pSkipConstants in addition to other parameters
//
HRESULT WINAPI
D3DXCreateEffectFromFileExA(
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromFileExW(
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW
#else
#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA
#endif
HRESULT WINAPI
D3DXCreateEffectFromResourceExA(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromResourceExW(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW
#else
#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA
#endif
HRESULT WINAPI
D3DXCreateEffectEx(
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataLen,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
//----------------------------------------------------------------------------
// D3DXCreateEffectCompiler:
// -------------------------
// Creates an effect from an ascii or binary effect description.
//
// Parameters:
// pSrcFile
// Name of the file containing the effect description
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to effect description
// SrcDataSize
// Size of the effect description 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.
// pPool
// Pointer to ID3DXEffectPool object to use for shared parameters.
// If NULL, no parameters will be shared.
// ppCompiler
// Returns a buffer containing created effect compiler.
// ppParseErrors
// Returns a buffer containing any error messages which occurred during
// parse. Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectCompilerFromFileA(
LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
HRESULT WINAPI
D3DXCreateEffectCompilerFromFileW(
LPCWSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
#ifdef UNICODE
#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW
#else
#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA
#endif
HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
#ifdef UNICODE
#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW
#else
#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA
#endif
HRESULT WINAPI
D3DXCreateEffectCompiler(
LPCSTR pSrcData,
UINT SrcDataLen,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
//----------------------------------------------------------------------------
// D3DXDisassembleEffect:
// -----------------------
//
// Parameters:
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXDisassembleEffect(
LPD3DXEFFECT pEffect,
BOOL EnableColorCode,
LPD3DXBUFFER *ppDisassembly);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX9EFFECT_H__
+1796
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3007
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+221
View File
@@ -0,0 +1,221 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9shapes.h
// Content: D3DX simple shapes
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#ifndef __D3DX9SHAPES_H__
#define __D3DX9SHAPES_H__
///////////////////////////////////////////////////////////////////////////
// Functions:
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// D3DXCreatePolygon:
// ------------------
// Creates a mesh containing an n-sided polygon. The polygon is centered
// at the origin.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Length Length of each side.
// Sides Number of sides the polygon has. (Must be >= 3)
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreatePolygon(
LPDIRECT3DDEVICE9 pDevice,
FLOAT Length,
UINT Sides,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateBox:
// --------------
// Creates a mesh containing an axis-aligned box. The box is centered at
// the origin.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Width Width of box (along X-axis)
// Height Height of box (along Y-axis)
// Depth Depth of box (along Z-axis)
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateBox(
LPDIRECT3DDEVICE9 pDevice,
FLOAT Width,
FLOAT Height,
FLOAT Depth,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateCylinder:
// -------------------
// Creates a mesh containing a cylinder. The generated cylinder is
// centered at the origin, and its axis is aligned with the Z-axis.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Radius1 Radius at -Z end (should be >= 0.0f)
// Radius2 Radius at +Z end (should be >= 0.0f)
// Length Length of cylinder (along Z-axis)
// Slices Number of slices about the main axis
// Stacks Number of stacks along the main axis
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateCylinder(
LPDIRECT3DDEVICE9 pDevice,
FLOAT Radius1,
FLOAT Radius2,
FLOAT Length,
UINT Slices,
UINT Stacks,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateSphere:
// -----------------
// Creates a mesh containing a sphere. The sphere is centered at the
// origin.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Radius Radius of the sphere (should be >= 0.0f)
// Slices Number of slices about the main axis
// Stacks Number of stacks along the main axis
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateSphere(
LPDIRECT3DDEVICE9 pDevice,
FLOAT Radius,
UINT Slices,
UINT Stacks,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateTorus:
// ----------------
// Creates a mesh containing a torus. The generated torus is centered at
// the origin, and its axis is aligned with the Z-axis.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// InnerRadius Inner radius of the torus (should be >= 0.0f)
// OuterRadius Outer radius of the torue (should be >= 0.0f)
// Sides Number of sides in a cross-section (must be >= 3)
// Rings Number of rings making up the torus (must be >= 3)
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTorus(
LPDIRECT3DDEVICE9 pDevice,
FLOAT InnerRadius,
FLOAT OuterRadius,
UINT Sides,
UINT Rings,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateTeapot:
// -----------------
// Creates a mesh containing a teapot.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTeapot(
LPDIRECT3DDEVICE9 pDevice,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateText:
// ---------------
// Creates a mesh containing the specified text using the font associated
// with the device context.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// hDC Device context, with desired font selected
// pText Text to generate
// Deviation Maximum chordal deviation from true font outlines
// Extrusion Amount to extrude text in -Z direction
// ppMesh The mesh object which will be created
// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL)
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTextA(
LPDIRECT3DDEVICE9 pDevice,
HDC hDC,
LPCSTR pText,
FLOAT Deviation,
FLOAT Extrusion,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency,
LPGLYPHMETRICSFLOAT pGlyphMetrics);
HRESULT WINAPI
D3DXCreateTextW(
LPDIRECT3DDEVICE9 pDevice,
HDC hDC,
LPCWSTR pText,
FLOAT Deviation,
FLOAT Extrusion,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency,
LPGLYPHMETRICSFLOAT pGlyphMetrics);
#ifdef UNICODE
#define D3DXCreateText D3DXCreateTextW
#else
#define D3DXCreateText D3DXCreateTextA
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX9SHAPES_H__
+1735
View File
File diff suppressed because it is too large Load Diff
+299
View File
@@ -0,0 +1,299 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9xof.h
// Content: D3DX .X File types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#if !defined( __D3DX9XOF_H__ )
#define __D3DX9XOF_H__
#if defined( __cplusplus )
extern "C" {
#endif // defined( __cplusplus )
//----------------------------------------------------------------------------
// D3DXF_FILEFORMAT
// This flag is used to specify what file type to use when saving to disk.
// _BINARY, and _TEXT are mutually exclusive, while
// _COMPRESSED is an optional setting that works with all file types.
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILEFORMAT;
#define D3DXF_FILEFORMAT_BINARY 0
#define D3DXF_FILEFORMAT_TEXT 1
#define D3DXF_FILEFORMAT_COMPRESSED 2
//----------------------------------------------------------------------------
// D3DXF_FILESAVEOPTIONS
// This flag is used to specify where to save the file to. Each flag is
// mutually exclusive, indicates the data location of the file, and also
// chooses which additional data will specify the location.
// _TOFILE is paired with a filename (LPCSTR)
// _TOWFILE is paired with a filename (LPWSTR)
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILESAVEOPTIONS;
#define D3DXF_FILESAVE_TOFILE 0x00L
#define D3DXF_FILESAVE_TOWFILE 0x01L
//----------------------------------------------------------------------------
// D3DXF_FILELOADOPTIONS
// This flag is used to specify where to load the file from. Each flag is
// mutually exclusive, indicates the data location of the file, and also
// chooses which additional data will specify the location.
// _FROMFILE is paired with a filename (LPCSTR)
// _FROMWFILE is paired with a filename (LPWSTR)
// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description.
// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description.
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILELOADOPTIONS;
#define D3DXF_FILELOAD_FROMFILE 0x00L
#define D3DXF_FILELOAD_FROMWFILE 0x01L
#define D3DXF_FILELOAD_FROMRESOURCE 0x02L
#define D3DXF_FILELOAD_FROMMEMORY 0x03L
//----------------------------------------------------------------------------
// D3DXF_FILELOADRESOURCE:
//----------------------------------------------------------------------------
typedef struct _D3DXF_FILELOADRESOURCE
{
HMODULE hModule; // Desc
LPCSTR lpName; // Desc
LPCSTR lpType; // Desc
} D3DXF_FILELOADRESOURCE;
//----------------------------------------------------------------------------
// D3DXF_FILELOADMEMORY:
//----------------------------------------------------------------------------
typedef struct _D3DXF_FILELOADMEMORY
{
LPCVOID lpMemory; // Desc
SIZE_T dSize; // Desc
} D3DXF_FILELOADMEMORY;
#if defined( _WIN32 ) && !defined( _NO_COM )
// {cef08cf9-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFile,
0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfa-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileSaveObject,
0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfb-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileSaveData,
0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfc-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileEnumObject,
0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfd-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileData,
0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
#endif // defined( _WIN32 ) && !defined( _NO_COM )
#if defined( __cplusplus )
#if !defined( DECLSPEC_UUID )
#if _MSC_VER >= 1100
#define DECLSPEC_UUID( x ) __declspec( uuid( x ) )
#else // !( _MSC_VER >= 1100 )
#define DECLSPEC_UUID( x )
#endif // !( _MSC_VER >= 1100 )
#endif // !defined( DECLSPEC_UUID )
interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" )
ID3DXFile;
interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" )
ID3DXFileSaveObject;
interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" )
ID3DXFileSaveData;
interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" )
ID3DXFileEnumObject;
interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" )
ID3DXFileData;
#if defined( _COM_SMARTPTR_TYPEDEF )
_COM_SMARTPTR_TYPEDEF( ID3DXFile,
__uuidof( ID3DXFile ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject,
__uuidof( ID3DXFileSaveObject ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData,
__uuidof( ID3DXFileSaveData ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject,
__uuidof( ID3DXFileEnumObject ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileData,
__uuidof( ID3DXFileData ) );
#endif // defined( _COM_SMARTPTR_TYPEDEF )
#endif // defined( __cplusplus )
typedef interface ID3DXFile ID3DXFile;
typedef interface ID3DXFileSaveObject ID3DXFileSaveObject;
typedef interface ID3DXFileSaveData ID3DXFileSaveData;
typedef interface ID3DXFileEnumObject ID3DXFileEnumObject;
typedef interface ID3DXFileData ID3DXFileData;
//////////////////////////////////////////////////////////////////////////////
// ID3DXFile /////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFile
DECLARE_INTERFACE_( ID3DXFile, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS,
ID3DXFileEnumObject** ) PURE;
STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS,
D3DXF_FILEFORMAT, ID3DXFileSaveObject** ) PURE;
STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE;
STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileSaveObject ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileSaveObject
DECLARE_INTERFACE_( ID3DXFileSaveObject, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
STDMETHOD( Save )( THIS ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileSaveData /////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileSaveData
DECLARE_INTERFACE_( ID3DXFileSaveData, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE;
STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
STDMETHOD( GetType )( THIS_ GUID* ) PURE;
STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileEnumObject ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileEnumObject
DECLARE_INTERFACE_( ID3DXFileEnumObject, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE;
STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileData /////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileData
DECLARE_INTERFACE_( ID3DXFileData, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE;
STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE;
STDMETHOD( Unlock )( THIS ) PURE;
STDMETHOD( GetType )( THIS_ GUID* ) PURE;
STDMETHOD_( BOOL, IsReference )( THIS ) PURE;
STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
};
STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile );
/*
* DirectX File errors.
*/
#define _FACD3DXF 0x876
#define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 )
#define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 )
#define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 )
#define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 )
#define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 )
#define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 )
#define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 )
#define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 )
#define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 )
#define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 )
#define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 )
#define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 )
#define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 )
#define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 )
#define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 )
#define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 )
#define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 )
#define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 )
/*
* DirectX File object types.
*/
#ifndef WIN_TYPES
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
#endif
WIN_TYPES(ID3DXFile, D3DXFILE);
WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT);
WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT);
WIN_TYPES(ID3DXFileData, D3DXFILEDATA);
WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA);
#if defined( __cplusplus )
} // extern "C"
#endif // defined( __cplusplus )
#endif // !defined( __D3DX9XOF_H__ )
+800
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
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 */
+2268
View File
File diff suppressed because it is too large Load Diff
+237
View File
@@ -0,0 +1,237 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* 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 __dcompanimation_h__
#define __dcompanimation_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IDCompositionAnimation_FWD_DEFINED__
#define __IDCompositionAnimation_FWD_DEFINED__
typedef interface IDCompositionAnimation IDCompositionAnimation;
#endif /* __IDCompositionAnimation_FWD_DEFINED__ */
/* header files for imported files */
#include "wtypes.h"
#include "unknwn.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_dcompanimation_0000_0000 */
/* [local] */
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
extern RPC_IF_HANDLE __MIDL_itf_dcompanimation_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dcompanimation_0000_0000_v0_0_s_ifspec;
#ifndef __IDCompositionAnimation_INTERFACE_DEFINED__
#define __IDCompositionAnimation_INTERFACE_DEFINED__
/* interface IDCompositionAnimation */
/* [unique][helpstring][uuid][object][local] */
EXTERN_C const IID IID_IDCompositionAnimation;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("CBFD91D9-51B2-45e4-B3DE-D19CCFB863C5")
IDCompositionAnimation : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAbsoluteBeginTime(
LARGE_INTEGER beginTime) = 0;
virtual HRESULT STDMETHODCALLTYPE AddCubic(
double beginOffset,
float constantCoefficient,
float linearCoefficient,
float quadraticCoefficient,
float cubicCoefficient) = 0;
virtual HRESULT STDMETHODCALLTYPE AddSinusoidal(
double beginOffset,
float bias,
float amplitude,
float frequency,
float phase) = 0;
virtual HRESULT STDMETHODCALLTYPE AddRepeat(
double beginOffset,
double durationToRepeat) = 0;
virtual HRESULT STDMETHODCALLTYPE End(
double endOffset,
float endValue) = 0;
};
#else /* C style interface */
typedef struct IDCompositionAnimationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDCompositionAnimation * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDCompositionAnimation * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDCompositionAnimation * This);
HRESULT ( STDMETHODCALLTYPE *Reset )(
IDCompositionAnimation * This);
HRESULT ( STDMETHODCALLTYPE *SetAbsoluteBeginTime )(
IDCompositionAnimation * This,
LARGE_INTEGER beginTime);
HRESULT ( STDMETHODCALLTYPE *AddCubic )(
IDCompositionAnimation * This,
double beginOffset,
float constantCoefficient,
float linearCoefficient,
float quadraticCoefficient,
float cubicCoefficient);
HRESULT ( STDMETHODCALLTYPE *AddSinusoidal )(
IDCompositionAnimation * This,
double beginOffset,
float bias,
float amplitude,
float frequency,
float phase);
HRESULT ( STDMETHODCALLTYPE *AddRepeat )(
IDCompositionAnimation * This,
double beginOffset,
double durationToRepeat);
HRESULT ( STDMETHODCALLTYPE *End )(
IDCompositionAnimation * This,
double endOffset,
float endValue);
END_INTERFACE
} IDCompositionAnimationVtbl;
interface IDCompositionAnimation
{
CONST_VTBL struct IDCompositionAnimationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDCompositionAnimation_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDCompositionAnimation_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDCompositionAnimation_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDCompositionAnimation_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IDCompositionAnimation_SetAbsoluteBeginTime(This,beginTime) \
( (This)->lpVtbl -> SetAbsoluteBeginTime(This,beginTime) )
#define IDCompositionAnimation_AddCubic(This,beginOffset,constantCoefficient,linearCoefficient,quadraticCoefficient,cubicCoefficient) \
( (This)->lpVtbl -> AddCubic(This,beginOffset,constantCoefficient,linearCoefficient,quadraticCoefficient,cubicCoefficient) )
#define IDCompositionAnimation_AddSinusoidal(This,beginOffset,bias,amplitude,frequency,phase) \
( (This)->lpVtbl -> AddSinusoidal(This,beginOffset,bias,amplitude,frequency,phase) )
#define IDCompositionAnimation_AddRepeat(This,beginOffset,durationToRepeat) \
( (This)->lpVtbl -> AddRepeat(This,beginOffset,durationToRepeat) )
#define IDCompositionAnimation_End(This,endOffset,endValue) \
( (This)->lpVtbl -> End(This,endOffset,endValue) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDCompositionAnimation_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dcompanimation_0000_0001 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_dcompanimation_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dcompanimation_0000_0001_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
+96
View File
@@ -0,0 +1,96 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
#pragma once
#include <dxgitype.h> // for DXGI_RATIONAL
#include <dxgi1_5.h> // for DXGI_ALPHA_MODE, DXGI_HDR_METADATA_TYPE
#if (NTDDI_VERSION >= NTDDI_WIN8)
//
// DirectComposition types
//
enum DCOMPOSITION_BITMAP_INTERPOLATION_MODE
{
DCOMPOSITION_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
DCOMPOSITION_BITMAP_INTERPOLATION_MODE_LINEAR = 1,
DCOMPOSITION_BITMAP_INTERPOLATION_MODE_INHERIT = 0xffffffff
};
enum DCOMPOSITION_BORDER_MODE
{
DCOMPOSITION_BORDER_MODE_SOFT = 0,
DCOMPOSITION_BORDER_MODE_HARD = 1,
DCOMPOSITION_BORDER_MODE_INHERIT = 0xffffffff
};
enum DCOMPOSITION_COMPOSITE_MODE
{
DCOMPOSITION_COMPOSITE_MODE_SOURCE_OVER = 0,
DCOMPOSITION_COMPOSITE_MODE_DESTINATION_INVERT = 1,
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
DCOMPOSITION_COMPOSITE_MODE_MIN_BLEND = 2,
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
DCOMPOSITION_COMPOSITE_MODE_INHERIT = 0xffffffff
};
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
enum DCOMPOSITION_BACKFACE_VISIBILITY
{
DCOMPOSITION_BACKFACE_VISIBILITY_VISIBLE = 0,
DCOMPOSITION_BACKFACE_VISIBILITY_HIDDEN = 1,
DCOMPOSITION_BACKFACE_VISIBILITY_INHERIT = 0xffffffff
};
enum DCOMPOSITION_OPACITY_MODE
{
DCOMPOSITION_OPACITY_MODE_LAYER = 0,
DCOMPOSITION_OPACITY_MODE_MULTIPLY = 1,
DCOMPOSITION_OPACITY_MODE_INHERIT = 0xffffffff
};
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
enum DCOMPOSITION_DEPTH_MODE
{
DCOMPOSITION_DEPTH_MODE_TREE = 0,
DCOMPOSITION_DEPTH_MODE_SPATIAL = 1,
DCOMPOSITION_DEPTH_MODE_SORTED = 3,
DCOMPOSITION_DEPTH_MODE_INHERIT = 0xffffffff
};
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
typedef struct
{
LARGE_INTEGER lastFrameTime;
DXGI_RATIONAL currentCompositionRate;
LARGE_INTEGER currentTime;
LARGE_INTEGER timeFrequency;
LARGE_INTEGER nextEstimatedFrameTime;
} DCOMPOSITION_FRAME_STATISTICS;
//
// Composition object specific access flags
//
#define COMPOSITIONOBJECT_READ 0x0001L
#define COMPOSITIONOBJECT_WRITE 0x0002L
#define COMPOSITIONOBJECT_ALL_ACCESS (COMPOSITIONOBJECT_READ | COMPOSITIONOBJECT_WRITE)
#endif // NTDDI_WIN8
+5862
View File
File diff suppressed because it is too large Load Diff
+5134
View File
File diff suppressed because it is too large Load Diff
+1926
View File
File diff suppressed because it is too large Load Diff
+975
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 */
+3632
View File
File diff suppressed because it is too large Load Diff
+2953
View File
File diff suppressed because it is too large Load Diff
+2466
View File
File diff suppressed because it is too large Load Diff
+2108
View File
File diff suppressed because it is too large Load Diff
+1489
View File
File diff suppressed because it is too large Load Diff
+1540
View File
File diff suppressed because it is too large Load Diff
+1511
View File
File diff suppressed because it is too large Load Diff
+56
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__
+986
View File
@@ -0,0 +1,986 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.01.0622 */
/* @@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__ 500
#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] */
#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] */
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
+137
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__
+111
View File
@@ -0,0 +1,111 @@
//
// 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)
// 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__
+1945
View File
File diff suppressed because it is too large Load Diff