Get data from the GPU asynchronously.
GetData retrieves the data collected between calls to
If DataSize is 0, GetData is only used to check status where a return value of
It is invalid to invoke this function on a predicate created with the flag D3D10_QUERY_MISCFLAG_PREDICATEHINT.
If the asynchronous interface that calls this function is
Query Type | Output Data Type | Supports Begin Method |
---|---|---|
NO | ||
UINT64 | YES | |
UINT64 | NO | |
YES | ||
YES | ||
YES | ||
YES | ||
YES |
?
If the asynchronous interface that calls this API is
Counter Type | Output Data Type | Units |
---|---|---|
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction | |
FLOAT32 | fraction |
?
The value returned by a
The number of parallel counters that a video card has is available from NumDetectableParallelUnits in
A device-child interface accesses data used by a device.
There are several types of device child interfaces, all of which inherit this interface. They include shaders, state objects, and input layouts.
Get a reference to the device that created this interface.
Address of a reference to a device (see
Any returned interfaces will have their reference count incremented by one, so be sure to call ::release() on the returned reference(s) before they are freed or else you will have a memory leak.
Get data from a device that is associated with a guid.
Guid associated with the data.
Size of the data.
Pointer to the data stored with the device. If pData is
This method returns one of the following Direct3D 10 Return Codes.
The data stored in the device is set with
The data retrieved and the guid will typically be application-defined.
This method can be used to get the device type by specifying GUID_DeviceType as the guid. In this case pData will point to a driver-type-enumeration value (see
Set application-defined data to a device child and associate that data with an application-defined guid.
Guid associated with the data.
Size of the data.
Pointer to the data to be stored with this device child. If pData is
This method returns one of the following Direct3D 10 Return Codes.
The data stored in the device child with this method can be retrieved with
Associate an
This method returns one of the following Direct3D 10 Return Codes.
When this method is called ::addref() will be called on the
Get a reference to the device that created this interface.
Any returned interfaces will have their reference count incremented by one, so be sure to call ::release() on the returned reference(s) before they are freed or else you will have a memory leak.
Starts the collection of GPU data.
Calling Begin starts the asynchronous collection of GPU data. Calling
Ends the collection of GPU data.
Calling
Get data from the GPU asynchronously.
Address of memory that will receive the data. If
Size of the data to retrieve or 0. This value can be obtained with
Optional flags. Can be 0 or any combination of the flags enumerated by
If this function succeeds, it returns
GetData retrieves the data collected between calls to
If DataSize is 0, GetData is only used to check status where a return value of
It is invalid to invoke this function on a predicate created with the flag D3D10_QUERY_MISCFLAG_PREDICATEHINT.
If the asynchronous interface that calls this function is
Query Type | Output Data Type | Supports Begin Method |
---|---|---|
NO | ||
UINT64 | YES | |
UINT64 | NO | |
YES | ||
YES | ||
YES | ||
YES | ||
YES |
?
If the asynchronous interface that calls this API is
Counter Type | Output Data Type | Units |
---|---|---|
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of theoretical maximum | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction of time | |
FLOAT32 | fraction | |
FLOAT32 | fraction |
?
The value returned by a
The number of parallel counters that a video card has is available from NumDetectableParallelUnits in
Get the size of the data (in bytes) that is output when calling
Size of the data (in bytes) that is output when calling GetData.
This blend-state interface accesses blending state for a Direct3D 10.0 device for the output-merger stage.
Blending combines two pixel values. You have control over how the pixels are blended by using a predefined set of blending operations, as well as preblending operations. The Blending Block Diagram shows conceptually how blending works.
To create a blend-state interface, call
Get the blend state.
A reference to the blend state (see
Get the blend state.
This blend-state interface accesses blending state for a Direct3D 10.1 device for the output-merger stage.
Blending combines two pixel values. You have control over how the pixels are blended by using a predefined set of blending operations, as well as preblending operations. The Blending Block Diagram shows conceptually how blending works.
To create a blend-state interface, call
This method requires Windows Vista Service Pack 1.
A buffer interface accesses a buffer resource, which is unstructured memory. Buffers typically store vertex or index data.
Three types of buffers can be created; vertex, index, and shader-constant buffers. To create a buffer resource, call
A buffer must be bound to the pipeline before it can be accessed. Buffers can be bound to the input-assembler stage by calls to
Buffers can be bound to multiple pipeline stages simultaneously for reading. A buffer can also be bound to a single pipeline stage for writing; however, the same buffer cannot be bound for reading and writing simultaneously. For more information, see binding resources.
A resource interface provides common actions on all resources.
A resource interface cannot be created directly; instead, buffers and textures are created that inherit from a resource interface (see Creating Buffer Resources or Creating Texture Resources).
Get the type of the resource.
Pointer to the resource type (see
Set the eviction priority of a resource.
Eviction priority for the resource, which is one of the following values:
Resource priorities determine which resource to evict from video memory when the system has run out of video memory. The resource will not be lost; it will be removed from video memory and placed into system memory, or possibly placed onto the hard drive. The resource will be loaded back into video memory when it is required.
A resource that is set to the maximum priority,
Changing the priorities of resources should be done carefully. The wrong eviction priorities could be a detriment to performance rather than an improvement. See QueryResourceResidency for additional information.
This method is a wrapper for SetEvictionPriority and is provided in the
Get the eviction priority of a resource.
One of the following values, which specifies the eviction priority for the resource:
This method is a wrapper for GetEvictionPriority and is provided in the
Get the type of the resource.
Get the eviction priority of a resource.
This method is a wrapper for GetEvictionPriority and is provided in the
Get a reference to the data contained in the resource and deny GPU access to the resource.
Flag that specifies the CPU's permissions for the reading and writing of a resource. For possible values, see
Flag that specifies what the CPU should do when the GPU is busy (see
Pointer to the buffer resource data.
If this function succeeds, it returns
For more information about the preceding return values, see DXGI_ERROR.
For the CPU to write the contents of a resource, the resource must be created with the dynamic usage flag,
Call
Differences between Direct3D 9 and Direct3D 10: |
?
Invalidate the reference to the resource retrieved by
Differences between Direct3D 9 and Direct3D 10: Unmap() in Direct3D 10 is analogous to resource Unlock() in Direct3D 9. |
?
Get the properties of a buffer resource.
Pointer to a resource description (see
Get the properties of a buffer resource.
Describes a buffer resource.
This structure is used by
In addition to this structure, there is also a derived structure in D3D10.h (CD3D10_BUFFER_DESC) which behaves like an inherited class to help create a buffer description.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Bind an input-layout object to the input-assembler stage.
Input-layout objects describe how vertex buffer data is streamed into the IA pipeline stage. To create an input-layout object, call
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of vertex buffers to the input-assembler stage.
For information about creating vertex buffers, see Create a Vertex Buffer.
Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind
The Debug Layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of vertex buffers to the input-assembler stage.
For information about creating vertex buffers, see Create a Vertex Buffer.
Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind
The Debug Layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an index buffer to the input-assembler stage.
For information about creating index buffers, see Create an Index Buffer.
Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind
The Debug Layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind information about the primitive type, and data order that describes input data for the input assembler stage.
Get a reference to the input-layout object that is bound to the input-assembler stage.
For information about creating an input-layout object, see Creating the Input-Layout Object.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the vertex buffers bound to the input-assembler stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get a reference to the index buffer that is bound to the input-assembler stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get information about the primitive type, and data order that describes input data for the input assembler stage.
Get a reference to the input-layout object that is bound to the input-assembler stage.
For information about creating an input-layout object, see Creating the Input-Layout Object.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get information about the primitive type, and data order that describes input data for the input assembler stage.
This interface encapsulates methods for measuring GPU performance.
A counter can be created with
This is a derived class of
Counter data is gathered by issuing an
Counters are best suited for profiling.
For a list of the types of performance counters, see
Get a counter description.
Pointer to a counter description (see
Get a counter description.
A debug interface controls debug settings, validates pipeline state and can only be used if the debug layer is turned on.
This interface is obtained by querying it from the
Set a bitfield of flags that will turn debug features on and off.
Feature-mask flags bitwise ORed together. If a flag is present, then that feature will be set to on, otherwise the feature will be set to off. See remarks for a list of flags.
This method returns one of the following Direct3D 10 Return Codes.
Setting a feature-mask flag will cause a rendering-operation method (listed below) to do some extra task when called. The possible feature flags are:
Application will wait for the GPU to finish processing the rendering operation before continuing. | |
Runtime will additionally call | |
Runtime will call Present. Presentation of render buffers will occur according to the settings established by prior calls to |
?
These feature-mask flags apply to the following rendering-operation methods:
Get a bitfield of flags that indicates which debug features are on or off.
Mask of feature-mask flags bitwise ORed together. If a flag is present, then that feature will be set to on, otherwise the feature will be set to off. See
Set the number of milliseconds to sleep after Present is called.
This method returns one of the following Direct3D 10 Return Codes.
The application will only sleep if
Get the number of milliseconds to sleep after Present is called.
Number of milliseconds to sleep after Present is called.
Value is set with
Set a swap chain that the runtime will use for automatically calling Present.
This method returns one of the following Direct3D 10 Return Codes.
The swap chain set by this method will only be used if
Get the swap chain that the runtime will use for automatically calling Present.
This method returns one of the following Direct3D 10 Return Codes.
The swap chain retrieved by this method will only be used if
Check the validity of pipeline state.
This method returns one of the following Direct3D 10 Return Codes.
When the debug layer is turned on all draw functions will do this operation.
Get the number of milliseconds to sleep after Present is called.
Value is set with
Get the swap chain that the runtime will use for automatically calling Present.
The swap chain retrieved by this method will only be used if
A depth-stencil-state interface accesses depth-stencil state which sets up the depth-stencil test for the output-merger stage.
Create a depth-stencil state object by calling
To initialize depth-stencil state, bind the depth-stencil-state object to the pipeline by calling
Get the depth-stencil state.
A reference to the depth-stencil state (see
Get the depth-stencil state.
A depth-stencil-view interface accesses a texture resource during depth-stencil testing.
To create a depth-stencil view, call
To bind a depth-stencil view to the pipeline, call
A view interface specifies the parts of a resource the pipeline can access during rendering (see view).
A view interface is the base interface for all views. There are three types of views; a depth-stencil view, a render-target view, and a shader-resource view.
All resources must be bound to the pipeline before they can be accessed.
A view can also be used to access a typeless resource.
Get the resource that is accessed through this view.
Address of a reference to the resource that is accessed through this view. (See
This function increments the reference count of the resource by one, so it is necessary to call Release on the returned reference when the application is done with it. Destroying (or losing) the returned reference before Release is called will result in a memory leak.
Get the resource that is accessed through this view.
This function increments the reference count of the resource by one, so it is necessary to call Release on the returned reference when the application is done with it. Destroying (or losing) the returned reference before Release is called will result in a memory leak.
Get the depth-stencil view.
Get the depth-stencil view.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
IDXGIResource* pOtherResource(NULL);
hr = pOtherDeviceResource->QueryInterface( __uuidof(IDXGIResource), (void**)&pOtherResource );
HANDLE sharedHandle;
pOtherResource->GetSharedHandle(&sharedHandle);
The only resources that can be shared are 2D non-mipmapped textures. To share a resource between a Direct3D 9 device and a Direct3D 10 device the texture must have been created using the pSharedHandle argument of {{CreateTexture}}. The shared Direct3D 9 handle is then passed to OpenSharedResource in the hResource argument. The following code illustrates the method calls involved.
sharedHandle = NULL; // must be set to NULL to create, can use a valid handle here to open in D3D9
pDevice9->CreateTexture(..., pTex2D_9, &sharedHandle);
...
pDevice10->OpenSharedResource(sharedHandle, __uuidof(ID3D10Resource), (void**)(&tempResource10));
tempResource10->QueryInterface(__uuidof(ID3D10Texture2D), (void**)(&pTex2D_10));
tempResource10->Release();
// now use pTex2D_10 with pDevice10
Textures being shared from D3D9 to D3D10 have the following restrictions. Textures must be 2D Only 1 mip level is allowed Texture must have default usage Texture must be write only MSAA textures are not allowed Bind flags must have SHADER_RESOURCE and RENDER_TARGET set Only R10G10B10A2_UNORM, R16G16B16A16_FLOAT and R8G8B8A8_UNORM formats are allowed If a shared texture is updated on one device D3D10_BOX sourceRegion;
sourceRegion.left = 120;
sourceRegion.right = 200;
sourceRegion.top = 100;
sourceRegion.bottom = 220;
sourceRegion.front = 0;
sourceRegion.back = 1; pd3dDevice->CopySubresourceRegion( pDestTexture, 0, 130, 120, 0, pSourceTexture, 0, &sourceRegion );
Notice that, for a 2D texture, front and back are always set to 0 and 1 respectively.
Draw indexed, non-instanced primitives.
Number of indices to draw.
Index of the first index to use when accesssing the vertex buffer; begin at StartIndexLocation to index vertices from the vertex buffer.
Offset from the start of the vertex buffer to the first vertex.
A draw API submits work to the rendering pipeline.
If the sum of both indices is negative, the result of the function call is undefined.
Draw non-indexed, non-instanced primitives.
Number of vertices to draw.
Index of the first vertex, which is usually an offset in a vertex buffer; it could also be used as the first vertex id generated for a shader parameter marked with the SV_TargetId?system-value semantic.
A draw API submits work to the rendering pipeline.
The vertex data for a draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has vertex data marked with the SV_VertexId?system-value semantic.
Draw indexed, instanced primitives.
Size of the index buffer used in each instance.
Number of instances to draw.
Index of the first index.
Index of the first vertex. The index is signed, which allows a negative index. If the negative index plus the index value from the index buffer are less than 0, the result is undefined.
Index of the first instance.
A draw API submits work to the rendering pipeline.
Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors. Indexing requires multiple vertex buffers: at least one for per-vertex data and a second buffer for per-instance data. For an example of instancing, see the Instancing10 Sample.
Draw non-indexed, instanced primitives.
Number of vertices to draw.
Number of instances to draw.
Index of the first vertex.
Index of the first instance.
A draw API submits work to the rendering pipeline.
Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors. For an example of instancing, see the Instancing10 Sample.
The vertex data for an instanced draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has instanced data identified with a system-value semantic (SV_InstanceID).
Set a rendering predicate.
Pointer to a predicate (see
If TRUE, rendering will be affected by when the predicate's conditions are met. If
The predicate must be in the "issued" or "signaled" state to be used for predication. While the predicate is set for predication, calls to
This method is used to denote that subsequent rendering and resource manipulation commands are not actually performed if the resulting Predicate data of the Predicate is equal to the PredicateValue. However, some Predicates are only hints, so they may not actually prevent operations from being performed.
The primary usefulness of Predication is to allow an application to issue graphics commands without taking the performance hit of spinning, waiting for
Draw geometry of an unknown size that was created by the geometry shader stage. See remarks.
A draw API submits work to the rendering pipeline.
After data has been streamed out to SO stage buffers, those buffers can be again bound to the Input Assembler stage at input slot 0 and DrawAuto will draw them without the application needing to know the amount of data that was written to the buffers. A measurement of the amount of data written to the SO stage buffers is maintained internally when the data is streamed out. This means that the CPU does not need to fetch the measurement before re-binding the data that was streamed as input data. Although this amount is tracked internally, it is still the responsibility of applications to use input layouts to describe the format of the data in the SO stage buffers so that the layouts are available when the buffers are again bound to the input assembler.
The following diagram shows the DrawAuto process.
Calling DrawAuto does not change the state of the streaming-output buffers that were bound again as inputs.
DrawAuto only works when drawing with one input buffer bound as an input to the IA stage at slot 0. Applications must create the SO buffer resource with both binding flags,
This API does not support indexing or instancing.
If an application needs to retrieve the size of the streaming-output buffer, it can query for statistics on streaming output by using
Example of using DrawAuto can be found in the ParticlesGS Sample and PipesGS Sample.
Copy a region from a source resource to a destination resource.
A reference to the destination resource (see
Subresource index of the destination.
The x coordinate of the upper left corner of the destination region.
The y coordinate of the upper left corner of the destination region.
The z coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero.
A reference to the source resource (see
Subresource index of the source.
A 3D box (see
The source box must be within the size of the source resource. The destination location is an absolute value (not a relative value). The destination location can be offset from the source location; however, the size of the region to copy (including the destination location) must fit in the destination resource.
If the resources are buffers, all coordinates are in bytes; if the resources are textures, all coordinates are in texels.
D3D10CalcSubresource is a helper function for calculating subresource indexes.
CopySubresourceRegion performs the copy on the GPU (similar to a memcpy by the CPU). As a consequence, the source and destination resources must meet the following criteria:
CopySubresourceRegion supports only copy; it does not support any stretch, color key, blend, or format conversions. An application that needs to copy an entire resource should use
CopySubresourceRegion is an asynchronous call that the runtime can add to the command-buffer queue. This asynchronous behaviorattempts to remove pipeline stalls that may occur when copying data. See performance considerations for more details.
Differences between Direct3D 10 and Direct3D 10.1: Direct3D 10 has the following limitations:
Direct3D 10.1 has added support for the following features:
|
?
Note??If you use CopySubresourceRegion with a depth-stencil buffer or a multisampled resource, you must copy the whole subresource. You must also pass 0 to the DstX, DstY, and DstZ parameters and
The following code snippet copies a box (located at (120,100),(200,220)) from a source texture into a reqion (130,120),(210,240) in a destination texture.
sourceRegion;
sourceRegion.left = 120;
sourceRegion.right = 200;
sourceRegion.top = 100;
sourceRegion.bottom = 220;
sourceRegion.front = 0;
sourceRegion.back = 1; pd3dDevice->CopySubresourceRegion( pDestTexture, 0, 130, 120, 0, pSourceTexture, 0, &sourceRegion );
Notice that, for a 2D texture, front and back are always set to 0 and 1 respectively.
Copy the entire contents of the source resource to the destination resource using the GPU.
A reference to the destination resource (see
A reference to the source resource (see
This method is unusual in that it causes the GPU to perform the copy operation (similar to a memcpy by the CPU). As a result, it has a few restrictions designed for improving performance. For instance, the source and destination resources:
Immutable, and depth-stencil resources cannot be used as a destination. Resources created with multisampling capability cannot be used as either a source or destination.
The method is an asynchronous call which may be added to the command-buffer queue. This attempts to remove pipeline stalls that may occur when copying data. See performance considerations for more details.
An application that only needs to copy a portion of the data in a resource should use
Differences between Direct3D 10 and Direct3D 10.1: Direct3D 10.1 enables depth-stencil resources to be used as either a source or destination. Direct3D 10.1 enables multisampled resources to be used as source and destination only if both source and destination have identical multisampled count and quality. If source and destination differ in multisampled count and quality or one of them is multisampled and the other is not multisampled, the call to It is possible to copy between prestructured+typed resources and block-compressed textures. See Format Conversion using Direct3D 10.1. |
?
The CPU copies data from memory to a subresource created in non-mappable memory. See remarks.
For a shader-constant buffer; set pDstBox to
A resource cannot be used as a destination if:
When UpdateSubresource returns, the application is free to change or even free the data pointed to by pSrcData because the method has already copied/snapped away the original contents.
The performance of UpdateSubresource depends on whether or not there is contention for the destination resource. For example, contention for a vertex buffer resource occurs when the application executes a Draw call and later calls UpdateSubresource on the same vertex buffer before the Draw call is actually executed by the GPU.
To better understand the source row pitch and source depth pitch parameters, consider the following illustration of a 3D volume texture.
Each block in this visual represents an element of data, and the size of each element is dependent on the resource's format. For example, if the resource format is
To calculate the source row pitch and source depth pitch for a given resource, use the following formulas:
In the case of this example 3D volume texture where the size of each element is 16 bytes, the formulas are as follows:
The following illustration shows the resource as it is laid out in memory.
For example, the following code snippet shows how to specify a destination region in a 2D texture. Assume the destination texture is 512x512 and the operation will copy the data pointed to by pData to [(120,100)..(200,220)] in the destination texture. Also assume that rowPitch has been initialized with the proper value (as explained above). Front and back are set to 0 and 1 respectively, because by having front equal to back, the box is technically empty.
destRegion;
destRegion.left = 120;
destRegion.right = 200;
destRegion.top = 100;
destRegion.bottom = 220;
destRegion.front = 0;
destRegion.back = 1; pd3dDevice->UpdateSubresource( pDestTexture, 0, &destRegion, pData, rowPitch, 0 );
The 1D case is similar. The following snippet shows how to specify a destination region in a 1D texture. Use the same assumptions as above, except that the texture is 512 in length.
destRegion;
destRegion.left = 120
destRegion.right = 200;
destRegion.top = 0;
destRegion.bottom = 1;
destRegion.front = 0;
destRegion.back = 1; pd3dDevice->UpdateSubresource( pDestTexture, 0, &destRegion, pData, rowPitch, 0 );
Differences between Direct3D 10 and Direct3D 10.1: Direct3D 10.1 enables depth-stencil resources to be used as either a source or destination. |
?
Set all the elements in a render target to one value.
Pointer to the rendertarget.
A 4-component array that represents the color to fill the render target with.
Applications that wish to clear a render target to a specific integer value bit pattern should render a screen-aligned quad instead of using this method. The reason for this is because this method accepts as input a floating point value, which may not have the same bit pattern as the original integer.
Differences between Direct3D 9 and Direct3D 10: Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied. |
?
Clears the depth-stencil resource.
Pointer to the depth stencil to be cleared.
Which parts of the buffer to clear. See
Clear the depth buffer with this value. This value will be clamped between 0 and 1.
Clear the stencil buffer with this value.
Differences between Direct3D 9 and Direct3D 10: Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied. |
?
Generate mipmaps for the given shader resource.
Pointer to an
GenerateMips may be called on any
All video adapters will automatically generate mipmaps if you are using one of the following formats:
Some video adapters will automatically generate mipmaps for this format.
For all other unsupported formats, this method will silently fail.
Copy a multisampled resource into a non-multisampled resource. This API is most useful when re-using the resulting rendertarget of one render pass as an input to a second render pass.
Destination resource. Must be a created with the
A zero-based index, that identifies the destination subresource. See D3D10CalcSubresource for more details.
Source resource. Must be multisampled.
The source subresource of the source resource.
Both the source and destination resources must be the same resource type and have the same dimensions.
The source and destination must have compatible formats. There are three scenarios for this:
Scenario | Requirements |
---|---|
Source and destination are prestructured and typed | Both the source and destination must have identical formats and that format must be specified in the Format parameter. |
One resource is prestructured and typed and the other is prestructured and typeless | The typed resource must have a format that is compatible with the typeless resource (i.e. the typed resource is |
Source and destination are prestructured and typeless | Both the source and desintation must have the same typeless format (i.e. both must have |
?
Get the rendering predicate state.
Address of a reference to a predicate (see
Address of a boolean to fill with the predicate comparison value.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the reason why the device was removed.
Possible return values include:
For more detail on these return codes, see DXGI_ERROR.
Get the exception-mode flags.
A value that contains one or more exception flags; each flag specifies a condition which will cause an exception to be raised. The flags are listed in D3D10_RAISE_FLAG. A default value of 0 means there are no flags.
This method returns one of the following Direct3D 10 Return Codes.
Set an exception-mode flag to elevate an error condition to a non-continuable exception.
Whenever an error occurs, a Direct3D device enters the DEVICEREMOVED state and if the appropriate exception flag has been set, an exception is raised. A raised exception is designed to terminate an application. Before termination, the last chance an application has to persist data is by using an UnhandledExceptionFilter (see Structured Exception Handling). In general, UnhandledExceptionFilters are leveraged to try to persist data when an application is crashing (to disk, for example). Any code that executes during an UnhandledExceptionFilter is not guaranteed to reliably execute (due to possible process corruption). Any data that the UnhandledExceptionFilter manages to persist, before the UnhandledExceptionFilter crashes again, should be treated as suspect, and therefore inspected by a new, non-corrupted process to see if it is usable.
Get the exception-mode flags.
A value that contains one or more exception flags; each flag specifies a condition which will cause an exception to be raised. The flags are listed in D3D10_RAISE_FLAG. A default value of 0 means there are no flags.
An exception-mode flag is used to elevate an error condition to a non-continuable exception.
Set data to a device and associate that data with a guid.
Guid associated with the data.
Size of the data.
Pointer to the data to be stored with this device. If pData is
This method returns one of the following Direct3D 10 Return Codes.
The data stored in the device with this method can be retrieved with
The data and guid set with this method will typically be application-defined.
If an application uses this method to change the device type using GUID_DeviceType, results are undefined. However, GUID_DeviceType can be used to retrieve the device type using
Restore all default device settings; return the device to the state it was in when it was created. This will set all set all input/output resource slots, shaders, input layouts, predications, scissor rectangles, depth-stencil state, rasterizer state, blend state, sampler state, and viewports to
Send queued-up commands in the command buffer to the GPU.
Most applications will not need to call this method. Calling this method when not necessary will incur a performance penalty. Each call to Flush incurs a significant amount of overhead.
When Direct3D state-setting, present, or draw commands are called by an application, those commands are queued into an internal command buffer. Flush sends those commands to the GPU for processing. Normally, these commands are sent to the GPU automatically whenever Direct3D determines that they need to be, such as when the command buffer is full or when mapping a resource. Flush will send the commands manually.
Flush should be used when the CPU waits for an arbitrary amount of time (such as when calling Sleep, ID3DX10ThreadPump::WaitForAllItems, or WaitForVBlank.
For more information about how flushing works, see Accurately Profiling Direct3D API Calls (Direct3D 9).
Create a buffer (vertex buffer, index buffer, or shader-constant buffer).
This method returns one of the following Direct3D 10 Return Codes.
For example code, see:
Create an array of 1D textures (see Texture1D).
If the method succeeds, the return code is
CreateTexture1D creates a 1D texture resource, which contains an array of 1D textures. The number of textures is specified in the texture description. All textures in a resource must have the same format, size, and number of mipmap levels.
All resources are made up of one or more subresources. To load data into the texture, applications may supply the data initially as part of
Create an array of 2D textures (see Texture2D).
If the method succeeds, the return code is
CreateTexture2D creates a 2D texture resource, which contains an array of 1D textures. The number of textures is specified in the texture description. All textures in a resource must have the same format, size, and number of mipmap levels.
All resources are made up of one or more subresources. To load data into the texture, applications may supply the data initially as part of
Create a single 3D texture (see Texture3D).
If the method succeeds, the return code is
CreateTexture3D creates a 3D texture resource, which contains an array of 1D textures. The number of textures is specified in the texture description. All textures in a resource must have the same format, size, and number of mipmap levels.
All resources are made up of one or more subresources. To load data into the texture, applications may supply the data initially as part of
Create a shader-resource view for accessing data in a resource.
This method returns one of the following Direct3D 10 Return Codes.
A resource is made up of one or more subresources, a view identifies which subresources to allow the pipeline to access. In addition, each resource is bound to the pipeline using a view. A shader-resource view is designed to bind any buffer or texture resource to the shader stages using the following API methods: VSSetShaderResources, GSSetShaderResources and PSSetShaderResources.
Since a view is fully typed, this means that typeless resources become fully typed when bound to the pipeline.
Create a render-target view for accessing resource data.
This method returns one of the following Direct3D 10 Return Codes.
A rendertarget view can be bound to the output merger stage by calling
Create a depth-stencil view for accessing resource data.
This method returns one of the following Direct3D 10 Return Codes.
A depth-stencil view can be bound to the output-merger stage by calling
For more background information, see the programming guide page about depth stencils.
Create an input-layout object to describe the input-buffer data for the input-assembler stage.
If the method succeeds, the return code is
After creating an input layout object, it must be bound to the input-assembler stage before calling a draw API. See Getting Started with the Input-Assembler Stage (Direct3D 10) for example code.
Once an input-layout object is created from a shader signature, the input-layout object can be reused with any other shader that has an identical input signature (semantics included). This can simplify the creation of input-layout objects when you are working with many shaders with identical inputs.
If a data type in the input-layout declaration does not match the data type in a shader-input signature, CreateInputLayout will generate a warning during compilation. The warning is simply to call attention to the fact that the data may be reinterpreted when read from a register. You may either disregard this warning (if reinterpretation is intentional) or make the data types match in both declarations to eliminate the warning. The Data Conversion Rules overview describes the rules applied for data type conversion.
Differences between Direct3D 9 and Direct3D 10: Mapping the vertex data to the shader inputs with an input layout is a new way of doing things in Direct3D 10 that improves performance. In Direct3D 10 the vertex data is mapped to the shader inputs when the input layout object is created, whereas in Direct3D 9 this mapping was done at Draw time based on the currently bound vertex declarations, vertex buffers, and vertex shaders. Doing this mapping when the input layout object is created reduces or eliminates extra linkage work for drivers at Draw time because this re-mapping is no longer necessary. |
?
Create a vertex-shader object from a compiled shader.
A reference to the compiled shader. To get this reference see Getting a Pointer to a Compiled Shader.
Size of the compiled vertex shader.
Address of a reference to an
This method returns one of the following Direct3D 10 Return Codes.
Create a geometry shader.
A reference to the compiled shader. To get this reference see Getting a Pointer to a Compiled Shader.
Size of the compiled geometry shader.
Address of a reference to an
This method returns one of the following Direct3D 10 Return Codes.
Once created, the shader can be set to the device by calling
Creates a geometry shader that can write to streaming output buffers.
A reference to the compiled geometry shader for a standard geometry shader plus stream output. For info on how to get this reference, see Getting a Pointer to a Compiled Shader.
To create the stream output without using a geometry shader, pass a reference to the output signature for the prior stage. To obtain this output signature, call the
Size of the compiled geometry shader.
Pointer to a
The number of entries in the array pointed to by pSODeclaration. Minimum 0, maximum 64.
The size, in bytes, of each element in the array pointed to by pSODeclaration. This parameter is only used when the output slot is 0 for all entries in pSODeclaration.
Address of a reference to an
This method returns one of the Direct3D 10 Return Codes.
For more info about using CreateGeometryShaderWithStreamOutput, see Create a Geometry-Shader Object with Stream Output.
Create a pixel shader.
A reference to the compiled shader. To get this reference see Getting a Pointer to a Compiled Shader.
Size of the compiled pixel shader.
Address of a reference to an
This method returns one of the following Direct3D 10 Return Codes.
After creating the pixel shader, you can set it to the device using
Create a blend-state object that encapsules blend state for the output-merger stage.
Pointer to a blend-state description (see
Address of a reference to the blend-state object created (see
This method returns one of the following Direct3D 10 Return Codes.
An application can create up to 4096 unique blend-state objects. For each object created, the runtime checks to see if a previous object has the same state. If such a previous object exists, the runtime will return a reference to previous instance instead of creating a duplicate object.
Create a depth-stencil state object that encapsulates depth-stencil test information for the output-merger stage.
This method returns one of the following Direct3D 10 Return Codes.
4096 unique depth-stencil state objects can be created on a device at a time.
If an application attempts to create a depth-stencil state with the same description as an already existing depth-stencil state, then the same interface with an incremented reference count will be returned and the total number of unique depth-stencil state objects will stay the same.
Create a rasterizer state object that tells the rasterizer stage how to behave.
This method returns one of the following Direct3D 10 Return Codes.
4096 unique rasterizer state objects can be created on a device at a time.
If an application attempts to create a rasterizer state with the same description as an already existing rasterizer state, then the same interface with an incremented reference count will be returned and the total number of unique rasterizer state objects will stay the same.
Create a sampler-state object that encapsulates sampling information for a texture.
This method returns one of the following Direct3D 10 Return Codes.
4096 unique sampler state objects can be created on a device at a time.
If an application attempts to create a sampler state with the same description as an already existing sampler state, then the same interface with an incremented reference count will be returned and the total number of unique sampler state objects will stay the same.
This interface encapsulates methods for querying information from the GPU.
Pointer to a query description (see
Address of a reference to the query object created (see
This method returns one of the following Direct3D 10 Return Codes.
Creates a predicate.
Pointer to a query description where the type of query must be a
Address of a reference to a predicate (see
This method returns one of the following Direct3D 10 Return Codes.
Create a counter object for measuring GPU performance.
Pointer to a counter description (see
Address of a reference to a counter (see
If this function succeeds, it will return
E_INVALIDARG is returned whenever an out-of-range well-known or device-dependent counter is requested, or when the simulataneously active counters have been exhausted.
Get the support of a given format on the installed video device.
A
A bitfield of
Most format support is based on the Direct3D feature level. Only a few specific use cases require checking for support. See Hardware Support for Direct3D 10 Formats and Hardware Support for Direct3D 10.1 Formats for additional information.
Get the number of quality levels available during multisampling.
The texture format. See
The number of samples during multisampling.
Number of quality levels supported by the adapter. See remarks.
When multisampling a texture, the number of quality levels available for an adapter is dependent on the texture format used and the number of samples requested. The maximum sample count defined by D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT in d3d10.h is 32. If the returned value of pNumQualityLevels is 0, the format and sample count combination is not supported for the installed adapter.
Furthermore, the definition of a quality level is up to each hardware vendor to define, however no facility is provided by Direct3D to help discover this information.
Direct3D 10.1 devices are required to support 4x MSAA for all formats except R32G32B32A32 and R32G32B32 formats.
Get a counter's information.
Get the type, name, units of measure, and a description of an existing counter.
Pointer to a counter description (see
Pointer to the data type of a counter (see
Pointer to the number of hardware counters that are needed for this counter type to be created. All instances of the same counter type use the same hardware counters.
String to be filled with a brief name for the counter. May be
Length of the string returned to szName. Can be
Name of the units a counter measures, provided the memory the reference points to has enough room to hold the string. Can be
Length of the string returned to szUnits. Can be
A description of the counter, provided the memory the reference points to has enough room to hold the string. Can be
Length of the string returned to szDescription. Can be
This method returns one of the following Direct3D 10 Return Codes.
Length parameters can be
Get the flags used during the call to create the device with
A bitfield containing the flags used to create the device. See
Give a device access to a shared resource created on a different Direct3d device.
A resource handle. See remarks.
The globally unique identifier (
Address of a reference to the resource we are gaining access to.
This method returns one of the following Direct3D 10 Return Codes.
To share a resource between two Direct3D 10 devices the resource must have been created with the
The REFIID, or
When sharing a resource between two Direct3D 10 devices the unique handle of the resource can be obtained by querying the resource for the
* pOtherResource(null );
hr = pOtherDeviceResource->QueryInterface( __uuidof( ), (void**)&pOtherResource );
HANDLE sharedHandle;
pOtherResource->GetSharedHandle(&sharedHandle);
The only resources that can be shared are 2D non-mipmapped textures.
To share a resource between a Direct3D 9 device and a Direct3D 10 device the texture must have been created using the pSharedHandle argument of CreateTexture. The shared Direct3D 9 handle is then passed to OpenSharedResource in the hResource argument.
The following code illustrates the method calls involved.
sharedHandle = null ; // must be set to null to create, can use a valid handle here to open in D3D9
pDevice9->CreateTexture(..., pTex2D_9, &sharedHandle);
...
pDevice10->OpenSharedResource(sharedHandle, __uuidof( ), (void**)(&tempResource10));
tempResource10->QueryInterface(__uuidof( ), (void**)(&pTex2D_10));
tempResource10->Release();
// now use pTex2D_10 with pDevice10
Textures being shared from D3D9 to D3D10 have the following restrictions.
If a shared texture is updated on one device
Get the reason why the device was removed.
Get the exception-mode flags.
An exception-mode flag is used to elevate an error condition to a non-continuable exception.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Set the target output buffers for the StreamOutput stage, which enables/disables the pipeline to stream-out data.
Call
An offset of -1 will cause the stream output buffer to be appended, continuing after the last location written to the buffer in a previous stream output pass.
Calling this method using a buffer that is currently bound for writing will effectively bind
The Debug Layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set the target output buffers for the StreamOutput stage, which enables/disables the pipeline to stream-out data.
Call
An offset of -1 will cause the stream output buffer to be appended, continuing after the last location written to the buffer in a previous stream output pass.
Calling this method using a buffer that is currently bound for writing will effectively bind
The Debug Layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Get the target output buffers for the StreamOutput stage of the pipeline.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Bind one or more render targets and the depth-stencil buffer to the output-merger stage.
A call to OMSetRenderTargets overrides all bounded render targets and the depth stencil target regardless of the number of render targets in ppRenderTargetViews.
The maximum number of render targets a device can have active at any given time is set by a #define in D3D10.h called D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots.
If any subresources are also currently bound for reading or writing (perhaps in a different part of the pipeline), those bind points will be
The method will not hold references to the interfaces passed in. For that reason, applications should be careful not to release interfaces currently in use by the device.
See Binding Resources and Pipeline stages for more information on binding resources.
The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.
Any combination of the eight slots for render targets can have a render target set or not set.
The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.
Bind one or more render targets and the depth-stencil buffer to the output-merger stage.
A call to OMSetRenderTargets overrides all bounded render targets and the depth stencil target regardless of the number of render targets in ppRenderTargetViews.
The maximum number of render targets a device can have active at any given time is set by a #define in D3D10.h called D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots.
If any subresources are also currently bound for reading or writing (perhaps in a different part of the pipeline), those bind points will be
The method will not hold references to the interfaces passed in. For that reason, applications should be careful not to release interfaces currently in use by the device.
See Binding Resources and Pipeline stages for more information on binding resources.
The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.
Any combination of the eight slots for render targets can have a render target set or not set.
The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.
Set the blend state of the output-merger stage.
Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.
To create a blend-state interface, call
Passing in
State | Default Value |
---|---|
AlphaToCoverageEnable | |
BlendEnable | |
SrcBlend | |
DstBlend | |
BlendOp | |
SrcBlendAlpha | |
DstBlendAlpha | |
BlendOpAlpha | |
RenderTargetWriteMask[8] |
?
A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Sets the depth-stencil state of the output-merger stage.
To create a depth-stencil state interface, call
Depth-stencil state is used by the output-merger stage to setup depth-stencil testing. The stencil reference value is the control value used in the depth-stencil test.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Get references to the render targets and the depth-stencil buffer that are available to the output-merger stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the blend state of the output-merger stage.
The reference count of the returned interface will be incremented by one when the blend state is retrieved. Applications must release returned reference(s) when they are no longer needed, or else there will be a memory leak.
Gets the depth-stencil state of the output-merger stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Set the rasterizer state for the rasterizer stage of the pipeline.
To create a rasterizer state interface, call
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of viewports to the rasterizer stage of the pipeline.
All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.
Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader (see shader semantic syntax). If a geometry shader does not make use of the SV_ViewportArrayIndex semantic then Direct3D will use the first viewport in the array.
Bind an array of scissor rectangles to the rasterizer stage.
The scissor rectangles will only be used if ScissorEnable is set to true in the rasterizer state (see
Which scissor rectangle to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader (see shader semantic syntax). If a geometry shader does not make use of the SV_ViewportArrayIndex semantic then Direct3D will use the first scissor rectangle in the array.
Each scissor rectangle in the array corresponds to a viewport in an array of viewports (see
Get the rasterizer state from the rasterizer stage of the pipeline.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the array of viewports bound to the rasterizer stage
Get the array of scissor rectangles bound to the rasterizer stage.
Get the rasterizer state from the rasterizer stage of the pipeline.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
The device interface represents a virtual adapter for Direct3D 10.1; it is used to perform rendering and create Direct3D resources.
A device is created using
This method requires Windows Vista Service Pack 1.
Create a shader-resource view for accessing data in a resource.
This method returns one of the following Direct3D 10 Return Codes.
A resource is made up of one or more subresources, a view identifies which subresources to allow the pipeline to access. In addition, each resource is bound to the pipeline using a view. A shader-resource view is designed to bind any buffer or texture resource to the shader stages using the following API methods: VSSetShaderResources, GSSetShaderResources and PSSetShaderResources.
Since a view is fully typed, this means that typeless resources become fully typed when bound to the pipeline.
This method requires Windows Vista Service Pack 1.
Create a blend-state object that encapsules blend state for the output-merger stage.
Pointer to a blend-state description (see
Address of a reference to the blend-state object created (see
This method returns one of the following Direct3D 10 Return Codes.
An application can create up to 4096 unique blend-state objects. For each object created, the runtime checks to see if a previous object has the same state. If such a previous object exists, the runtime will return a reference to previous instance instead of creating a duplicate object.
This method requires Windows Vista Service Pack 1.
Gets the feature level of the hardware device.
The feature level (see
This method requires Windows Vista Service Pack 1.
Gets the feature level of the hardware device.
This method requires Windows Vista Service Pack 1.
An
An effect is created by calling
The effect system groups the information required for rendering into an effect which contains: state objects for assigning state changes in groups, resources for supplying input data and storing output data, and programs that control how the rendering is done called shaders. For more information, see Effects (Direct3D 10).
Note??
If you call QueryInterface on an
* pIUnknown = ( *)pEffect; pIUnknown->AddRef();
Test an effect to see if it contains valid syntax.
TRUE if the code syntax is valid; otherwise
Test an effect to see if it is part of a memory pool.
TRUE if the effect is pooled; otherwise
Get the device that created the effect.
A reference to an
Returns one of the following Direct3D 10 Return Codes.
An effect is created for a specific device, by calling a function such as
Get an effect description.
A reference to an effect description (see
Returns one of the following Direct3D 10 Return Codes.
An effect description contains basic information about an effect such as the techniques it contains and the constant buffer resources it requires.
Get a constant buffer by index.
A zero-based index.
A reference to a
An effect that contains a variable that will be read/written by an application requires at least one constant buffer. For best performance, an effect should organize variables into one or more constant buffers based on their frequency of update.
Get a constant buffer by name.
The constant-buffer name.
A reference to the constant buffer indicated by the Name. See
An effect that contains a variable that will be read/written by an application requires at least one constant buffer. For best performance, an effect should organize variables into one or more constant buffers based on their frequency of update.
Get a variable by index.
A zero-based index.
A reference to a
An effect may contain one or more variables. Variables outside of a technique are considered global to all effects, those located inside of a technique are local to that technique. You can access any local non-static effect variable using its name or with an index.
The method returns a reference to an effect-variable interface if a variable is not found; you can call
Get a variable by name.
The variable name.
A reference to an
An effect may contain one or more variables. Variables outside of a technique are considered global to all effects, those located inside of a technique are local to that technique. You can access an effect variable using its name or with an index.
The method returns a reference to an effect-variable interface if a variable is not found; you can call
Get a variable by semantic.
The semantic name.
A reference to the effect variable indicated by the Semantic. See
Each effect variable can have a semantic attached, which is a user defined metadata string. Some system-value semantics are reserved words that trigger built in functionality by pipeline stages.
The method returns a reference to an effect-variable interface if a variable is not found; you can call
Get a technique by index.
A zero-based index.
A reference to an
An effect contains one or more techniques; each technique contains one or more passes. You can access a technique using its name or with an index. For more about techniques, see techniques and passes.
Get a technique by name.
The name of the technique.
A reference to an
An effect contains one or more techniques; each technique contains one or more passes. You can access a technique using its name or with an index. For more about techniques, see techniques and passes.
Minimize the amount of memory required for an effect.
Returns one of the following Direct3D 10 Return Codes.
An effect uses memory space two different ways: to store the information required by the runtime to execute an effect, and to store the metadata required to reflect information back to an application using the API. You can minimize the amount of memory required by an effect by calling
The following methods will fail after Optimize has been called on an effect.
Note that references retrieved with these methods before calling
Test an effect to see if the reflection metadata has been removed from memory.
TRUE if the effect is optimized; otherwise
An effect uses memory space two different ways: to store the information required by the runtime to execute an effect, and to store the metadata required to reflect information back to an application using the API. You can minimize the amount of memory required by an effect by calling
Test an effect to see if it contains valid syntax.
Test an effect to see if it is part of a memory pool.
Get the device that created the effect.
An effect is created for a specific device, by calling a function such as
Get an effect description.
An effect description contains basic information about an effect such as the techniques it contains and the constant buffer resources it requires.
Test an effect to see if the reflection metadata has been removed from memory.
An effect uses memory space two different ways: to store the information required by the runtime to execute an effect, and to store the metadata required to reflect information back to an application using the API. You can minimize the amount of memory required by an effect by calling
The blend-variable interface accesses blend state.
An
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. You can use either of these methods to return state. For examples, see Two Ways to Get the State in an Effect Variable.
The
The lifetime of an
The
Compare the data type with the data stored.
TRUE if the syntax is valid; otherwise
This method checks that the data type matches the data stored after casting one interface to another (using any of the As methods).
Get type information.
A reference to an
Get a description.
A reference to an effect-variable description (see
Returns one of the following Direct3D 10 Return Codes.
Get an annotation by index.
A zero-based index.
A reference to an
Annonations can be attached to a technique, a pass or a gloval variable. For the syntax, see Annotation Syntax (Direct3D 10).
Get an annotation by name.
The annotation name.
A reference to an
Annonations can be attached to a technique, a pass or a gloval variable. For the syntax, see Annotation Syntax (Direct3D 10).
Get a structure member by index.
A zero-based index.
A reference to an
If the effect variable is an structure, use this method to look up a member by index.
Get a structure member by name.
Member name.
A reference to an
If the effect variable is an structure, use this method to look up a member by name.
Get a structure member by semantic.
The semantic.
A reference to an
If the effect variable is an structure, use this method to look up a member by attached semantic.
Get an array element.
A zero-based index; otherwise 0.
A reference to an
If the effect variable is an array, use this method to return one of the elements.
Get a constant buffer.
A reference to a
Effect variables are read-from or written-to a constant buffer.
Get a scalar variable.
A reference to a scalar variable. See
AsScalar returns a version of the effect variable that has been specialized to a scalar variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain scalar data.
Applications can test the returned object for validity by calling IsValid.
Get a vector variable.
A reference to a vector variable. See
AsVector returns a version of the effect variable that has been specialized to a vector variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain vector data.
Applications can test the returned object for validity by calling IsValid.
Get a matrix variable.
A reference to a matrix variable. See
AsMatrix returns a version of the effect variable that has been specialized to a matrix variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain matrix data.
Applications can test the returned object for validity by calling IsValid.
Get a string variable.
A reference to a string variable. See
AsString returns a version of the effect variable that has been specialized to a string variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain string data.
Applications can test the returned object for validity by calling IsValid.
Get a shader-resource variable.
A reference to a shader-resource variable. See
AsShaderResource returns a version of the effect variable that has been specialized to a shader-resource variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain shader-resource data.
Applications can test the returned object for validity by calling IsValid.
Get a render-target-view variable.
A reference to a render-target-view variable. See
This method returns a version of the effect variable that has been specialized to a render-target-view variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain render-target-view data.
Applications can test the returned object for validity by calling IsValid.
Get a depth-stencil-view variable.
A reference to a depth-stencil-view variable. See
This method returns a version of the effect variable that has been specialized to a depth-stencil-view variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain depth-stencil-view data.
Applications can test the returned object for validity by calling IsValid.
Get a constant buffer.
A reference to a constant buffer. See
AsConstantBuffer returns a version of the effect variable that has been specialized to a constant buffer. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain constant buffer data.
Applications can test the returned object for validity by calling IsValid.
Get a shader variable.
A reference to a shader variable. See
AsShader returns a version of the effect variable that has been specialized to a shader variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain shader data.
Applications can test the returned object for validity by calling IsValid.
Get a effect-blend variable.
A reference to an effect blend variable. See
AsBlend returns a version of the effect variable that has been specialized to an effect-blend variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain effect-blend data.
Applications can test the returned object for validity by calling IsValid.
Get a depth-stencil variable.
A reference to a depth-stencil variable. See
AsDepthStencil returns a version of the effect variable that has been specialized to a depth-stencil variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain depth-stencil data.
Applications can test the returned object for validity by calling IsValid.
Get a rasterizer variable.
A reference to a rasterizer variable. See
AsRasterizer returns a version of the effect variable that has been specialized to a rasterizer variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain rasterizer data.
Applications can test the returned object for validity by calling IsValid.
Get a sampler variable.
A reference to a sampler variable. See
AsSampler returns a version of the effect variable that has been specialized to a sampler variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain sampler data.
Applications can test the returned object for validity by calling IsValid.
Set data.
A reference to the variable.
The offset (in bytes) from the beginning of the reference to the data.
The number of bytes to set.
Returns one of the following Direct3D 10 Return Codes.
This method does no conversion or type checking; it is therefore a very quick way to access array items.
Get data.
A reference to the variable.
The offset (in bytes) from the beginning of the reference to the data.
The number of bytes to get.
Returns one of the following Direct3D 10 Return Codes.
This method does no conversion or type checking; it is therefore a very quick way to access array items.
Compare the data type with the data stored.
This method checks that the data type matches the data stored after casting one interface to another (using any of the As methods).
Get type information.
Get a description.
Get a constant buffer.
Effect variables are read-from or written-to a constant buffer.
Get a reference to a blend-state interface.
Index into an array of blend-state interfaces. If there is only one blend-state interface, use 0.
The address of a reference to a blend-state interface (see
Get a reference to a blend-state variable.
Index into an array of blend-state descriptions. If there is only one blend-state variable in the effect, use 0.
A reference to a blend-state description (see
Returns one of the following Direct3D 10 Return Codes.
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. Backing store data can used to recreate the variable when necessary.
A depth-stencil-variable interface accesses depth-stencil state.
An
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. You can use either of these methods to return state. For examples, see Two Ways to Get the State in an Effect Variable.
Get a reference to a depth-stencil interface.
Index into an array of depth-stencil interfaces. If there is only one depth-stencil interface, use 0.
The address of a reference to a blend-state interface (see
Get a reference to a variable that contains depth-stencil state.
Index into an array of depth-stencil-state descriptions. If there is only one depth-stencil variable in the effect, use 0.
A reference to a depth-stencil-state description (see
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. Backing store data can used to recreate the variable when necessary.
A depth-stencil-view-variable interface accesses a depth-stencil view.
Set a depth-stencil-view resource.
A reference to a depth-stencil-view interface. See
Returns one of the following Direct3D 10 Return Codes.
Get a depth-stencil-view resource.
The address of a reference to a depth-stencil-view interface. See
Set an array of depth-stencil-view resources.
A reference to an array of depth-stencil-view interfaces. See
The zero-based array index to set the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Set an array of depth-stencil-view resources.
A reference to an array of depth-stencil-view interfaces. See
The zero-based array index to set the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Get an array of depth-stencil-view resources.
A reference to an array of depth-stencil-view interfaces. See
The zero-based array index to get the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
A matrix-variable interface accesses a matrix.
Set a floating-point matrix.
A reference to the first element in the matrix.
Returns one of the following Direct3D 10 Return Codes.
Get a matrix.
A reference to the first element in a matrix.
Returns one of the following Direct3D 10 Return Codes.
Set an array of floating-point matrices.
A reference to the first matrix.
The number of matrix elements to skip from the start of the array.
The number of elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of matrices.
A reference to the first element of the first matrix in an array of matrices.
The offset (in number of matrices) between the start of the array and the first matrix returned.
The number of matrices in the returned array.
Returns one of the following Direct3D 10 Return Codes.
Transpose and set a floating-point matrix.
A reference to the first element of a matrix.
Returns one of the following Direct3D 10 Return Codes.
Transposing a matrix will rearrange the data order from row-column order to column-row order (or vice versa).
Transpose and get a floating-point matrix.
A reference to the first element of a transposed matrix.
Returns one of the following Direct3D 10 Return Codes.
Transposing a matrix will rearrange the data order from row-column order to column-row order (or vice versa).
Transpose and set an array of floating-point matrices.
A reference to an array of matrices.
The offset (in number of matrices) between the start of the array and the first matrix to set.
The number of matrices in the array to set.
Returns one of the following Direct3D 10 Return Codes.
Transposing a matrix will rearrange the data order from row-column order to column-row order (or vice versa).
Transpose and get an array of floating-point matrices.
A reference to the first element of an array of tranposed matrices.
The offset (in number of matrices) between the start of the array and the first matrix to get.
The number of matrices in the array to get.
Returns one of the following Direct3D 10 Return Codes.
Transposing a matrix will rearrange the data order from row-column order to column-row order (or vice versa).
A pass interface encapsulates state assignments within a technique.
The lifetime of an
The
A pass is a block of code that sets render-state objects and shaders. A pass is declared within a technique; the syntax for a technique is shown in Effect Technique Syntax (Direct3D 10).
To get an effect-pass interface, call a method like
Test a pass to see if it contains valid syntax.
TRUE if the code syntax is valid; otherwise
Get a pass description.
A reference to a pass description (see
Returns one of the following Direct3D 10 Return Codes.
A pass is a block of code that sets render state and shaders (which in turn sets constant buffers, samplers and textures). An effect technique contains one or more passes. See techniques and passes.
Get a vertex-shader description.
A reference to a vertex-shader description (see
Returns one of the following Direct3D 10 Return Codes.
An effect pass can contain render state assignments and shader object assignments.
Get a geometry-shader description.
A reference to a geometry-shader description (see
Returns one of the following Direct3D 10 Return Codes.
An effect pass can contain render state assignments and shader object assignments.
Get a pixel-shader description.
A reference to a pixel-shader description (see
Returns one of the following Direct3D 10 Return Codes.
An effect pass can contain render state assignments and shader object assignments.
Get an annotation by index.
A zero-based index.
A reference to an
Get an annotation by name.
The name of the annotation.
A reference to an
Set the state contained in a pass to the device.
Unused.
Returns one of the following Direct3D 10 Return Codes.
Generate a mask for allowing/preventing state changes.
A reference to a state-block mask (see
Returns one of the following Direct3D 10 Return Codes.
Test a pass to see if it contains valid syntax.
Get a pass description.
A pass is a block of code that sets render state and shaders (which in turn sets constant buffers, samplers and textures). An effect technique contains one or more passes. See techniques and passes.
Get a vertex-shader description.
An effect pass can contain render state assignments and shader object assignments.
Get a geometry-shader description.
An effect pass can contain render state assignments and shader object assignments.
Get a pixel-shader description.
An effect pass can contain render state assignments and shader object assignments.
Describes an effect pass, which contains pipeline state.
Get a pass description by calling
A string that contains the name of the pass; otherwise
The number of annotations.
A reference to the input signature or the vertex shader; otherwise
The size of the input signature (in bytes).
The stencil-reference value used in the depth-stencil state (see Configuring Depth-Stencil Functionality (Direct3D 10)).
The sample mask for the blend state (see Configuring Blending Functionality (Direct3D 10)).
The per-component blend factors (RGBA) for the blend state (see Configuring Blending Functionality (Direct3D 10)).
Describes an effect variable that contains a shader.
To get a shader description, call a method like
A reference to the variable that the shader came from. If it is an inline shader assignment, the returned interface will be an anonymous shader variable, which is not retrievable any other way. Its name in the variable description will be "$Anonymous". If there is no assignment of this type in the pass block, this will point to a shader variable that returns false when IsValid is called.
A zero-based array index; otherwise 0.
A pool interface represents a common memory space (or pool) for sharing variables between effects.
To create an effect pool, call a function like
Get the effect that created the effect pool.
A reference to an
A rasterizer-variable interface accesses rasterizer state.
An
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. You can use either of these methods to return state. For examples, see Two Ways to Get the State in an Effect Variable.
Get a reference to a rasterizer interface.
Index into an array of rasterizer interfaces. If there is only one rasterizer interface, use 0.
The address of a reference to a rasterizer interface (see
Get a reference to a variable that contains rasteriser state.
Index into an array of rasteriser-state descriptions. If there is only one rasteriser variable in the effect, use 0.
A reference to a rasteriser-state description (see
Returns one of the following Direct3D 10 Return Codes.
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. Backing store data can used to recreate the variable when necessary.
Get an array of render-targets.
Set a render-target.
A reference to a render-target-view interface. See
Returns one of the following Direct3D 10 Return Codes.
Get a render-target.
The address of a reference to a render-target-view interface. See
Set an array of render-targets.
Set an array of render-target-view interfaces. See
The zero-based array index to store the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Set an array of render-targets.
Set an array of render-target-view interfaces. See
The zero-based array index to store the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Get an array of render-targets.
A reference to an array of render-target-view interfaces. See
The zero-based array index to get the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
A sampler interface accesses sampler state.
An
Effect variables are saved in memory in the backing store; when a technique is applied, the values in the backing store are copied to the device. You can use either of these methods to return state. For examples, see Two Ways to Get the State in an Effect Variable.
Get a reference to a sampler interface.
Index into an array of sampler interfaces. If there is only one sampler interface, use 0.
The address of a reference to a sampler interface (see
Get a reference to a variable that contains sampler state.
Index into an array of sampler descriptions. If there is only one sampler variable in the effect, use 0.
A reference to a sampler description (see
Returns one of the following Direct3D 10 Return Codes.
Describes an effect shader.
To get an effect-shader description, call
Passed into CreateInputLayout. Only valid on a vertex shader or geometry shader. See ID3D10Device_CreateInputLayout.
A reference to the compiled shader.
The length of pBytecode.
A string that constains a declaration of the stream output from a geometry shader.
The number of entries in the input signature.
The number of entries in the output signature.
TRUE is the shader is defined inline; otherwise
A shader-resource interface accesses a shader resource.
Set a shader resource.
The address of a reference to a shader-resource-view interface. See
Returns one of the following Direct3D 10 Return Codes.
Get a shader resource.
The address of a reference to a shader-resource-view interface. See
Set an array of shader resources.
The address of an array of shader-resource-view interfaces. See
The zero-based array index to get the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Set an array of shader resources.
The address of an array of shader-resource-view interfaces. See
The zero-based array index to get the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Get an array of shader resources.
The address of an array of shader-resource-view interfaces. See
The zero-based array index to get the first interface.
The number of elements in the array.
Returns one of the following Direct3D 10 Return Codes.
Get an array of floating-point variables.
Set a floating-point variable.
A reference to the variable.
Returns one of the following Direct3D 10 Return Codes.
Get a floating-point variable.
A reference to the variable.
Set an array of floating-point variables.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of floating-point variables.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Set an integer variable.
A reference to the variable.
Returns one of the following Direct3D 10 Return Codes.
Get an integer variable.
A reference to the variable.
Set an array of integer variables.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of integer variables.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Set a boolean variable.
A reference to the variable.
Returns one of the following Direct3D 10 Return Codes.
Get a boolean variable.
A reference to the variable.
Returns one of the following Direct3D 10 Return Codes.
Set an array of boolean variables.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of boolean variables.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
A string-variable interface accesses a string variable.
Get the string.
A reference to the string.
Returns one of the following Direct3D 10 Return Codes.
Get an array of strings.
A reference to the first string in the array.
The offset (in number of strings) between the start of the array and the first string to get.
The number of strings in the returned array.
Returns one of the following Direct3D 10 Return Codes.
A vector-variable interface accesses a four-component vector.
Set a four-component vector that contains boolean data.
A reference to the first component.
Returns one of the following Direct3D 10 Return Codes.
Set a four-component vector that contains integer data.
A reference to the first component.
Returns one of the following Direct3D 10 Return Codes.
Set a four-component vector that contains floating-point data.
A reference to the first component.
Returns one of the following Direct3D 10 Return Codes.
Get a four-component vector that contains boolean data.
A reference to the first component.
Returns one of the following Direct3D 10 Return Codes.
Get a four-component vector that contains integer data.
A reference to the first component.
Returns one of the following Direct3D 10 Return Codes.
Get a four-component vector that contains floating-point data.
A reference to the first component.
Returns one of the following Direct3D 10 Return Codes.
Set an array of four-component vectors that contain boolean data.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Set an array of four-component vectors that contain integer data.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Set an array of four-component vectors that contain floating-point data.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of four-component vectors that contain boolean data.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of four-component vectors that contain integer data.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
Get an array of four-component vectors that contain floating-point data.
A reference to the start of the data to set.
Must be set to 0; this is reserved for future use.
The number of array elements to set.
Returns one of the following Direct3D 10 Return Codes.
The
The
The LPD3DX10FONT type is defined as a reference to the
typedef interface ;
typedef interface *LPD3DX10FONT;
Retrieve the Direct3D device associated with the font object.
Address of a reference to an
If the method succeeds, the return value is
Note??Calling this method will increase the internal reference count on the
Get a description of the current font object.
Pointer to a
If the method succeeds, the return value is
This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the D3DX10FONT_DESCA structure.
Retrieve font characteristics.
Pointer to a
Nonzero if the function is successful; otherwise 0.
Return a handle to a display device context (DC) that has the font set onto it.
Handle to a display DC.
Return information about the placement and orientation of a glyph in a character cell.
Glyph identifier.
Address of a reference to a ID3D10Texture object that contains the glyph.
Pointer to the smallest rectangle object that completely encloses the glyph. See
Pointer to the two-dimensional vector that connects the origin of the current character cell to the origin of the next character cell. See
If the method succeeds, the return value is
Load a series of characters into video memory to improve the efficiency of rendering to the device.
ID of the first character to be loaded into video memory.
ID of the last character to be loaded into video memory.
If the method succeeds, the return value is
This method generates textures containing glyphs that represent the input characters. The glyphs are drawn as a series of triangles.
Characters will not be rendered to the device;
This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.
Load a series of glyphs into video memory to improve the efficiency of rendering to the device.
ID of the first glyph to be loaded into video memory.
ID of the last glyph to be loaded into video memory.
If the method succeeds, the return value is
This method generates textures that contain the input glyphs. The glyphs are drawn as a series of triangles.
Glyphs will not be rendered to the device;
Load formatted text into video memory to improve the efficiency of rendering to the device. This method supports ANSI and Unicode strings.
Pointer to a string of characters to be loaded into video memory. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR; otherwise, the data type resolves to LPCSTR. See Remarks.
Number of characters in the text string.
If the method succeeds, the return value is
The compiler setting also determines the function version. If Unicode is defined, the function call resolves to PreloadTextW. Otherwise, the function call resolves to PreloadTextA because ANSI strings are being used.
This method generates textures that contain glyphs that represent the input text. The glyphs are drawn as a series of triangles.
Text will not be rendered to the device;
This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.
Draw formatted text. This method supports ANSI and Unicode strings.
Pointer to an
Pointer to a string to draw. If UNICODE is defined, this parameter type resolves to an LPCWSTR, otherwise, the type resolves to an LPCSTR. If the Count parameter is -1, the string must be
The number of characters in the string. If Count is -1, then the pString parameter is assumed to be a reference to a sprite containing a
Pointer to a
Specify the method of formatting the text. It can be any combination of the following values:
Item | Description |
---|---|
DT_BOTTOM | Justify the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. |
DT_CALCRECT | Tell DrawText to automatically calculate the width and height of the rectangle based on the length of the string you tell it to draw. If there are multiple lines of text, |
DT_CENTER | Center text horizontally in the rectangle. |
DT_EXPANDTABS | Expand tab characters. The default number of characters per tab is eight. |
DT_LEFT | Align text to the left. |
DT_NOCLIP | Draw without clipping. |
DT_RIGHT | Align text to the right. |
DT_RTLREADING | Display text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. |
DT_SINGLELINE | Display text on a single line only. Carriage returns and line feeds do not break the line. |
DT_TOP | Top-justify text. |
DT_VCENTER | Center text vertically (single line only). |
DT_WORDBREAK | Break words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. |
?
Color of the text. See
If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero.
The parameters of this method are very similar to those of the GDI DrawText function.
This method supports both ANSI and Unicode strings.
Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.
If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.
This method supports only fonts whose escapement and orientation are both zero.
Retrieve the Direct3D device associated with the font object.
Note??Calling this method will increase the internal reference count on the
Get a description of the current font object.
This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the D3DX10FONT_DESCA structure.
Return a handle to a display device context (DC) that has the font set onto it.
Identifies how to bind a resource to the pipeline.
In general, binding flags can be combined using a logical OR (except the constant-buffer flag); however, you should use a single flag to allow the device to optimize the resource usage.
This enumeration is used by a:
A shader-resource buffer is NOT a constant buffer; rather, it is a texture or buffer resource that is bound to a shader, that contains texture or buffer data (it is not limited to a single element type in the buffer). A shader-resource buffer is created with the
Bind a buffer as a vertex buffer to the input-assembler stage.
Bind a buffer as an index buffer to the input-assembler stage.
Bind a buffer as a constant buffer to a shader stage; this flag may NOT be combined with any other bind flag.
Bind a buffer or texture to a shader stage; this flag cannot be used with the
Bind an output buffer for the stream-output stage.
Bind a texture as a render target for the output-merger stage.
Bind a texture as a depth-stencil target for the output-merger stage.
RGB or alpha blending operation.
The runtime implements RGB blending and alpha blending separately. Therefore, blend state requires separate blend operations for RGB data and alpha data. These blend operations are specified in a blend description. The two sources ? Source 1, called SrcBlend and SrcBlendAlpha, and Source 2, called DestBlend and DestBlendAlpha ? are shown in the blending block diagram.
Add source 1 and source 2.
Subtract source 1 from source 2.
Subtract source 2 from source 1.
Find the minimum of source 1 and source 2.
Find the maximum of source 1 and source 2.
Blend options. A blend option identifies the data source and an optional pre-blend operation.
Blend operations are specified in a blend description.
The data source is the color black (0, 0, 0, 0). No pre-blend operation.
The data source is the color white (1, 1, 1, 1). No pre-blend operation.
The data source is color data (RGB) from a pixel shader. No pre-blend operation.
The data source is color data (RGB) from a pixel shader. The pre-blend operation inverts the data, generating 1 - RGB.
The data source is alpha data (A) from a pixel shader. No pre-blend operation.
The data source is alpha data (A) from a pixel shader. The pre-blend operation inverts the data, generating 1 - A.
The data source is alpha data from a rendertarget. No pre-blend operation.
The data source is alpha data from a rendertarget. The pre-blend operation inverts the data, generating 1 - A.
The data source is color data from a rendertarget. No pre-blend operation.
The data source is color data from a rendertarget. The pre-blend operation inverts the data, generating 1 - RGB.
The data source is alpha data from a pixel shader. The pre-blend operation clamps the data to 1 or less.
The data source is the blend factor set with
The data source is the blend factor set with
The data sources are both color data output by a pixel shader. There is no pre-blend operation. This options supports dual-source color blending.
The data sources are both color data output by a pixel shader. The pre-blend operation inverts the data, generating 1 - RGB. This options supports dual-source color blending.
The data sources are alpha data output by a pixel shader. There is no pre-blend operation. This options supports dual-source color blending.
The data sources are alpha data output by a pixel shader. The pre-blend operation inverts the data, generating 1 - A. This options supports dual-source color blending.
These flags are used by functions which operate on one or more channels in a texture.
Indicates the red channel should be used.
Indicates the blue channel should be used.
Indicates the green channel should be used.
Indicates the alpha channel should be used.
Indicates the luminaces of the red, green, and blue channels should be used.
Identify which components of each pixel of a render target are writable during blending.
These flags can be combined with a bitwise OR.
Comparison options.
A comparison option determines whether how the runtime compares source (new) data against destination (existing) data before storing the new data. The comparison option is declared in a description before an object is created. The API allows you to set a comparison option for a depth-stencil buffer (see
Never pass the comparison.
If the source data is less than the destination data, the comparison passes.
If the source data is equal to the destination data, the comparison passes.
If the source data is less than or equal to the destination data, the comparison passes.
If the source data is greater than the destination data, the comparison passes.
If the source data is not equal to the destination data, the comparison passes.
If the source data is greater than or equal to the destination data, the comparison passes.
Always pass the comparison.
Performance counter types.
In addition to these performance counters, independent hardware vendors may define their own set of performance counters for their devices. The enum values for these counters would start after
A device can support one or more of these performance counters, but it is not required to support any of them.
Percentage of the time that the GPU is idle.
Percentage of the time that the GPU does vertex processing.
Percentage of the time that the GPU does geometry processing.
Percentage of the time that the GPU does pixel processing.
Percentage of the time that the GPU does other processing (not vertex, geometry, or pixel processing).
Percentage of bandwidth used on a host adapter. Value returned by
Percentage of bandwidth used by the local video memory. Value returned by
Percentage of throughput used for vertices. Value returned by
Percentage of throughput used for triangle setup. Value returned by
Percentage of throughput used for the fillrate. Value returned by
Percentage of time that a vertex shader spends sampling resources.
Percentage of time that a vertex shader spends doing computations.
Percentage of time that a geometry shader spends sampling resources.
Percentage of time that a geometry shader spends doing computations.
Percentage of time that a pixel shader spends sampling resources.
Percentage of time that a pixel shader spends doing computations.
Percentage of vertex data that was read from the vertex cache. For example, if 6 vertices were added to the cache and 3 of them were read from the cache, then the hit rate would be 0.5.
Percentage of texel data that was read from the vertex cache. For example, if 6 texels were added to the cache and 3 of them were read from the cache, then the hit rate would be 0.5.
Start of the device-dependent counters. See remarks.
Data type of a performance counter.
These flags are an output parameter in
32-bit floating point.
16-bit unsigned integer.
32-bit unsigned integer.
64-bit unsigned integer.
Specifies the types of CPU access allowed for a resource.
This enumeration is used in
Applications can combine one or more of these flags with a bitwise OR. When possible, create resources with no CPU access flags, as this enables better resource optimization.
The resource is to be mappable so that the CPU can change its contents. Resources created with this flag cannot be set as outputs of the pipeline and must be created with either dynamic or staging usage (see
The resource is to be mappable so that the CPU can read its contents. Resources created with this flag cannot be set as either inputs or outputs to the pipeline and must be created with staging usage (see
Indicates triangles facing a particular direction are not drawn.
This enumeration is part of a rasterizer-state object description (see
Always draw all triangles.
Do not draw triangles that are front-facing.
Do not draw triangles that are back-facing.
Specifies the parts of the depth stencil to clear. Usually used with
These flags can be bitwise ORed together.
Specifies how to access a resource used in a depth-stencil view.
This enumeration is used in
Identify the portion of a depth-stencil buffer for writing depth data.
Device creation flags.
Device creation flags are used by
An application might dynamically create (and destroy) threads to improve performance especially on a machine with multiple CPU cores. There may be cases, however, when an application needs to prevent extra threads from being created. This can happen when you want to simplify debugging, profile code or develop a tool for instance. For these cases, use
Use this flag if an application will only be calling D3D10 from a single thread. If this flag is not specified, the default behavior of D3D10 is to enter a lock during each API call to prevent multiple threads altering internal state. By using this flag no locks will be taken which can slightly increase performance, but could result in undefine behavior if D3D10 is called from multiple threads.
Create a device that supports the debug layer.
Create both a software (REF) and hardware (HAL) version of the device simultaneously, which allows an application to switch to a reference device to enable debugging. See
Prevents multiple threads from being created. When this flag is used with a WARP device, no additional threads will be created by WARP and all rasterization will occur on the calling thread. This flag is not recommended for general use. See remarks.
Return a
Causes device creation to fail if BGRA support is not available.
BGRA support enables the following formats.
Note that BGRA support may be present even if the application didn't specify
Reserved. This flag is currently not supported. Do not use.
The device-driver type.
The device-driver type needs to be specified when the device is created (using
For information about limitations creating nonhardware-type devices on certain feature levels, see Limitations Creating WARP and Reference Devices.
A hardware device; commonly called a HAL device.
A reference device; commonly called a REF device.
A
Reserved for later use.
A WARP driver, which is a high-performance software rasterizer. The rasterizer supports feature level 9_1 through level 10.1 with a high performance software implementation when hardware is not available. For more information about using a WARP driver, see Windows Advanced Rasterization Platform (WARP) In-Depth Guide. Note that WARP is only available with the DirectX 11 Runtime (Windows 7, Windows Server 2008 R2, updated Windows Vista [KB971644]).
The version of hardware acceleration requested.
Use this enumeration when creating a device with
Note that 10level9 feature levels 9_1, 9_2, and 9_3 are only available with the Direct3D 11 runtime (Windows?7, Windows Server?2008?R2, updated Windows?Vista with Service Pack?2 (SP2) [KB 971644], and updated Windows Server?2008 [KB 971512]).
For information about limitations creating nonhardware-type devices on certain feature levels, see Limitations Creating WARP and Reference Devices.
For an overview of the capabilities of each feature level, see Overview For Each Feature Level.
The hardware supports Direct3D 10.0 features.
The hardware supports Direct3D 10.1 features.
The hardware supports 9.1 feature level.
The hardware supports 9.2 feature level.
The hardware supports 9.3 feature level.
Determines the fill mode to use when rendering triangles.
This enumeration is part of a rasterizer-state object description (see
Draw lines connecting the vertices. Adjacent vertices are not drawn.
Fill the triangles formed by the vertices. Adjacent vertices are not drawn.
Filtering options during texture sampling.
During texture sampling, one or more texels are read and combined (this is calling filtering) to produce a single value. Point sampling reads a single texel while linear sampling reads two texels (endpoints) and linearly interpolates a third value between the endpoints.
HLSL texture-sampling functions also support comparison filtering during texture sampling. Comparison filtering compares each sampled texel against a comparison value. The boolean result is blended the same way that normal texture filtering is blended.
You can use HLSL intrinsic texture-sampling functions that implement texture filtering only or companion functions that use texture filtering with comparison filtering.
Texture Sampling Function | Texture Sampling Function with Comparison Filtering |
---|---|
sample | samplecmp or samplecmplevelzero |
?
Comparison filters only work with textures that have the following formats: R32_FLOAT_X8X24_TYPELESS, R32_FLOAT, R24_UNORM_X8_TYPELESS, R16_UNORM.
Use point sampling for minification, magnification, and mip-level sampling.
Use point sampling for minification and magnification; use linear interpolation for mip-level sampling.
Use point sampling for minification; use linear interpolation for magnification; use point sampling for mip-level sampling.
Use point sampling for minification; use linear interpolation for magnification and mip-level sampling.
Use linear interpolation for minification; use point sampling for magnification and mip-level sampling.
Use linear interpolation for minification; use point sampling for magnification; use linear interpolation for mip-level sampling.
Use linear interpolation for minification and magnification; use point sampling for mip-level sampling.
Use linear interpolation for minification, magnification, and mip-level sampling.
Use anisotropic interpolation for minification, magnification, and mip-level sampling.
Use point sampling for minification, magnification, and mip-level sampling. Compare the result to the comparison value.
Use point sampling for minification and magnification; use linear interpolation for mip-level sampling. Compare the result to the comparison value.
Use point sampling for minification; use linear interpolation for magnification; use point sampling for mip-level sampling. Compare the result to the comparison value.
Use point sampling for minification; use linear interpolation for magnification and mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification; use point sampling for magnification and mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification; use point sampling for magnification; use linear interpolation for mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification and magnification; use point sampling for mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification, magnification, and mip-level sampling. Compare the result to the comparison value.
Use anisotropic interpolation for minification, magnification, and mip-level sampling. Compare the result to the comparison value.
For use in pixel shaders with textures that have the R1_UNORM format.
Texture filtering flags.
D3DX10 automatically performs gamma correction (to convert color data from RGB space to standard RGB space) when loading texture data. This is automatically done for instance when RGB data is loaded from a .png file into an sRGB texture. Use the SRGB filter flags to indicate if the data does not need to be converted into sRGB space.
No scaling or filtering will take place. Pixels outside the bounds of the source image are assumed to be transparent black.
Each destination pixel is computed by sampling the nearest pixel from the source image.
Each destination pixel is computed by sampling the four nearest pixels from the source image. This filter works best when the scale on both axes is less than two.
Every pixel in the source image contributes equally to the destination image. This is the slowest of the filters.
Each pixel is computed by averaging a 2x2(x2) box of pixels from the source image. This filter works only when the dimensions of the destination are half those of the source, as is the case with mipmaps.
Pixels off the edge of the texture on the u-axis should be mirrored, not wrapped.
Pixels off the edge of the texture on the v-axis should be mirrored, not wrapped.
Pixels off the edge of the texture on the w-axis should be mirrored, not wrapped.
Specifying this flag is the same as specifying the
The resulting image must be dithered using a 4x4 ordered dither algorithm. This happens when converting from one format to another.
Do diffuse dithering on the image when changing from one format to another.
Input data is in standard RGB (sRGB) color space. See remarks.
Output data is in standard RGB (sRGB) color space. See remarks.
Same as specifying
Types of magnification or minification sampler filters.
Point filtering used as a texture magnification or minification filter. The texel with coordinates nearest to the desired pixel value is used. The texture filter to be used between mipmap levels is nearest-point mipmap filtering. The rasterizer uses the color from the texel of the nearest mipmap texture.
Bilinear interpolation filtering used as a texture magnification or minification filter. A weighted average of a 2 x 2 area of texels surrounding the desired pixel is used. The texture filter to use between mipmap levels is trilinear mipmap interpolation. The rasterizer linearly interpolates pixel color, using the texels of the two nearest mipmap textures.
Which resources are supported for a given format and given device (see
Image file formats supported by D3DXCreatexxx and D3DX10Savexxx functions.
See Types of Bitmaps (GDI+) for more information on some of these formats.
D3DX10 makes use of the Windows Imaging Component to implement the majority of the supported bitmap file types. See Windows Imaging Component Overview for additional information.
Windows bitmap (BMP) file format. Contains a header that describes the resolution of the device on which the rectangle of pixels was created, the dimensions of the rectangle, the size of the array of bits, a logical palette, and an array of bits that defines the relationship between pixels in the bitmapped image and entries in the logical palette. The file extension for this format is .bmp.
Joint Photographic Experts Group (JPEG) compressed file format. Specifies variable compression of 24-bit RGB color and 8-bit gray-scale Tagged Image File Format (TIFF) image document files. The file extension for this format is .jpg.
Portable Network Graphics (PNG) file format. A non-proprietary bitmap format using lossless compression. The file extension for this format is .png.
DirectDraw surface (DDS) file format. Stores textures, volume textures, and cubic environment maps, with or without mipmap levels, and with or without pixel compression. The file extension for this format is .dds.
Tagged Image File Format (TIFF). The file extensions for this format are .tif and .tiff.
Graphics Interchange Format (GIF).The file extension for this format is .gif.
Windows Media Photo format (WMP). This format is also known as HD Photo and JPEG XR. The file extensions for this format are .hdp, .jxr, and .wdp.
To work properly,
Type of data contained in an input slot.
Use these values to specify the type of data for a particular input element (see
Input data is per-vertex data.
Input data is per-instance data.
Specifies how the CPU should respond when Map is called on a resource being used by the GPU.
This enumeration is used by
For more information about potential conflicts between the GPU and CPU during resource mapping, see Copying and Accessing Resource Data (Direct3D 10).
Specifies that Map should return
Identifies a resource to be accessed for reading and writing by the CPU. Applications may combine one or more of these flags.
This enumeration is used in
These remarks are divided into the following topics:
For example, consider the buffer illustrated in the following diagram. If a Draw call has been issued that uses vertices 4-6, an application that calls Map on this buffer must ensure that it does not write to the vertices that the Draw call will access during rendering.
However, ensuring this can be difficult, because the GPU is often many frames behind the CPU in terms of which frame it is currently processing. Keeping track of which sections of a resource are being used because of calls made 2 to 5 frames ago is difficult and error-prone. Because of this, it is recommended that applications only write to the uninitialized portions of a resource when using
A common use of these two flags involves filling dynamic index/vertex buffers with geometry that can be seen from the camera's current position. The first time that data is entered into the buffer on a given frame, Map is called with
Subsequent writes to the buffer within the same frame should use
Resource is mapped for reading. The resource must have been created with read access (see
Resource is mapped for writing. The resource must have been created with write access (see
Resource is mapped for reading and writing. The resource must have been created with read and write access (see
Resource is mapped for writing; the previous contents of the resource will be undefined. The resource must have been created with write access (see
Resource is mapped for writing; the existing contents of the resource cannot be overwritten (see Remarks). This flag is only valid on vertex and index buffers. The resource must have been created with write access (see
Specifies which pieces of mesh data to discard from the device. Used with
Flags used to specify creation options for a mesh.
A 32-bit mesh (
The mesh has 32-bit indices instead of 16-bit indices. See Remarks.
Signals that the mesh contains geometry shader adjacency data.
Specifies the type of mesh optimization to be performed.
The
The D3DXMESHOPT_SHAREVB flag has been removed from this enumeration. Use
Reorders faces to remove unused vertices and faces.
Reorders faces to optimize for fewer attribute bundle state changes and enhanced DrawSubset performance.
Reorders faces to increase the cache hit rate of vertex caches.
Reorders faces to maximize length of adjacent triangles.
Optimize the faces only; do not optimize the vertices.
While attribute sorting, do not split vertices that are shared between attribute groups.
Affects the vertex cache size. Using this flag specifies a default vertex cache size that works well on legacy hardware.
Categories of debug messages. This will identify the category of a message when retrieving a message with
This is part of the Information Queue feature. See
Debug message severity levels for an information queue.
Use these values to allow or deny message categories to pass through the storage and retrieval filters for an information queue (see
Defines some type of corruption which has occurred.
Defines an error message.
Defines a warning message.
Defines an information message.
These flags are used to control how
Flags that describe miscellaneous query behavior.
This flag is part of a query description (see
Tell the hardware that if it is not yet sure if something is hidden or not to draw it anyway. This is only used with an occlusion predicate. Predication data cannot be returned to your application via
Query types.
Determines whether or not the GPU is finished processing commands. When the GPU is finished processing commands GetData will return
Get the number of samples that passed the depth and stencil tests in between Begin and End. GetData returns a UINT64. If a depth or stencil test is disabled, then each of those tests will be counted as a pass.
Get a timestamp value where GetData returns a UINT64. This kind of query is only useful if two timestamp queries are done in the middle of a
Determines whether or not a
Get pipeline statistics, such as the number of pixel shader invocations in between Begin and End. GetData will return a
Similar to
Get streaming output statistics, such as the number of primitives streamed out in between Begin and End. GetData will return a
Determines whether or not any of the streaming output buffers overflowed in between Begin and End. GetData returns a
Specifies how to access a resource used in a render-target view.
This enumeration is used in
Identifies the type of resource being used.
This enumeration is used in
Identifies other, less common options for resources.
This enumeration is used in
These flags can be combined by bitwise OR.
Enables an application to call
Enables the sharing of resource data between two or more Direct3D devices. The only resources that can be shared are 2D non-mipmapped textures.
WARP and REF devices do not support shared resources. Attempting to create a resource with this flag on either a WARP or REF device will cause the create method to return an E_OUTOFMEMORY error code.
Enables an application to create a cube texture from a Texture2DArray that contains 6 textures.
Enables the resource created to be synchronized using the
If any of the listed functions are called with the
WARP and REF devices do not support shared resources. Attempting to create a resource with this flag on either a WARP or REF device will cause the create method to return an E_OUTOFMEMORY error code.
Enables a surface to be used for GDI interoperability. Setting this flag enables rendering on the surface via
Identifies expected resource use during rendering. The usage directly reflects whether a resource is accessible by the CPU and/or the GPU.
An application identifies the way a resource is intended to be used (its usage) in a resource description. There are several structures for creating resources including:
Differences between Direct3D 9 and Direct3D 10: In Direct3D 9, you specify the type of memory a resource should be created in at resource creation time (using In Direct3D 10, an application no longer specifies what type of memory (the pool) to create a resource in. Instead, you specify the intended usage of the resource, and let the runtime (in concert with the driver and a memory manager) choose the type of memory that will achieve the best performance. |
?
Resource Usage RestrictionsEach usage dictates a tradeoff between functionality and performance. In general, resource accessing is accomplished with the following APIs.
Use the following table to choose the usage that best describes how the resource will need to be accessed by the CPU and/or the GPU. Of course, there will be performance tradeoffs.
Resource Usage | Default | Dynamic | Immutable | Staging |
---|---|---|---|---|
GPU-Read | yes | yes1 | yes | yes1, 2 |
GPU-Write | yes1 | yes1, 2 | ||
CPU-Read | yes1, 2 | |||
CPU-Write | yes | yes1, 2 |
?
To maximize performance, not all resource usage options can be used as input or output resources to the pipeline. This table identifies these limitations.
Resource Can Be Bound As | Default | Dynamic | Immutable | Staging |
---|---|---|---|---|
Input to a Stage | yes3 | yes4 | yes | |
Output from a Stage | yes3 |
?
A resource that requires read and write access by the GPU. This is likely to be the most common usage choice.
A resource that can only be read by the GPU. It cannot be written by the GPU, and cannot be accessed at all by the CPU. This type of resource must be initialized when it is created, since it cannot be changed after creation.
A resource that is accessible by both the GPU and the CPU (write only). A dynamic resource is a good choice for a resource that will be updated by the CPU at least once per frame. To write to a dynamic resource on the CPU, use a Map method. You can write to a dynamic resource on the GPU using CopyResource or CopySubresourceRegion.
A resource that supports data transfer (copy) from the GPU to the CPU.
Sprite flags that tell the sprite drawing API how to behave. These are passed into
After a front-to-back or back-to-front sort is done, it will automatically do a secondary sort by texture. This is helpful for when there are many sprites with the same texture all on the same plane, such as when drawing the user interface in a game.
The stencil operations that can be performed during depth-stencil testing.
Identify a technique for resolving texture coordinates that are outside of the boundaries of a texture.
Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times.
Flip the texture at every integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on.
Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.
Texture coordinates outside the range [0.0, 1.0] are set to the border color specified in
Similar to
The different faces of a cube texture.
Positive X face.
Negative X face.
Positive Y face.
Negative Y face.
Positive Z face.
Negative Z face.
Create a Direct3D 10.1 device and a swap chain.
Pointer to a
The type of driver for the device. See
A handle to the DLL that implements a software rasterizer. Must be
Optional. Device creation flags (see
The version of hardware that is available for acceleration (see
Bit flag that indicates the version of the SDK. Should be
Description of the swap chain. See
Address of a reference to an
Address of a reference to an
This method returns one of the following Direct3D 10 Return Codes.
To create a device without creating a swap chain, see
This method requires Windows Vista Service Pack 1, Windows Server 2008, or later release of Windows.
Create a Direct3D 10.1 device that represents the display adapter.
Pointer to the display adapter (see
The device-driver type (see
This is set to
Optional. Device creation flags (see
The version of hardware that is available for acceleration (see
Bit flag that indicates the version of the SDK. Should be
Address of a reference to the device created (see
This method returns one of the following Direct3D 10 Return Codes.
To create a device and a swap chain at the same time, see
This method requires Windows Vista Service Pack 1, Windows Server 2008, or later release of Windows.
The object returned by
* pDXGIDevice;
hr = g_pd3dDevice->QueryInterface(__uuidof( ), (void **)&pDXGIDevice);
Create an effect pool (or shared memory location), to enable sharing variables between effects.
A reference to a compiled effect.
Length of pData.
Effect compile options.
A reference to the device (see
A reference to the
Returns one of the following Direct3D 10 Return Codes.
A pool is a shared location in memory. Effect variables that are located in a pool can be updated once, and the effect system will take care of updating each effect that uses that variable. To pool an effect variable, tell the effect to locate the variable in a pool when the effect is created, using a helper function such as
For help compiling an effect, see Compile an Effect (Direct3D 10).
Create a state block.
The device for which the state block will be created.
Indicates which parts of the device state will be captured when calling
Address of a reference to the buffer created (see
This method returns one of the following Direct3D 10 Return Codes.
A state block is a collection of device state, and is used for saving and restoring device state. Use a state-block mask to enable subsets of state for saving and restoring.
The
Differences between Direct3D 9 and Direct3D 10: In Direct3D 10, a state block object does not contain any valid information about the state of the device until |
?
Compile an effect.
Note??Use D3DX10CompileFromMemory instead of this function.
Returns one of the following Direct3D 10 Return Codes.
This function uses the version of the HLSL compiler released in the November 2006 DirectX SDK.
For an example, see Compile an Effect (Direct3D 10).
Creates an
A reference to a compiled effect.
Length of pData.
Effect compile options.
A reference to the device (see
Optional. A reference to an memory space for effect variables that are shared across effects (see
A reference to an
Returns one of the following Direct3D 10 Return Codes.
This method is used to create an
Create a Direct3D 10.0 device and a swap chain.
Pointer to a
The type of driver for the device. See
A handle to the DLL that implements a software rasterizer. Must be
Optional. Device creation flags (see
Bit flag that indicates the version of the SDK. Should be
Description of the swap chain. See
Address of a reference to an
Address of a reference to an
This method returns one of the following Direct3D 10 Return Codes.
To create a device without creating a swap chain, see
Create a Direct3D 10.0 device that represents the display adapter.
Pointer to the display adapter (see
The device-driver type (see
Reserved. Set to
Optional. Device creation flags (see
Bit flag that indicates the version of the SDK. Should always be
Address of a reference to the device created (see
This method returns one of the following Direct3D 10 Return Codes.
This example creates a reference device.
* g_pd3dDevice = null ;
( null , , null , 0, , &g_pd3dDevice );
To create a device and a swap chain at the same time, see
The object returned by
* pDXGIDevice;
hr = g_pd3dDevice->QueryInterface(__uuidof( ), (void **)&pDXGIDevice);
Get the vertex shader profile best suited to a given device.
The shader profile.
Get the geometry shader profile best suited to a given device.
The shader profile.
Get the pixel shader profile best suited to a given device.
The shader profile.
Get a Direct3D 10.1 device interface reference from a Direct3D 10.0 interface reference.
Pointer to the Direct3D 10.0 device (see the
Pointer to the Direct3D 10.1 device (see the
This function returns one of the following Direct3D 10 Return Codes. If a Direct3D 10.1 device interface can be acquired, this function succeeds and passes a reference to the 10.1 interface using the ppDevice parameter. If a Direct3D 10.1 device interface cannot be acquired, this function returns E_FAIL, and will not return anything for the ppDevice parameter.
For this function to succeed, you must have acquired the supplied
You can only create a Direct3D 10.1 device on computers running Windows Vista Service Pack 1 or later, and with Direct3D 10.1-compatible hardware installed. This function will return E_FAIL on any computer not meeting these requirements. However, you can call this function on any version of Windows that has the D3DX10 DLL installed.
Creates a font object for a device and font.
Pointer to an
The height of the characters in logical units.
The width of the characters in logical units.
Typeface weight. One example is bold.
The number of mipmap levels.
True for italic font, false otherwise.
The character set of the font.
Specifies how Windows should attempt to match the desired font sizes and characteristics with actual fonts. Use OUT_TT_ONLY_PRECIS for instance, to ensure that you always get a TrueType font.
Specifies how Windows should match the desired font with a real font. It applies to raster fonts only and should not affect TrueType fonts.
Pitch and family index.
String containing the typeface name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR. See Remarks.
Returns a reference to an
If the function succeeds, the return value is
The compiler setting also determines the function version. If Unicode is defined, the function call resolves to
If you want more information about font parameters, see The Logical Font.
Creates a font object.
Pointer to an
Pointer to a
Returns a reference to an
The return value is one of the values listed in Direct3D 10 Return Codes.
Create the best Direct3D device and a swap chain.
Pointer to a
The type of driver for the device. See
A handle to the DLL that implements a software rasterizer. Must be
Optional. Device creation flags (see
Description of the swap chain. See
Address of a reference to an
Address of a reference to an
This method returns one of the following Direct3D 10 Return Codes.
To create the best device, this method implements more than one device creation option. First, the method attempts to create a 10.1 device (and swap chain). If that fails, the method attempts to create a 10.0 device. If that fails, the method will fail. If your application needs to create only a 10.1 device, or a 10.0 device only, use these APIs instead:
This method requires Windows Vista Service Pack 1.
Create a sprite for drawing a 2D texture.
A reference to the device (see
The size of the vertex buffer, in number of sprites, that will be sent to the device when
The address of a reference to a sprite interface (see
If the function succeeds, the return value is
Verify that the version of D3DX you compiled with is the version that you are running.
Use
Use D3DX10_SDK_VERSION. See remarks.
If the version doesn't match, the function will return
Use this function during the initialization of your application.
hr; if( FAILED( ( , D3DX10_SDK_VERSION) ) ) return E_FAIL;
Create the best Direct3D 10 device that represents the display adapter. If a Direct3D 10.1-compatible device can be created, it will be possible to acquire an
This function returns one of the following Direct3D 10 Return Codes.
This function attempts to create the best device for the hardware. First, the function attempts to create a 10.1 device. If a 10.1 device cannot be created, the function attempts to create a 10.0 device. If neither device is successfully created, the function returns E_FAIL.
If your application needs to create only a 10.1 device, or a 10.0 device only, use the following functions instead:
A Direct3D 10.1 device can only be created on computers running Windows Vista Service Pack 1 or later, and with Direct3D 10.1-compatible hardware installed. However, it is legal to call this function on computers running any version of Windows that has the D3DX10 DLL installed.
Create a shader-resource view from a file.
A reference to the device (see
Name of the file that contains the shader-resource view. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
Optional. Identifies the characteristics of a texture (see
Pointer to a thread-pump interface (see
Address of a reference to the shader-resource view (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Save a texture to a file.
Pointer to the texture to be saved. See
The format the texture will be saved as (see
Name of the destination output file where the texture will be saved. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
The return value is one of the values listed in Direct3D 10 Return Codes; use the return value to see if the DestFormat is supported.
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.
Pointer to an
One or more
One
Constant value multiplier that increases (or decreases) the values in the normal map. Higher values usually make bumps more visible, lower values usually make bumps less visible.
Pointer to an
If the function succeeds, the return value is
This method computes the normal by using the central difference with a kernel size of 3x3. RGB channels in the destination contain biased (x,y,z) components of the normal. The central differencing denominator is hardcoded to 2.0.
Get information about an image already loaded into memory.
Pointer to the image in memory.
Size of the image in memory, in bytes.
Optional thread pump that can be used to load the info asynchronously. Can be
Information about the image in memory.
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Retrieves information about a given image in a resource.
Module where the resource is loaded. Set this parameter to
Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR. See Remarks.
Optional thread pump that can be used to load the info asynchronously. Can be
Pointer to a
A reference to the return value. May be
If the function succeeds, the return value is
The compiler setting also determines the function version. If Unicode is defined, the function call resolves to
Create a texture resource from a file.
A reference to the device (see
The name of the file containing the resource. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR. See
Optional. Identifies the characteristics of a texture (see
A reference to a thread pump interface (see
The address of a reference to the texture resource (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
For a list of supported image formats see
Save a texture to memory.
Pointer to the texture to be saved. See
The format the texture will be saved as. See
Address of a reference to the memory containing the saved texture. See
Optional.
The return value is one of the values listed in Direct3D 10 Return Codes.
Create a shader-resource view from a resource.
A reference to the device (see
Handle to the resource module containing the shader-resource view. HMODULE can be obtained with GetModuleHandle Function.
Name of the shader resource view in hSrcModule. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
Optional. Identifies the characteristics of a texture (see
A reference to a thread pump interface (see
Address of a reference to the shader-resource view (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Projects a function represented in a cube map into spherical harmonics.
Order of the SH evaluation, generates Order^2 coefs, degree is Order-1.
Cubemap that is going to be projected into spherical harmonics. See
Output SH vector for red.
Output SH vector for green.
Output SH vector for blue.
The return value is one of the values listed in Direct3D 10 Return Codes.
Create a texture from another resource.
A reference to the device (see
A handle to the source resource. HMODULE can be obtained with GetModuleHandle Function.
A string that contains the name of the source resource. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
Optional. Identifies the characteristics of a texture (see
A reference to a thread pump interface (see
The address of a reference to the texture resource (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
For a list of supported image formats see
Load a texture from a texture.
Pointer to the source texture. See
Pointer to texture loading parameters. See
Pointer to the destination texture. See
The return value is one of the values listed in Direct3D 10 Return Codes.
Create a shader-resource view from a file in memory.
A reference to the device (see
Pointer to the file in memory that contains the shader-resource view.
Size of the file in memory.
Optional. Identifies the characteristics of a texture (see
A reference to a thread pump interface (see
Address of a reference to the newly created shader resource view. See
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Generates mipmap chain using a particular texture filter.
The texture object to be filtered. See
The mipmap level whose data is used to generate the rest of the mipmap chain.
Flags controlling how each miplevel is filtered (or D3DX10_DEFAULT for
The return value is one of the values listed in Direct3D 10 Return Codes.
Create a texture resource from a file residing in system memory.
A reference to the device (see
Pointer to the resource in system memory.
Size of the resource in system memory.
Optional. Identifies the characteristics of a texture (see
A reference to a thread pump interface (see
Address of a reference to the created resource. See
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
For a list of supported image formats see
Retrieves information about a given image file.
File name of image to retrieve information about. If UNICODE or _UNICODE are defined, this parameter type is LPCWSTR, otherwise, the type is LPCSTR.
Optional thread pump that can be used to load the info asynchronously. Can be
Pointer to a
A reference to the return value. May be
If the function succeeds, the return value is
This function supports both Unicode and ANSI strings.
Creates a mesh object using a declarator.
Pointer to an
Array of
The number of elements in pDeclaration.
Semantic that identifies which part of the vertex declaration contains position information.
Number of vertices for the mesh. This parameter must be greater than 0.
Number of faces for the mesh. The valid range for this number is greater than 0, and one less than the maximum DWORD (typically 65534), because the last index is reserved.
Combination of one or more flags from the D3DX10_MESH, specifying options for the mesh.
Address of a reference to an
If the function succeeds, the return value is
Creates an empty skin mesh object using a declarator.
Address of a reference to an
If the function succeeds, the return value is
Use the
Create an effect pool from a resource.
A handle to the resource module containing the effect. HMODULE can be obtained with GetModuleHandle Function.
The name of the resource in hModule. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
Optional. Effect file name, which is used for error messages only. Can be
A
A reference to an include interface (see ID3D10Include Interface). This parameter can be
A string that specifies the shader profile, or shader model.
HLSL compile options (see D3D10_SHADER Constants).
Effect compile options (see Compile and Effect Flags).
A reference to the device (see
A reference to a thread pump interface (see
The address of a reference to the effect pool (see
The address of a reference to memory (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Create an effect pool from an effect file.
The effect filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
A
A reference to an include interface (see ID3D10Include Interface). This parameter can be
A string that specifies the shader profile, or shader model.
HLSL compile options (see D3D10_SHADER Constants).
Effect compile options (see Compile and Effect Flags).
A reference to the device (see
A reference to a thread pump interface (see
The address of a reference to the effect pool (see
The address of a reference to memory (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
This example creates an effect pool from the effect used in the BasicHLSL10 Sample.
// Create an effect pool from an effect in memory
* l_pEffectPool = null ;
* l_pBlob_Errors = null ;
WCHAR str[MAX_PATH];
hr = DXUTFindDXSDKMediaFileCch( str, MAX_PATH, L"BasicHLSL10.fx" );
hr = ( str, null , null , D3D10_SHADER_ENABLE_STRICTNESS, 0, pd3dDevice, null , &l_pEffectPool, &l_pBlob_Errors );
Create an effect from a file.
Name of the ASCII effect file. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
A
A reference to an include interface (see ID3D10Include Interface). This parameter can be
A string that specifies the shader profile, or shader model.
HLSL compile options (see D3D10_SHADER Constants).
Effect compile options (see Compile and Effect Flags).
A reference to the device (see
Pointer to an effect pool (see
A reference to a thread pump interface (see
Address of a reference to the effect (see
The address of a reference to memory (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Create an effect from memory.
Pointer to the effect in memory.
Size of the effect in memory.
Name of the effect file in memory.
A
A reference to an include interface (see ID3D10Include Interface). This parameter can be
A string that specifies the shader profile, or shader model.
HLSL compile options (see D3D10_SHADER Constants).
Effect compile options (see D3D10_EFFECT Constants).
A reference to the device (see
Pointer to an effect pool (see
A reference to a thread pump interface (see
Address of a reference to the effect (see
The address of a reference to memory (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
Create an effect pool from an effect in memory.
A reference to the effect.
The size of the effect.
The name of the effect file.
A
A reference to an include interface (see ID3D10Include Interface). This parameter can be
A string that specifies the shader profile, or shader model.
HLSL compile options (see D3D10_SHADER Constants).
Effect compile options (see Compile and Effect Flags).
A reference to the device (see
A reference to a thread pump interface (see
The address of a reference to the effect pool (see
The address of a reference to memory (see
A reference to the return value. May be
Returns one of the following Direct3D 10 Return Codes.
Create an effect from a resource.
A handle to the resource module containing the effect. HMODULE can be obtained with GetModuleHandle Function.
Name of the resource in hModule. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.
Optional. Effect file name, which is used for error messages only. Can be
A
A reference to an include interface (see ID3D10Include Interface). This parameter can be
A string that specifies the shader profile, or shader model.
HLSL compile options (see D3D10_SHADER Constants).
Effect compile options (see Compile and Effect Flags).
A reference to the device (see
Pointer to an effect pool (see
A reference to a thread pump interface (see
Address of a reference to the effect (see
The address of a reference to memory (see
A reference to the return value. May be
The return value is one of the values listed in Direct3D 10 Return Codes.
A constant-buffer interface accesses constant buffers or texture buffers.
Use constant buffers to store many effect constants; grouping constants into buffers based on their frequency of update. This allows you to minimize the number of state changes as well as make the fewest API calls to change state. Both of these factors lead to better performance.
Set a constant-buffer.
A reference to a constant-buffer interface. See
Returns one of the following Direct3D 10 Return Codes.
Get a constant-buffer.
The address of a reference to a constant-buffer interface. See
Set a texture-buffer.
A reference to a shader-resource-view interface for accessing a texture buffer.
Returns one of the following Direct3D 10 Return Codes.
Get a texture-buffer.
The address of a reference to a shader-resource-view interface for accessing a texture buffer. See
A shader-variable interface accesses a shader variable.
Get a shader description.
A zero-based index.
A reference to a shader description (see
Get a vertex shader.
A zero-based index.
A reference to a
Get a geometry shader.
A zero-based index.
A reference to a
Get a pixel shader.
A zero-based index.
A reference to a
Get an input-signature description.
A zero-based shader index.
A zero-based shader-element index.
A reference to a parameter description (see
An effect contains one or more shaders; each shader has an input and output signature; each signature contains one or more elements (or parameters). The shader index identifies the shader and the element index identifies the element (or parameter) in the shader signature.
Get an output-signature description.
A zero-based shader index.
A zero-based element index.
A reference to a parameter description (see
An effect contains one or more shaders; each shader has an input and output signature; each signature contains one or more elements (or parameters). The shader index identifies the shader and the element index identifies the element (or parameter) in the shader signature.
An
The lifetime of an
The
An effect contains one or more techniques; each technique contains one or more passes; each pass contains state assignments (see Organizing State in an Effect (Direct3D 10)). The syntax for creating a technique is shown in Effect Technique Syntax (Direct3D 10).
To get an effect-technique interface, call a method like
Test a technique to see if it contains valid syntax.
TRUE if the code syntax is valid; otherwise
Get a technique description.
A reference to a technique description (see
Returns one of the following Direct3D 10 Return Codes.
Get an annotation by index.
The zero-based index of the interface reference.
A reference to an
Use an annotation to attach a piece of metadata to a technique.
Get an annotation by name.
Name of the annotation.
A reference to an
Use an annotation to attach a piece of metadata to a technique.
Get a pass by index.
A zero-based index.
A reference to a
A technique contains one or more passes; get a pass using a name or an index.
Get a pass by name.
The name of the pass.
A reference to an
A technique contains one or more passes; get a pass using a name or an index.
Compute a state-block mask to allow/prevent state changes.
A reference to a state-block mask (see
Returns one of the following Direct3D 10 Return Codes.
Test a technique to see if it contains valid syntax.
Get a technique description.
Get an member type by name.
Tests that the effect type is valid.
TRUE if it is valid; otherwise
Get an effect-type description.
A reference to an effect-type description. See
Returns one of the following Direct3D 10 Return Codes.
The effect-variable description contains data about the name, annotations, semantic, flags and buffer offset of the effect type.
Get a member type by index.
A zero-based index.
A reference to an
Get an member type by name.
A member's name.
A reference to an
Get a member type by semantic.
A semantic.
A reference to an
Get the name of a member.
A zero-based index.
The name of the member.
Get the semantic attached to a member.
A zero-based index.
A string that contains the semantic.
Tests that the effect type is valid.
Get an effect-type description.
The effect-variable description contains data about the name, annotations, semantic, flags and buffer offset of the effect type.
A geometry-shader interface manages an executable program (a geometry shader) that controls the geometry-shader stage.
The geometry-shader interface has no methods; use HLSL to implement your shader functionality. All shaders in Direct3D 10 are implemented from a common set of features referred to as the common shader core.
To create a geometry shader interface, call either
This interface is defined in D3D10.h.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Set the constant buffers used by the geometry shader pipeline stage.
The method will not hold references to the interfaces passed in. For that reason, applications should be careful not to release interfaces currently in use by the device.
Set the constant buffers used by the geometry shader pipeline stage.
The method will not hold references to the interfaces passed in. For that reason, applications should be careful not to release interfaces currently in use by the device.
Set a geometry shader to the device.
Pointer to a geometry shader (see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of shader resources to the geometry shader stage.
If you bind a subresource as an input and an output, this API will fill the destination shader resource slot with
For information about creating shader-resource views, see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of shader resources to the geometry shader stage.
If you bind a subresource as an input and an output, this API will fill the destination shader resource slot with
For information about creating shader-resource views, see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set an array of sampler states to the geometry shader pipeline stage.
Any sampler may be set to
//Default sampler state:
SamplerDesc;
SamplerDesc.Filter = ;
SamplerDesc.AddressU = ;
SamplerDesc.AddressV = ;
SamplerDesc.AddressW = ;
SamplerDesc.MipLODBias = 0;
SamplerDesc.MaxAnisotropy = 1;
SamplerDesc.ComparisonFunc = ;
SamplerDesc.BorderColor[0] = 1.0f;
SamplerDesc.BorderColor[1] = 1.0f;
SamplerDesc.BorderColor[2] = 1.0f;
SamplerDesc.BorderColor[3] = 1.0f;
SamplerDesc.MinLOD = -FLT_MAX;
SamplerDesc.MaxLOD = FLT_MAX;
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set an array of sampler states to the geometry shader pipeline stage.
Any sampler may be set to
//Default sampler state:
SamplerDesc;
SamplerDesc.Filter = ;
SamplerDesc.AddressU = ;
SamplerDesc.AddressV = ;
SamplerDesc.AddressW = ;
SamplerDesc.MipLODBias = 0;
SamplerDesc.MaxAnisotropy = 1;
SamplerDesc.ComparisonFunc = ;
SamplerDesc.BorderColor[0] = 1.0f;
SamplerDesc.BorderColor[1] = 1.0f;
SamplerDesc.BorderColor[2] = 1.0f;
SamplerDesc.BorderColor[3] = 1.0f;
SamplerDesc.MinLOD = -FLT_MAX;
SamplerDesc.MaxLOD = FLT_MAX;
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Get the constant buffers used by the geometry shader pipeline stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the geometry shader currently set on the device.
Address of a reference to a geometry shader (see
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the geometry shader resources.
Index into the device's zero-based array to begin getting shader resources from.
The number of resources to get from the device. Up to a maximum of 128 slots are available for shader resources.
Array of shader resource view interfaces to be returned by the device.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get an array of sampler states from the geometry shader pipeline stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
An information-queue interface stores, retrieves, and filters debug messages. The queue consists of a message queue, an optional storage filter stack, and a optional retrieval filter stack.
This interface is obtained by turning on the debug layer and querying it from the
hr = ( null , g_driverType, null , , , &sd, &g_pSwapChain, &g_pd3dDevice );
...
* infoQueue;
g_pd3dDevice->QueryInterface(__uuidof( ), (void **)&infoQueue);
Set the maximum number of messages that can be added to the message queue.
Maximum number of messages that can be added to the message queue. -1 means no limit.
This method returns one of the following Direct3D 10 Return Codes.
When the number of messages in the message queue has reached the maximum limit, new messages coming in will push old messages out.
Clear all messages from the message queue.
Get a message from the message queue.
Index into message queue after an optional retrieval filter has been applied. This can be between 0 and the number of messages in the message queue that pass through the retrieval filter (which can be obtained with
Returned message (see
Size of pMessage in bytes, including the size of the message string that the pMessage points to.
This method returns one of the following Direct3D 10 Return Codes.
This method does not remove any messages from the message queue.
This method gets messages from the message queue after an optional retrieval filter has been applied.
Applications should call this method twice to retrieve a message - first to obtain the size of the message and second to get the message. Here is a typical example:
// Get the size of the message
messageLength = 0;
hr = pInfoQueue->GetMessage(0, null , &messageLength); // Allocate space and get the message
* pMessage = ( *)malloc(messageLength);
hr = pInfoQueue->GetMessage(0, pMessage, &messageLength);
For an overview see Information Queue Overview.
Get the number of messages that were allowed to pass through a storage filter.
Number of messages allowed by a storage filter.
Get the number of messages that were denied passage through a storage filter.
Number of messages denied by a storage filter.
Get the number of messages currently stored in the message queue.
Number of messages currently stored in the message queue.
Get the number of messages that are able to pass through a retrieval filter.
Number of messages allowed by a retrieval filter.
Get the number of messages that were discarded due to the message count limit.
Number of messages discarded.
Get and set the message count limit with
Get the maximum number of messages that can be added to the message queue.
Maximum number of messages that can be added to the queue. -1 means no limit.
When the number of messages in the message queue has reached the maximum limit, new messages coming in will push old messages out.
Add storage filters to the top of the storage-filter stack.
Array of storage filters (see
This method returns one of the following Direct3D 10 Return Codes.
A storage filter defines a grouping of debug messages that should be allowed into the info queue.
Get the storage filter at the top of the storage-filter stack.
Storage filter at the top of the storage-filter stack.
Size of the storage filter in bytes. If pFilter is
This method returns one of the following Direct3D 10 Return Codes.
Remove a storage filter from the top of the storage-filter stack.
Push an empty storage filter onto the storage-filter stack.
This method returns one of the following Direct3D 10 Return Codes.
An empty storage filter allows all messages to pass through.
Push a copy of storage filter currently on the top of the storage-filter stack onto the storage-filter stack.
This method returns one of the following Direct3D 10 Return Codes.
Push a storage filter onto the storage-filter stack.
Pointer to a storage filter (see
This method returns one of the following Direct3D 10 Return Codes.
Pop a storage filter from the top of the storage-filter stack.
Get the size of the storage-filter stack in bytes.
Size of the storage-filter stack in bytes.
Add storage filters to the top of the retrieval-filter stack.
Array of retrieval filters (see
This method returns one of the following Direct3D 10 Return Codes.
A retrieval filter is used to define a subgroup of the messages that are already in the info queue. Retrieval filters affect the messages that will be returned by
The number of messages already in the info queue that will be allowed through the retrieval filter can be determined by calling
Get the retrieval filter at the top of the retrieval-filter stack.
Retrieval filter at the top of the retrieval-filter stack.
Size of the retrieval filter in bytes. If pFilter is
This method returns one of the following Direct3D 10 Return Codes.
Remove a retrieval filter from the top of the retrieval-filter stack.
Push an empty retrieval filter onto the retrieval-filter stack.
This method returns one of the following Direct3D 10 Return Codes.
An empty retrieval filter allows all messages to pass through.
Push a copy of retrieval filter currently on the top of the retrieval-filter stack onto the retrieval-filter stack.
This method returns one of the following Direct3D 10 Return Codes.
Push a retrieval filter onto the retrieval-filter stack.
Pointer to a retrieval filter (see
This method returns one of the following Direct3D 10 Return Codes.
Pop a retrieval filter from the top of the retrieval-filter stack.
Get the size of the retrieval-filter stack in bytes.
Size of the retrieval-filter stack in bytes.
Add a Direct3D 10 debug message to the message queue and send that message to debug output.
Category of a message (see
Severity of a message (see
Unique identifier of a message (see
User-defined message.
This method returns one of the following Direct3D 10 Return Codes.
This method is used by the runtime's internal mechanisms to add Direct3D 10 debug messages to the message queue and send them to debug output. For applications to add their own custom messages to the message queue and send them to debug output, call
Add a user-defined message to the message queue and send that message to debug output.
Severity of a message (see
Message string.
This method returns one of the following Direct3D 10 Return Codes.
Set a message category to break on when a message with that category passes through the storage filter.
Message category to break on (see
Turns this breaking condition on or off (true for on, false for off).
This method returns one of the following Direct3D 10 Return Codes.
Set a message severity level to break on when a message with that severity level passes through the storage filter.
Message severity level to break on (see
Turns this breaking condition on or off (true for on, false for off).
This method returns one of the following Direct3D 10 Return Codes.
Set a message identifier to break on when a message with that identifier passes through the storage filter.
Message identifier to break on (see
Turns this breaking condition on or off (true for on, false for off).
This method returns one of the following Direct3D 10 Return Codes.
Get a message category to break on when a message with that category passes through the storage filter.
Message category to break on (see
Whether this breaking condition is turned on or off (true for on, false for off).
Get a message severity level to break on when a message with that severity level passes through the storage filter.
Message severity level to break on (see
Whether this breaking condition is turned on or off (true for on, false for off).
Get a message identifier to break on when a message with that identifier passes through the storage filter.
Message identifier to break on (see
Whether this breaking condition is turned on or off (true for on, false for off).
Set a boolean that turns the debug output on or off.
Disable/Enable the debug output (TRUE to disable or mute the output,
This will stop messages that pass the storage filter from being printed out in the debug output, however those messages will still be added to the message queue.
Get a boolean that turns the debug output on or off.
Whether the debug output is on or off (true for on, false for off).
Get the maximum number of messages that can be added to the message queue.
When the number of messages in the message queue has reached the maximum limit, new messages coming in will push old messages out.
Get the number of messages that were allowed to pass through a storage filter.
Get the number of messages that were denied passage through a storage filter.
Get the number of messages currently stored in the message queue.
Get the number of messages that are able to pass through a retrieval filter.
Get the number of messages that were discarded due to the message count limit.
Get and set the message count limit with
Get the size of the storage-filter stack in bytes.
Get the size of the retrieval-filter stack in bytes.
Get a boolean that turns the debug output on or off.
An input-layout interface accesses the input data for the input-assembler stage.
This interface is created by calling
Applications use the methods of the
To obtain the
Retrieves the number of faces in the mesh.
Returns the number of faces in the mesh.
Get the number of vertices in the mesh. A mesh may contain multiple vertex buffers (i.e. one vertex buffer may contain all position data, another may contains all texture coordinate data, etc.), however each vertex buffer will contain the same number of elements.
The number of vertices in the mesh.
Get the number of vertex buffers in the mesh.
The number of vertex buffers in the mesh.
Access the mesh's creation flags.
The creation flags passed into the options parameter of
Access the vertex description passed into
The return value is one of the values listed in Direct3D 10 Return Codes.
Set vertex data into one of the mesh's vertex buffers.
The vertex buffer to be filled with pData.
The vertex data to set.
The return value is one of the values listed in Direct3D 10 Return Codes.
Retrieves the vertex buffer associated with the mesh.
The vertex buffer to get. This is an index value.
The vertex buffer. See
Set the mesh's index data.
The index data.
The number of indices in pData.
The return value is one of the values listed in Direct3D 10 Return Codes.
Retrieves the data in an index buffer.
Address of a reference to a
Set the mesh's attribute data.
The attribute data to set.
The return value is one of the values listed in Direct3D 10 Return Codes.
Access the mesh's attribute buffer.
The attribute buffer. See
The return value is one of the values listed in Direct3D 10 Return Codes.
Sets the attribute table for a mesh and the number of entries stored in the table.
Pointer to an array of
Number of attributes in the mesh attribute table.
The return value is one of the values listed in Direct3D 10 Return Codes.
If an application keeps track of the information in an attribute table, and rearranges the table as a result of changes to attributes or faces, this method allows the application to update the attribute tables instead of calling
Retrieves either an attribute table for a mesh, or the number of entries stored in an attribute table for a mesh.
Pointer to an array of
Pointer to either the number of entries stored in pAttribTable or a value to be filled in with the number of entries stored in the attribute table for the mesh.
The return value is one of the values listed in Direct3D 10 Return Codes.
An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier when drawing the frame.
Generate a list of mesh edges, as well as a list of faces that share each edge.
Specifies that vertices that differ in position by less than epsilon should be treated as coincident.
The return value is one of the values listed in Direct3D 10 Return Codes.
After an application generates adjacency information for a mesh, the mesh data can be optimized for better drawing performance.
The order of the entries in the adjacency buffer is determined by the order of the vertex indices in the index buffer. The adjacent triangle 0 always corresponds to the edge between the indices of the corners 0 and 1. The adjacent triangle 1 always corresponds to the edge between the indices of the corners 1 and 2 while the adjacent triangle 2 corresponds to the edge between the indices of the corners 2 and 0.
Adds adjacency data to the mesh's index buffer. When the mesh is to be sent to a geometry shader that takes adjacency data, it is neccessary for the mesh's index buffer to contain adjacency data.
The return value is one of the values listed in Direct3D 10 Return Codes.
Set the mesh's adjacency data.
The adjacency data to set.
The return value is one of the values listed in Direct3D 10 Return Codes.
Access the mesh's adjacency buffer.
The adjacency buffer. See
Set the point rep data for the mesh.
The point rep data to set.
The return value is one of the values listed in Direct3D 10 Return Codes.
Get the mesh's point rep buffer.
Pointer to a mesh buffer containing the mesh's point rep data. See
The return value is one of the values listed in Direct3D 10 Return Codes.
Removes mesh data from the device that has been committed to the device (with
The return value is one of the values listed in Direct3D 10 Return Codes.
Creates a new mesh and fills it with the data of a previously loaded mesh.
Creation flags to be applied to the new mesh. See D3DX10_MESH.
The semantic name for the position data.
Array of
The number of elements in the pDesc array.
The new mesh.
The return value is one of the values listed in Direct3D 10 Return Codes.
Generates a new mesh with reordered faces and vertices to optimize drawing performance.
Specifies the type of optimization to perform. This parameter can be set to a combination of one or more flags from D3DXMESHOPT and D3DXMESH (except
An array of UINTs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is
Address of a reference to an
The return value is one of the values listed in Direct3D 10 Return Codes.
This method generates a new mesh. Before running Optimize, an application must generate an adjacency buffer by calling
This method is very similar to the
Generate an attribute buffer from the data in the mesh's attribute table. An attribute buffer is another format for storing the data in the attribute table. Both the attribute buffer and the attribute table are internal data structures in the mesh.
The return value is one of the values listed in Direct3D 10 Return Codes.
Commit any changes made to a mesh to the device so that the changes can be rendered. This should be called after a mesh's data is altered and before it is rendered. A mesh cannot be rendered unless it is committed to the device. See remarks.
The return value is one of the values listed in Direct3D 10 Return Codes.
When a mesh is loaded, it's data is loaded into staging resources, meaning the data can be altered but not rendered. When CommitToDevice is called, the data from the staging resources are copied into device resources so that they can be rendered. Although the data is committed to the device, the staging resources remain and can be modified. If any modifications are made to the staging resources, the staging resources must be committed to the device again in order for those changes to be rendered on screen.
Draws a subset of a mesh.
Specifies which subset of the mesh to draw. This value is used to differentiate faces in a mesh as belonging to one or more attribute groups.
The return value is one of the values listed in Direct3D 10 Return Codes.
An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.
Draw several instances of the same subset of a mesh.
Specifies which subset of the mesh to draw. This value is used to differentiate faces in a mesh as belonging to one or more attribute groups. See remarks.
Number of instances to render.
Which instance to start fetching from in each buffer marked as instance data.
The return value is one of the values listed in Direct3D 10 Return Codes.
A mesh contains an attribute table. The attribute table can divide a mesh into subsets, where each subset is identified with an attribute ID. For example, a mesh with 200 faces, divided into three subsets, might have an attribute table that looks like this:
AttribID 0 | Faces 0 ~ 50 |
AttribID 1 | Faces 51 ~ 125 |
AttribID 2 | Faces 126 ~ 200 |
?
Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors. Indexing requires multiple vertex buffers: at least one for per-vertex data and a second buffer for per-instance data.
Drawing instances with DrawSubsetInstanced is very similar to the process used with
The following code illustrates extracting the vertex and index buffers from the mesh object.
* vertexBuffer; pDeviceObj->pMesh->GetDeviceVertexBuffer(0, &vertexBuffer); * indexBuffer; pDeviceObj->pMesh->GetDeviceIndexBuffer(&indexBuffer);
Access the mesh's vertex buffer after it has been committed to the device with
Access the mesh's index buffer after it has been committed to the device with
If the mesh's index buffer has not already been committed to the device, this API will automatically commit the index buffer before it returns a reference to the buffer.
Retrieves the number of faces in the mesh.
Get the number of vertices in the mesh. A mesh may contain multiple vertex buffers (i.e. one vertex buffer may contain all position data, another may contains all texture coordinate data, etc.), however each vertex buffer will contain the same number of elements.
Get the number of vertex buffers in the mesh.
A mesh buffer is a buffer that contains data about a mesh. It can contain one of five different types of data: vertex data, index data, adjacency data, attribute data, or point rep data. The structure is used to access these five pieces of data through the following five APIs:
Get a reference to the mesh buffer memory to modify its contents.
Pointer to the buffer data.
Size of the buffer in bytes.
The return value is one of the values listed in Direct3D 10 Return Codes.
Differences between Direct3D 9 and Direct3D 10: Map() in Direct3D 10 is analogous to resource Map() in Direct3D 9. |
?
Unmap a buffer.
The return value is one of the values listed in Direct3D 10 Return Codes.
Differences between Direct3D 9 and Direct3D 10: Unmap() in Direct3D 10 is analogous to resource Unlock() in Direct3D 9. |
?
Get the size of the mesh buffer, in bytes.
The size of the mesh buffer, in bytes.
Get the size of the mesh buffer, in bytes.
A pixel-shader interface manages an executable program (a pixel shader) that controls the pixel-shader stage.
The pixel-shader interface has no methods; use HLSL to implement your shader functionality. All shaders in Direct3D 10 are implemented from a common set of features referred to as the common shader core.
To create a pixel shader interface, call
This interface is defined in D3D10.h.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Bind an array of shader resources to the pixel shader stage.
If you bind a subresource as an input and an output, this API will fill the destination shader resource slot with
For information about creating shader-resource views, see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of shader resources to the pixel shader stage.
If you bind a subresource as an input and an output, this API will fill the destination shader resource slot with
For information about creating shader-resource views, see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Sets a pixel shader to the device.
Pointer to a pixel shader (see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set an array of sampler states to the pixel shader pipeline stage.
Any sampler may be set to
State | Default Value |
---|---|
Filter | |
AddressU | |
AddressV | |
AddressW | |
MipLODBias | 0 |
MaxAnisotropy | 1 |
ComparisonFunc | |
BorderColor[0] | 1.0f |
BorderColor[1] | 1.0f |
BorderColor[2] | 1.0f |
BorderColor[3] | 1.0f |
MinLOD | -FLT_MAX |
MaxLOD | FLT_MAX |
?
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set an array of sampler states to the pixel shader pipeline stage.
Any sampler may be set to
State | Default Value |
---|---|
Filter | |
AddressU | |
AddressV | |
AddressW | |
MipLODBias | 0 |
MaxAnisotropy | 1 |
ComparisonFunc | |
BorderColor[0] | 1.0f |
BorderColor[1] | 1.0f |
BorderColor[2] | 1.0f |
BorderColor[3] | 1.0f |
MinLOD | -FLT_MAX |
MaxLOD | FLT_MAX |
?
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set the constant buffers used by the pixel shader pipeline stage.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set the constant buffers used by the pixel shader pipeline stage.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Get the pixel shader resources.
Index into the device's zero-based array to begin getting shader resources from.
The number of resources to get from the device. Up to a maximum of 128 slots are available for shader resources.
Array of shader resource view interfaces to be returned by the device.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the pixel shader currently set on the device.
Address of a reference to a pixel shader (see
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get an array of sampler states from the pixel shader pipeline stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the constant buffers used by the pixel shader pipeline stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
A predicate interface determines whether geometry should be processed depending on the results of a previous draw call.
A predicate can be created with
There are two types of predicates in Direct3D 10: stream-output-overflow predicates and occlusion predicates. Stream-output-overflow predicates will cause any geometry residing in stream-output buffers that were overflowed to not be processed. Occlusion predicates will cause any geometry that did not have a single sample pass the depth/stencil tests to not be processed.
For an example of occlusion-predicated rendering, see Draw Predicated Sample.
A query interface queries information from the GPU.
A query can be created with
This interface inherits the functionality of an
Query data is typically gathered by issuing an
There are, however, some queries that do not require calls to Begin. For a list of possible queries see
A query is typically executed as shown in the following code:
queryDesc; ... // Fill out queryDesc structure * pQuery;
pDevice->CreateQuery(&queryDesc, &pQuery); pQuery->Begin(); ... // Issue graphis commands, do whatever pQuery->End(); UINT64 queryData; // This data type is different depending on the query type while( != pQuery->GetData(&queryData, sizeof(UINT64), 0) )
{
}
When using a query that does not require a call to Begin, it still requires a call to End. The call to End causes the data returned by GetData to be accurate up until the last call to End.
Get a query description.
Pointer to a query description (see
Get a query description.
A rasterizer-state interface accesses rasterizer state for the rasterizer stage.
A rasterizer-state object is created with
Get the properties of a rasterizer-state object.
Pointer to a rasterizer-state description (see
Get the properties of a rasterizer-state object.
A render-target-view interface identifies the render-target subresources that can be accessed during rendering.
To create a render-target view, call
A rendertarget is a resource that can be written by the output-merger stage at the end of a render pass. Each render-target should also have a corresponding depth-stencil view.
Get the properties of a render target view.
Pointer to the description of a render target view (see
Get the properties of a render target view.
A sampler-state interface accesses sampler state for a texture.
Create a sampler-state object by calling
To initialize sampler state, bind the sampler-state object to the pipeline by calling
Get the sampler state.
A reference to the sampler state (see
Get the sampler state.
A shader-resource-view interface specifies the subresources a shader can access during rendering. Examples of shader resources include a constant buffer, a texture buffer, a texture or a sampler.
To create a shader-resource view, call
A shader-resource view is required when binding a resource to a shader stage; the binding occurs by calling
Get the shader resource view's description.
A reference to a
Get the shader resource view's description.
A shader-resource-view interface specifies the subresources a shader can access during rendering. Examples of shader resources include a constant buffer, a texture buffer, a texture or a sampler.
To create a shader-resource view, call
A shader-resource view is required when binding a resource to a shader stage; the binding occurs by calling
This method requires Windows Vista Service Pack 1.
Get the shader resource view's description.
A reference to a
This method requires Windows Vista Service Pack 1.
Get the shader resource view's description.
This method requires Windows Vista Service Pack 1.
Create a
The LPD3DX10SKININFO type is defined as a reference to the
typedef struct *LPD3DX10SKININFO;
Get the number of vertices in
The number of vertices in
Get the number of bones in
The number of bones in
Get the number of vertices a bone can maximally influence.
The number of vertices a bone can maximally influence.
Allocate space for additional vertices.
The number of vertices to add.
If this method succeeds, the return value is
Change which vertices are influenced by which bones.
The new number of vertices.
A reference to an array of vertex indices, which describe the remapping. For example, say SkinInfo contains some vertices such that bone0 is mapped to v0, bone1 to v1, and bone2 to v2, and array with 2,1,0 is specified for pBoneRemap. This will cause bone0 to be mapped to v2, bone1 to v1, and bone2 to v0.
If the method succeeds, the return value is
Allocate space for more bones.
The number of bones to add.
If this method succeeds, the return value is
Remove a bone.
An index that specifies which bone to remove. Must be between 0 and the value returned by
If the method succeeds, the return value is
Change which bones influence which vertices.
The new number of bones.
A reference to an array of bone indices, which describe the remapping. For example, say SkinInfo contains some bones such that bone0 is mapped to v0, bone1 to v1, and bone2 to v2, and array with 2,1,0 is specified for pBoneRemap. This will cause bone0 to be mapped to v2, bone1 to v1, and bone2 to v0.
If the method succeeds, the return value is
Enable an existing bone to influence a group of vertices and define how much influence the bone has on each vertex.
An index that specifies an existing bone. Must be between 0 and the value returned by
Number of vertices to add to the bone's influence.
Pointer to an array of vertex indices. Each member of this array has a corresponding member in pWeights, such that pIndices[i] corresponds to pWeights[i]. The corresponding value in pWeights[i] determines how much influence BoneIndex will have on the vertex indexed by pIndices[i]. The size of the pIndices array must be equal to or greater than InfluenceCount.
Pointer to an array of bone weights. Each member of this array has a corresponding member in pIndices, such that pWeights[i] corresponds to pIndices[i]. Each value in pWeights is between 0 and 1 and defines the amount of influence the bone has over each vertex. The size of pWeights must be equal to or greater than InfluenceCount.
If the method succeeds, the return value is
Clear a bone's list of vertices that it influences.
An index that specifies an existing bone. Must be between 0 and the value returned by
If the method succeeds, the return value is
Get the number of vertices that a given bone influences.
An index that specifies an existing bone. Must be between 0 and the value returned by
If the method succeeds, the return value is
Get a list of vertices that a given bone influences and a list of the amount of influence that bone has on each vertex.
An index that specifies an existing bone. Must be between 0 and the value returned by
An offset from the top of the bone's list of influenced vertices. This must be between 0 and the value returned by
The number of indices and weights to retrieve. Must be between 0 and the value returned by
A list of indices into the vertex buffer, each one representing a vertex influenced by the bone. These values correspond to the values in pDestWeights, such that pDestIndices[i] corresponds to pDestWeights[i].
A list of the amount of influence the bone has on each vertex. These values correspond to the values in pDestIndices, such that pDestWeights[i] corresponds to pDestIndices[i].f
If the method succeeds, the return value is
Find the index that indicates where a given vertex is in a given bone's list of influenced vertices.
An index that specifies an existing bone. Must be between 0 and the value returned by
The index of the vertex in the vertex buffer.
The index of the vertex in the bone's list of influenced vertices.
If the method succeeds, the return value is
Set the amount of influence a given bone has over a given vertex.
An index that specifies an existing bone. Must be between 0 and the value returned by
An index into the bone's list of vertices that it influences.
The amount of influence, between 0 and 1, that the bone has over the vertex.
If the method succeeds, the return value is
Get the amount of influence a given bone has over a given vertex.
An index that specifies an existing bone. Must be between 0 and the value returned by
An index into the bone's list of vertices that it influences.
The amount of influence, between 0 and 1, that the bone has over the vertex.
If the method succeeds, the return value is
Use
Limit the number of bones that can influence a vertex and/or limit the amount of influence a bone can have on a vertex.
The maximum number of bones that can influence any given vertex. This value is ignored if it is greater than the value returned by
A flag describing how to scale the remaining weights on a given vertex after some have been chopped off by MinWeight. If D3DX10_SKININFO_NO_SCALING is specified, the weights will not be scaled at all. If D3DX10_SKININFO_SCALE_TO_1 is specified, the weights greater than MinWeight will be scaled up so that they add up to 1.0. If D3DX10_SKININFO_SCALE_TO_TOTAL is specified, the weights greater than MinWeight will be scaled up so that they add up to the original total.
The minimum percentage of influence, or weight, that any bone can have on any vertex. This value must be between 0 and 1.
If the method succeeds, the return value is
Do software skinning on an array of vertices.
A 0-based index into pSrcVertices.
Number of vertices to transform.
Pointer to an array of vertices to transform.
The size, in bytes, of a vertex in pSrcVertices.
Pointer to an array of vertices, which will be filled with the transformed vertices.
The size, in bytes, of a vertex in pDestVertices.
An array of matrices that will be used to transform the points mapped to each bone, such that the vertices mapped to bone[i] will be transformed by pBoneMatrices[i]. This array will be used to transform the matrices only if the IsNormal value in pChannelDescs is set to
If this value is
Pointer to a
The number of
If the method succeeds, the return value is
Here is an example of how to use software skinning:
//vertex definition
struct MyVertex
{ Position; Weight; TexCoord;
}; //create vertex data
const UINT numVertices = 16;
MyVertex vertices[numVertices] = {...};
MyVertex destVertices[numVertices]; //create bone matrices
boneMatrices[2];
D3DXMatrixIdentity(&boneMatrices[0]);
D3DXMatrixRotationX(&boneMatrices[1], 3.14159f / 180.0f); //create bone indices and weights
UINT boneIndices[numVertices] = {...};
float boneWeights[2][numVertices] = {...}; //create skin info, populate it with bones and vertices, and then map them to each other
*pSkinInfo = null ;
(&pSkinInfo);
pSkinInfo->AddBones(2);
pSkinInfo->AddVertices(numVertices);
pSkinInfo->AddBoneInfluences(0, numVertices, boneIndices, boneWeights[0]);
pSkinInfo->AddBoneInfluences(1, numVertices, boneIndices, boneWeights[1]); //create channel desc
channelDesc;
channelDesc.SrcOffset = 0;
channelDesc.DestOffset = 0;
channelDesc.IsNormal = ; //do the skinning
pSkinInfo->DoSoftwareSkinning(0, numVertices, vertices, sizeof(MyVertex), destVertices, sizeof(MyVertex), boneMatrices, null , &channelDesc, 1);
Get the number of vertices in
Get the number of bones in
Get the number of vertices a bone can maximally influence.
The
The
Prepare a device for drawing sprites.
Flags that control how the sprites will be drawn. See
If the method succeeds, the return value is
Every call to Begin must be matched with a call to
Add an array of sprites to the batch of sprites to be rendered. This must be called in between calls to
If the method succeeds, the return value is
Force all batched sprites to be submitted to the device. Device states remain as they were after the last call to
If the method succeeds, the return value is
Draw an array of sprites. This will immediately send the sprites to the device for rendering, which is different from
If the method succeeds, the return value is
Call this after
If the method succeeds, the return value is
Get the view transform that applies to all sprites.
Pointer to a D3DX10MATRIX that will be set to the transform of the sprite from the original world space.
If the method succeeds, the return value is
Set the view transform that applies to all sprites.
Pointer to a
If the method succeeds, the return value is
Get the sprite projection matrix that is applied to all sprites.
Pointer to a D3DX10MATRIX that will be set to the sprite's projection matrix.
The return value is one of the values listed in Direct3D 10 Return Codes.
Set the projection matrix for all sprites.
The projection matrix to be used on all sprites.
The return value is one of the values listed in Direct3D 10 Return Codes.
Retrieve the device associated with the sprite object.
Address of a reference to an
If the method succeeds, the return value is
Calling this method will increase the internal reference count on the
Get the view transform that applies to all sprites.
Get the sprite projection matrix that is applied to all sprites.
Retrieve the device associated with the sprite object.
Calling this method will increase the internal reference count on the
A state-block interface encapsulates render states.
To create a state-block interface, call
This interface can be used to save and restore pipeline state. It can also be used to capture the current state.
Capture the current value of states that are included in a stateblock.
Returns one of the following Direct3D 10 Return Codes.
Capture captures current values for states within an existing state block. It does not capture the entire state of the device. Creating an empty stateblock and calling Capture does nothing if no states have been set.
Apply the state block to the current device state.
Returns one of the following Direct3D 10 Return Codes.
Release all references to device objects.
Returns one of the following Direct3D 10 Return Codes.
Each time you return a reference to an interface (by calling
Get the device.
Pointer to the
Returns one of the following Direct3D 10 Return Codes.
Get the device.
Get a boolean value that indicates the type of device being used.
A hardware device is commonly referred to as a HAL device, which stands for a hardware accelerated device. This means that the pipeline is rendering all of the pipeline commands in hardware, using the GPU. Operating the pipeline with a HAL device gives the best performance generally, but it can be more difficult to debug since resources exist on the GPU instead of the CPU.
A software device implements rendering in software using the CPU with no hardware acceleration. A software device is commonly referred to as a reference device or REF device. Because a REF device implements rendering on the CPU, it is generally slower, but is easier to debug since it allows access to resources.
Switch between a hardware and a software device.
A boolean value. Set this to TRUE to change to a software device, set this to
The previous value of UseRef.
This API will fail if the device is not switchable; you must have created a device that is switchable by specifying the
Switching from a software device to a hardware device clears all cached objects from system memory. Switching from a hardware device to a software device causes resources to be downloaded to system memory.
Get a boolean value that indicates the type of device being used.
TRUE if the device is a software device,
A hardware device is commonly referred to as a HAL device, which stands for a hardware accelerated device. This means that the pipeline is rendering all of the pipeline commands in hardware, using the GPU. Operating the pipeline with a HAL device gives the best performance generally, but it can be more difficult to debug since resources exist on the GPU instead of the CPU.
A software device implements rendering in software using the CPU with no hardware acceleration. A software device is commonly referred to as a reference device or REF device. Because a REF device implements rendering on the CPU, it is generally slower, but is easier to debug since it allows access to resources.
Get a boolean value that indicates the type of device being used.
A hardware device is commonly referred to as a HAL device, which stands for a hardware accelerated device. This means that the pipeline is rendering all of the pipeline commands in hardware, using the GPU. Operating the pipeline with a HAL device gives the best performance generally, but it can be more difficult to debug since resources exist on the GPU instead of the CPU.
A software device implements rendering in software using the CPU with no hardware acceleration. A software device is commonly referred to as a reference device or REF device. Because a REF device implements rendering on the CPU, it is generally slower, but is easier to debug since it allows access to resources.
A 1D texture interface accesses texel data, which is structured memory.
To create an empty 1D texture, call
Textures cannot be bound directly to the pipeline; instead, a view must be created and bound. Using a view, texture data can be interpreted at run time within certain restrictions. To use the texture as a render target or depth-stencil resource, call
Get a reference to the data contained in a subresource, and deny the GPU access to that subresource.
Index number of the subresource. See D3D10CalcSubresource for more details.
Specifies the CPU's read and write permissions for a resource. For possible values, see
Flag that specifies what the CPU should do when the GPU is busy. This flag is optional.
Pointer to the texture resource data.
If this function succeeds, it returns
Mapping a texture enables the CPU to directly access the underlying data in the subresource of a texture. For the method to succeed, the texture being mapped must be created with the appropriate flags (see
Common failures of Map methods are indicated by the following return values:
Item | Description |
---|---|
| If MapFlags specifies |
| Map returns |
?
For more information about the preceding return values, see DXGI_ERROR.
Map has the following restrictions:
Applications must cast the void pData reference to the appropriate type to meaningfully access the underlying subresource data. For example, the following code demonstrates how to read each texel of a 1D subresource. It is assumed that the texture was created using
FLOAT* pTexels = (FLOAT*)pData;
for( UINT col = 0; col < width; col++ )
{ pTexels[col*4 + 0]; // Alpha pTexels[col*4 + 1]; // Blue pTexels[col*4 + 2]; // Green pTexels[col*4 + 3]; // Red
}
Differences between Direct3D 9 and Direct3D 10: Map in Direct3D 10 is analogous to resource Lock in Direct3D 9. |
?
Invalidate the reference to a resource that was retrieved by
A subresource must be mapped before Unmap is called.
Differences between Direct3D 9 and Direct3D 10: Unmap in Direct3D 10 is analogous to resource Unlock in Direct3D 9. |
?
Get the properties of the texture resource.
Pointer to a resource description (see
Get the properties of the texture resource.
A 2D texture interface manages texel data, which is structured memory.
To create an empty Texture2D resource, call
Textures cannot be bound directly to the pipeline; instead, a view must be created and bound. Using a view, texture data can be interpreted at run time within certain restrictions. To use the texture as a render target or depth-stencil resource, call
Get a reference to the data contained in a subresource, and deny GPU access to that subresource.
Index number of the subresource. See D3D10CalcSubresource for more details.
Integer that specifies the CPU's read and write permissions for a resource. For possible values, see
Flag that specifies what the CPU should do when the GPU is busy. This flag is optional.
Pointer to a structure (
If this function succeeds, it returns
All of the Map methods have identical return values and operating restrictions. These are listed in the remarks section of
Invalidate the reference to the resource that was retrieved by
A subresource must be mapped before Unmap is called.
Differences between Direct3D 9 and Direct3D 10: Unmap in Direct3D 10 is analogous to resource Unlock in Direct3D 9. |
?
Get the properties of the texture resource.
Pointer to a resource description (see
Get the properties of the texture resource.
A 3D texture interface accesses texel data, which is structured memory.
To create an empty Texture3D resource, call
Textures cannot be bound directly to the pipeline; instead, a view must be created and bound. Using a view, texture data can be interpreted at run time within certain restrictions. To use the texture as a render target or depth-stencil resource, call
Get a reference to the data contained in a subresource, and deny GPU access to that subresource.
Index number of the subresource. See D3D10CalcSubresourcefor more details.
Specifies the CPU's read and write permissions for a resource. For possible values, see
Flag that specifies what the CPU should do when the GPU is busy. This flag is optional.
Pointer to a structure (
If this function succeeds, it returns
Invalidate the reference to the resource retrieved by
A subresource must be mapped before Unmap is called.
Differences between Direct3D 9 and Direct3D 10: Unmap() in Direct3D 10 is analogous to resource Unlock() in Direct3D 9. |
?
Get the properties of the texture resource.
Pointer to a resource description (see
Get the properties of the texture resource.
A vertex-shader interface manages an executable program (a vertex shader) that controls the vertex-shader stage.
The vertex-shader interface has no methods; use HLSL to implement your shader functionality. All shaders in Direct3D 10 are implemented from a common set of features referred to as the common shader core.
To create a vertex shader interface, call
This interface is defined in D3D10.h.
The device interface represents a virtual adapter for Direct3D 10.0; it is used to perform rendering and create Direct3D resources.
A device is created using
Set the constant buffers used by the vertex shader pipeline stage.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set the constant buffers used by the vertex shader pipeline stage.
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set a vertex shader to the device.
Pointer to a vertex shader (see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of shader resources to the vertex shader stage.
If you bind a subresource as an input and an output, this API will fill the destination shader resource slot with
For information about creating shader-resource views, see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Bind an array of shader resources to the vertex shader stage.
If you bind a subresource as an input and an output, this API will fill the destination shader resource slot with
For information about creating shader-resource views, see
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set an array of sampler states to the vertex shader pipeline stage.
Any sampler may be set to
//Default sampler state:
SamplerDesc;
SamplerDesc.Filter = ;
SamplerDesc.AddressU = ;
SamplerDesc.AddressV = ;
SamplerDesc.AddressW = ;
SamplerDesc.MipLODBias = 0;
SamplerDesc.MaxAnisotropy = 1;
SamplerDesc.ComparisonFunc = ;
SamplerDesc.BorderColor[0] = 1.0f;
SamplerDesc.BorderColor[1] = 1.0f;
SamplerDesc.BorderColor[2] = 1.0f;
SamplerDesc.BorderColor[3] = 1.0f;
SamplerDesc.MinLOD = -FLT_MAX;
SamplerDesc.MaxLOD = FLT_MAX;
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Set an array of sampler states to the vertex shader pipeline stage.
Any sampler may be set to
//Default sampler state:
SamplerDesc;
SamplerDesc.Filter = ;
SamplerDesc.AddressU = ;
SamplerDesc.AddressV = ;
SamplerDesc.AddressW = ;
SamplerDesc.MipLODBias = 0;
SamplerDesc.MaxAnisotropy = 1;
SamplerDesc.ComparisonFunc = ;
SamplerDesc.BorderColor[0] = 1.0f;
SamplerDesc.BorderColor[1] = 1.0f;
SamplerDesc.BorderColor[2] = 1.0f;
SamplerDesc.BorderColor[3] = 1.0f;
SamplerDesc.MinLOD = -FLT_MAX;
SamplerDesc.MaxLOD = FLT_MAX;
The method will not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.
Get the constant buffers used by the vertex shader pipeline stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the vertex shader currently set on the device.
Address of a reference to a vertex shader (see
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get the vertex shader resources.
Index into the device's zero-based array to begin getting shader resources from.
The number of resources to get from the device. Up to a maximum of 128 slots are available for shader resources.
Array of shader resource view interfaces to be returned by the device.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Get an array of sampler states from the vertex shader pipeline stage.
Any returned interfaces will have their reference count incremented by one. Applications should call IUnknown::Release on the returned interfaces when they are no longer needed to avoid memory leaks.
Describes the blend state.
To see how blending is done, see Output-Merger Stage (Direct3D 10).
These are the default values for blend state.
State | Default Value |
---|---|
AlphaToCoverageEnable | |
BlendEnable[8] | |
SrcBlend | |
DestBlend | |
BlendOp | |
SrcBlendAlpha | |
DestBlendAlpha | |
BlendOpAlpha | |
RenderTargetWriteMask[8] |
?
This blend option specifies the first RGB data source and includes an optional pre-blend operation.
This blend option specifies the second RGB data source and includes an optional pre-blend operation.
This blend operation defines how to combine the RGB data sources.
This blend option specifies the first alpha data source and includes an optional pre-blend operation. Blend options that end in _COLOR are not allowed.
This blend option specifies the second alpha data source and includes an optional pre-blend operation. Blend options that end in _COLOR are not allowed.
This blend operation defines how to combine the alpha data sources.
Determines whether or not to use alpha-to-coverage as a multisampling technique when setting a pixel to a rendertarget.
Enable (or disable) blending. There are eight elements in this array; these correspond to the eight rendertargets that can be set to output-merger stage at one time.
A per-pixel write mask that allows control over which components can be written (see
Describes the blend state for a Direct3D 10.1 device.
To see how blending is done, see Output-Merger Stage (Direct3D 10).
These are the default values for the blend description.
State | Default Value |
---|---|
AlphaToCoverageEnable | |
IndependentBlendEnable | |
RenderTarget[0].BlendEnable | |
RenderTarget[0].SrcBlend | |
RenderTarget[0].DestBlend | |
RenderTarget[0].BlendOp | |
RenderTarget[0].SrcBlendAlpha | |
RenderTarget[0].DestBlendAlpha | |
RenderTarget[0].BlendOpAlpha | |
RenderTarget[0].RenderTargetWriteMask |
?
This structure requires Windows Vista Service Pack 1.
If the driver type is set to
Determines whether or not to use the alpha-to-coverage multisampling technique when setting a render-target pixel.
Set to TRUE to enable independent blending in simultaneous render targets. If set to
An array of render-target-blend descriptions (see
Information about the video card's performance counter capabilities.
This structure is returned by
Largest device-dependent counter ID that the device supports. If none are supported, this value will be 0. Otherwise it will be greater than or equal to
Number of counters that can be simultaneously supported.
Number of detectable parallel units that the counter is able to discern. Values are 1 ~ 4. Use NumDetectableParallelUnits to interpret the values of the VERTEX_PROCESSING, GEOMETRY_PROCESSING, PIXEL_PROCESSING, and OTHER_GPU_PROCESSING counters. See
Describes a counter.
Type of counter (see
Reserved.
Describes the stencil operations that can be performed based on the results of stencil test.
The stencil operation can be set differently based on the outcome of the stencil test by using the StencilFunc member. This can be done for the stencil test portion of depth-stencil testing.
The
Describes depth-stencil state.
Depth-stencil state controls how depth-stencil testing is performed by the output-merger stage.
The formats that support stenciling are
A member of the
A member of the
A value that identifies a portion of the depth-stencil buffer for reading stencil data. The default value is D3D10_DEFAULT_STENCIL_READ_MASK.
A value that identifies a portion of the depth-stencil buffer for writing stencil data. The default value is D3D10_DEFAULT_STENCIL_WRITE_MASK.
A
A
A Boolean value that enables depth testing. The default value is TRUE.
A Boolean value that enables stencil testing. The default value is
Specifies the subresource(s) from a texture that are accessible using a depth-stencil view.
These are valid formats for a depth-stencil view:
A depth-stencil view cannot use a typeless format. If the format chosen is
A depth-stencil-view description is needed when calling
Specifies the subresource(s) from an array 2D textures that are accessible to a depth-stencil view.
This structure is one member of a depth-stencil-view description (see
Specifies the subresource(s) from an array of multisampled 2D textures for a depth-stencil view.
This structure is one member of a depth-stencil-view description (see
Specifies the subresource(s) from an array of 1D textures to use in a depth-stencil view.
This structure is one member of a depth-stencil-view description (see
Specifies the subresource from a 1D texture that is accessible to a depth-stencil view.
This structure is one member of a depth-stencil-view description (see
Specifies the subresource from a multisampled 2D texture that is accessible to a depth-stencil view.
Since a multisampled 2D texture contains a single subtexture, there is nothing to specify; this unused member is included so that this structure will compile in C.
Specifies the subresource from a 2D texture that is accessible to a depth-stencil view.
This structure is one member of a depth-stencil-view description (see
Describes an effect.
To get an effect description, call
The number of constant buffers.
The number of constant buffers shared in an effect pool.
The number of global variables.
The number of global variables shared in an effect pool.
The number of techniques.
TRUE if the effect is a child effect; otherwise
Describes an effect technique.
To get a technique, call
A string that contains the technique name; otherwise
The number of passes in the technique.
The number of annotations.
Describes an effect-variable type.
To get an effect-variable type, call
A string that contains the variable name.
The variable class (see D3D10_SHADER_VARIABLE_CLASS).
The variable type (see D3D10_SHADER_VARIABLE_TYPE).
The number of elements if the variable is an array; otherwise 0.
The number of members if the variable is a structure; otherwise 0.
The number of rows if the variable is a matrix; otherwise 0.
The number of columns if the variable is a matrix; otherwise 0.
The number of bytes that the variable consumes when it is packed tightly by the compiler.
The number of bytes that the variable consumes before it is packed by the compiler.
The number of bytes between elements.
Describes an effect variable.
To get an effect-variable description, call
A string that contains the variable name.
The semantic attached to the variable; otherwise
Optional flags for effect variables.
The number of annotations; otherwise 0.
The offset between the beginning of the constant buffer and this variable; otherwise 0.
The register that this variable is bound to. To bind a variable explicitly use the
Defines font attributes.
The compiler setting also determines the structure type. If Unicode is defined, the
Possible values of the above members are given in the GDI
Height, in logical units, of the font's character cell or character.
Width, in logical units, of characters in the font.
Weight of the font in the range from 0 through 1000.
Number of mipmap levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created. If the value is 1, the texture space is mapped identically to the screen space.
Character set.
Output precision. The output precision defines how closely the output must match the requested font height, width, character orientation, escapement, pitch, and font type.
Output quality.
Pitch and family of the font.
A
Set to TRUE for an Italic font.
Returns a description of the original contents of an image file.
Width of original image in pixels.
Height of original image in pixels.
Depth of original image in pixels.
Size of the texture array. ArraySize will be 1 for a single image.
Number of mipmap levels in original image.
Miscellaneous resource properties (see
A value from the
Represents the type of the texture stored in the file. See
Represents the format of the image file. See
Optionally provide information to texture loader APIs to control how textures get loaded. A value of D3DX10_DEFAULT for any of these parameters will cause D3DX to automatically use the value from the source file.
When initializing the structure, you may set any member to D3DX10_DEFAULT and D3DX will initialize it with a default value from the source texture when the texture is loaded.
This structure can be used by APIs that:
The target width of the texture. If the actual width of the texture is larger or smaller than this value then the texture will be scaled up or down to fit this target width.
The target height of the texture. If the actual height of the texture is larger or smaller than this value then the texture will be scaled up or down to fit this target height.
The depth of the texture. This only applies to volume textures.
The highest resolution mipmap level of the texture. If this is greater than 0, then after the texture is loaded FirstMipLevel will be mapped to mipmap level 0.
The maximum number of mipmap levels that the texture will have. Using 0 or D3DX10_DEFAULT will cause a full mipmap chain to be created.
The way the texture resource is intended to be used. See
The pipeline stages that the texture will be allowed to bind to. See
The access permissions the cpu will have for the texture resource. See
Miscellaneous resource properties (see
The format the texture will be in after it is loaded. See
Filter the texture using the specified filter (only when resampling). See
Filter the texture mip levels using the specified filter (only if generating mipmaps). Valid values are
Information about the original image. See
Debug message filter; contains a lists of message types to allow or deny.
For use with an
Providing an allow list with non-zero values causes only the specified combination of categories, severities and message IDs to be allowed. Messages that do not match the specified combination will be rejected.
Providing a deny list with non-zero values causes the specified combination of categories, severities and message IDs to be rejected. Messages that do not match the specified combination will be allowed.
A
A
Allow or deny certain types of messages to pass through a filter.
Number of message categories to allow or deny.
Array of message categories to allow or deny. Array must have at least NumCategories members (see
Number of message severity levels to allow or deny.
Array of message severity levels to allow or deny. Array must have at least NumSeverities members (see
Number of message IDs to allow or deny.
Array of message IDs to allow or deny. Array must have at least NumIDs members (see
A description of a single element for the input-assembler stage.
An input-layout object contains an array of structures, each structure defines one element being read from an input slot. Create an input-layout object by calling
Stores an attribute table entry.
An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.
The LPD3DX_ATTRIBUTE_RANGE type is defined as a reference to the D3DX_ATTRIBUTE_RANGE structure.
typedef D3DX_ATTRIBUTE_RANGE* LPD3DX_ATTRIBUTE_RANGE;
Attribute table identifier.
Starting face.
Face count.
Starting vertex.
Vertex count.
Specifies mesh weight attributes.
This structure describes how a simplification operation will consider vertex data when calculating relative costs between collapsing edges. For example, if the Normal field is 0.0, the simplification operation will ignore the vertex normal component when calculating the error for the collapse. However, if the Normal field is 1.0, the simplification operation will use the vertex normal component. If the Normal field is 2.0, double the amount of errors; if the Normal field is 4.0, then quadruple the number of errors, and so on.
The LPD3DX_ATTRIBUTE_WEIGHTS type is defined as a reference to the D3DX_ATTRIBUTE_WEIGHTS structure.
typedef D3DX_ATTRIBUTE_WEIGHTS* LPD3DX_ATTRIBUTE_WEIGHTS;
Position.
Blend weight.
Normal.
Diffuse lighting value.
Specular lighting value.
Tangent.
Binormal.
Eight texture coordinates.
Categories of debug messages. This will identify the category of a message when retrieving a message with
This is part of the Information Queue feature. See
Query information about graphics-pipeline activity in between calls to
Query information about the reliability of a timestamp query.
For a list of query types see
How frequently the GPU counter increments in Hz.
If this is TRUE, something occurred in between the query's
Describes a query.
Type of query (see
Miscellaneous flags (see
Describes the rasterizer state.
Rasterizer state defines the behavior of the rasterizer stage; to set rasterizer state, call
A member of the
A member of the
Specifies the depth value added to a given pixel. The default value is 0. For more information, see Depth Bias.
Specifies the maximum depth bias of a pixel. The default value is 0.0f. For more information, see Depth Bias.
Specifies a scalar on a given pixel's slope. The default value is 0.0f. For more information, see Depth Bias.
Determines if a triangle is front-facing or back-facing. If this parameter is TRUE, then a triangle is considered front-facing if its vertices are counter-clockwise on the render target, and considered back-facing if they are clockwise. If this parameter is
Enables or disables clipping based on distance. The default value is TRUE.
The hardware always performs x and y clipping of rasterized coordinates. When DepthClipEnable is set to the default value, the hardware also clips the z value (that is, the hardware performs the last step of the following algorithm).
0 < w
-w <= x <= w (or arbitrarily wider range if implementation uses a guard band to reduce clipping burden)
-w <= y <= w (or arbitrarily wider range if implementation uses a guard band to reduce clipping burden)
0 <= z <= w
When you set DepthClipEnable to
Enable or disables scissor-rectangle culling. All pixels outside an active scissor rectangle are culled. The default value is
Enables or disables multisample antialiasing. The default value is
Enable or disables line antialiasing. Note that this option only applies when alpha blending is enabled, you are drawing lines, and the MultisampleEnable member is
Describes the blend state for a render target for a Direct3D 10.1 device
To see how blending is done, see Output-Merger Stage (Direct3D 10).
These are the default values for blend state.
State | Default Value |
---|---|
BlendEnable | |
SrcBlend | |
DestBlend | |
BlendOp | |
SrcBlendAlpha | |
DestBlendAlpha | |
BlendOpAlpha | |
RenderTargetWriteMask |
?
This blend option specifies the first RGB data source and includes an optional pre-blend operation.
This blend option specifies the second RGB data source and includes an optional pre-blend operation.
This blend operation defines how to combine the RGB data sources.
This blend option specifies the first alpha data source and includes an optional pre-blend operation. Blend options that end in _COLOR are not allowed.
This blend option specifies the second alpha data source and includes an optional pre-blend operation. Blend options that end in _COLOR are not allowed.
This blend operation defines how to combine the alpha data sources.
A write mask.
Enable (or disable) blending.
Specifies the subresource(s) from a resource that are accessible using a render-target view.
A render-target-view description is passed into
A render-target-view cannot use the following formats:
If the format is set to
Specifies the subresource(s) from a 3D texture to use in a render-target view.
This structure is one member of a render target view. See
Specifies the subresource(s) from an array of 2D textures to use in a render-target view.
This structure is one member of a render-target-view description (see
Specifies the subresource(s) from a an array of multisampled 2D textures to use in a render-target view.
This structure is one member of a render-target-view description (see
Specifies the elements from a buffer resource to use in a render-target view.
A render-target view is a member of a render-target-view description (see
Specifies the subresource from a 1D texture to use in a render-target view.
This structure is one member of a render-target-view description (see
Specifies the subresource(s) from an array of 1D textures to use in a render-target view.
This structure is one member of a render-target-view description (see
Specifies the subresource from a 2D texture to use in a render-target view.
This structure is one member of a render-target-view description (see
Specifies the subresource from a multisampled 2D texture to use in a render-target view.
Since a multisampled 2D texture contains a single subresource, there is actually nothing to specify in
Defines a 3D box.
The following diagram shows a 3D box, where the origin is the left, front, top corner.
The x position of the left hand side of the box.
The y position of the top of the box.
The z position of the front of the box.
The x position of the right hand side of the box.
The y position of the bottom of the box.
The z position of the back of the box.
Describes a sampler state.
These are the default values for sampler state.
State | Default Value |
---|---|
Filter | Min_Mag_Mip_Point |
AddressU | Clamp |
AddressV | Clamp |
AddressW | Clamp |
MinLOD | 0.0f |
MaxLOD | 3.402823466e+38F (FLT_MAX) |
MipMapLODBias | 0.0f |
MaxAnisotropy | 16 |
ComparisonFunc | Never |
BorderColor | float4(0.0f, 0.0f, 0.0f, 0.0f) |
Texture | N/A |
?
Filtering method to use when sampling a texture (see
Method to use for resolving a u texture coordinate that is outside the 0 to 1 range (see
Method to use for resolving a v texture coordinate that is outside the 0 to 1 range.
Method to use for resolving a w texture coordinate that is outside the 0 to 1 range.
Offset from the calculated mipmap level. For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5.
Clamping value used if
A function that compares sampled data against existing sampled data. The function options are listed in
Border color to use if
Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed.
Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. To have no upper limit on LOD set this to a large value such as D3D10_FLOAT32_MAX.
Describes a shader constant-buffer.
Constants are supplied to shaders in a shader-constant buffer. Get the description of a shader-constant-buffer by calling ID3D10ShaderReflectionConstantBuffer::GetDesc.
The name of the buffer.
The intended use of the constant data. See D3D10_CBUFFER_TYPE.
The number of unique variables.
Buffer size (in bytes).
Shader buffer properties. See D3D10_SHADER_CBUFFER_FLAGS.
Describes a shader signature.
A shader can take n inputs and can produce m outputs. The order of the input (or output) parameters, their associated types, and any attached semantics make up the shader signature. Each shader has an input and an output signature.
When compiling a shader or an effect, some API calls validate shader signatures (such as D3D10CompileShader and
Get a shader-signature from a shader or an effect by calling APIs such as ID3D10ShaderReflection::GetInputParameterDesc or
A per-parameter string that identifies how the data will be used. See Semantics (DirectX HLSL).
Semantic index that modifies the semantic. Used to differentiate different parameters that use the same semantic.
The register that will contain this variable's data.
A predefined string that determines the functionality of certain pipeline stages. See D3D10_NAME.
The per-component-data type that is stored in a register. See D3D10_REGISTER_COMPONENT_TYPE. Each register can store up to four-components of data.
Mask which indicates which components of a register are used.
Mask which indicates whether a given component is never written (if the signature is an output signature) or always read (if the signature is an input signature). The mask is a combination of D3D10_REGISTER_COMPONENT_TYPE values.
Describes a shader-resource view.
A view is a format-specific way to look at the data in a resource. The view determines what data to look at, and how it is cast when read. For more information about how views work, see Views
When viewing a resource, the resource-view description must specify a typed format, that is compatible with the resource format. So that means that you cannot create a resource-view description using any format with _TYPELESS in the name. You can however view a typeless resource by specifying a typed format for the view. For example, a
Create a shader-resource-view description by calling
The viewing format. See remarks.
The resource type of the view. See D3D10_SRV_DIMENSION. This should be the same as the resource type of the underlying resource. This parameter also determines which _SRV to use in the union below.
View the resource as a buffer using information from a shader-resource view (see
View the resource as a 1D texture using information from a shader-resource view (see
View the resource as a 1D-texture array using information from a shader-resource view (see
View the resource as a 2D-texture using information from a shader-resource view (see
View the resource as a 2D-texture array using information from a shader-resource view (see
View the resource as a 2D-multisampled texture using information from a shader-resource view (see
View the resource as a 2D-multisampled-texture array using information from a shader-resource view (see
View the resource as a 3D texture using information from a shader-resource view (see
View the resource as a 3D-cube texture using information from a shader-resource view (see
Specifies the elements in a buffer resource to use in a shader-resource view.
The
Specifies the subresource from a 1D texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Specifies the subresource(s) from an array of 1D textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Specifies the subresource from a 2D texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Specifies the subresource(s) from an array of 2D textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Specifies the subresource(s) from a multisampled 2D texture to use in a shader-resource view.
Since a multisampled 2D texture contains a single subresource, there is actually nothing to specify in
Specifies the subresource(s) from an array of multisampled 2D textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Specifies the subresource(s) from a 3D texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Specifies the subresource from a cube texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
Describes a shader-resource view.
A view is a format-specific way to look at the data in a resource. The view determines what data to look at, and how it is cast when read. For more information about how views work, see Views
When viewing a resource, the resource-view description must specify a typed format, that is compatible with the resource format. So that means that you cannot create a resource-view description using any format with _TYPELESS in the name. You can however view a typeless resource by specifying a typed format for the view. For example, a
Create a shader-resource-view description by calling
This structure requires Windows Vista Service Pack 1.
The viewing format. See remarks.
The resource type of the view. See D3D10_SRV_DIMENSION1. This should be the same as the resource type of the underlying resource. This parameter also determines which _SRV to use in the union below.
View the resource as a buffer using information from a shader-resource view (see
View the resource as a 1D texture using information from a shader-resource view (see
View the resource as a 1D-texture array using information from a shader-resource view (see
View the resource as a 2D-texture using information from a shader-resource view (see
View the resource as a 2D-texture array using information from a shader-resource view (see
View the resource as a 2D-multisampled texture using information from a shader-resource view (see
View the resource as a 2D-multisampled-texture array using information from a shader-resource view (see
View the resource as a 3D texture using information from a shader-resource view (see
View the resource as a 3D-cube texture using information from a shader-resource view (see
View the resource as an array of cube textures using information from a shader-resource view (see
Specifies the subresource(s) from an array of cube textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description (see
This structure requires Windows Vista Service Pack 1.
The member of the vertex decl to do the software skinning on. This is used with the
Defines position, texture, and color information about a sprite.
The sprite's model-world transformation. This defines the position and orientation of the sprite in world space.
Offset from the upper-left corner of the texture indicating where the sprite image should start in the texture. TexCoord is in texture coordinates.
A vector containing the width and height of the sprite in texture coordinates.
A color that will be multiplied with the pixel color before rendering.
Pointer to a shader-resource view representing the sprite's texture. See
The index of the texture. If pTexture does not represent a texture array, then this should be 0.
Indicates the device state.
A state-block mask indicates the device states that a pass or a technique changes. The D3D10StateBlockMaskEnableCapture function provides a convenient way of setting a range of bitmasks for the array members of
Boolean value indicating whether to save the vertex shader state.
Boolean value indicating whether to save the geometry shader state.
Boolean value indicating whether to save the pixel shader state.
Boolean value indicating whether to save the index buffer state.
Boolean value indicating whether to save the input layout state.
Boolean value indicating whether to save the primitive topology state.
Boolean value indicating whether to save the render targets states.
Boolean value indicating whether to save the depth-stencil state.
Boolean value indicating whether to save the blend state.
Boolean value indicating whether to save the viewports states.
Boolean value indicating whether to save the scissor rectangles states.
Boolean value indicating whether to save the rasterizer state.
Boolean value indicating whether to save the stream-out buffers states.
Boolean value indicating whether to save the predication state.
Array of vertex-shader samplers. The array is a multi-byte bitmask where each bit represents one sampler slot.
Array of vertex-shader resources. The array is a multi-byte bitmask where each bit represents one resource slot.
Array of vertex-shader constant buffers. The array is a multi-byte bitmask where each bit represents one constant buffer slot.
Array of geometry-shader samplers. The array is a multi-byte bitmask where each bit represents one sampler slot.
Array of geometry-shader resources. The array is a multi-byte bitmask where each bit represents one resource slot.
Array of geometry-shader constant buffers. The array is a multi-byte bitmask where each bit represents one buffer slot.
Array of pixel-shader samplers. The array is a multi-byte bitmask where each bit represents one sampler slot.
Array of pixel-shader resources. The array is a multi-byte bitmask where each bit represents one resource slot.
Array of pixel-shader constant buffers. The array is a multi-byte bitmask where each bit represents one constant buffer slot.
Array of vertex buffers. The array is a multi-byte bitmask where each bit represents one resource slot.
Description of a vertex element in a vertex buffer in an output slot.
Type of output element. Possible values: "POSITION", "NORMAL", or "TEXCOORD0".
Output element's zero-based index. Should be used if, for example, you have more than one texture coordinate stored in each vertex.
Which component of the entry to begin writing out to. Valid values are 0 ~ 3. For example, if you only wish to output to the y and z components of a position, then StartComponent should be 1 and ComponentCount should be 2.
The number of components of the entry to write out to. Valid values are 1 ~ 4. For example, if you only wish to output to the y and z components of a position, then StartComponent should be 1 and ComponentCount should be 2.
The output slot that contains the vertex buffer that contains this output entry.
Query information about the amount of data streamed out to the stream-output buffers in between
Describes a 1D texture.
This structure is used in a call to
Describes a 2D texture.
This structure is used in a call to
The device places some size restrictions (must be multiples of a minimum size) for a subsampled, block compressed, or bit-format resource.
Describes a 3D texture.
This structure is used in a call to
The device restricts the size of subsampled, block compressed (see Block Compression (Direct3D 10)), and bit format resources to be multiples of sizes specific to each format.
Describes parameters used to load a texture from another texture.
This structure is used in a call to
Source texture box (see
Destination texture box (see
Source texture mipmap level, see D3D10CalcSubresource for more detail.
Destination texture mipmap level, see D3D10CalcSubresource for more detail.
Number of mipmap levels in the source texture.
First element of the source texture.
First element of the destination texture.
Number of elements to load.
Filtering options during resampling (see
Filtering options when generating mip levels (see
Defines the dimensions of a viewport.
In all cases, Width and Height must be ? 0 and TopLeftX + Width and TopLeftY + Height must be ? D3D10_VIEWPORT_BOUNDS_MAX.