PFND3D10DDI_CREATERESOURCE callback function (d3d10umddi.h)

Creates a resource.

Syntax

PFND3D10DDI_CREATERESOURCE Pfnd3d10ddiCreateresource;

void Pfnd3d10ddiCreateresource(
  D3D10DDI_HDEVICE unnamedParam1,
  const D3D10DDIARG_CREATERESOURCE *unnamedParam2,
  D3D10DDI_HRESOURCE unnamedParam3,
  D3D10DDI_HRTRESOURCE unnamedParam4
)
{...}

Parameters

unnamedParam1

hDevice [in]

A handle to the display device (graphics context).

unnamedParam2

pCreateResource [in]

A pointer to a D3D10DDIARG_CREATERESOURCE structure that describes the parameters that the user-mode display driver uses to create a resource.

unnamedParam3

hResource [in]

A handle to the driver's private data for the resource.

unnamedParam4

hRTResource [in]

A handle to the resource that the driver should use anytime it calls back into the Direct3D runtime.

Return value

None

Remarks

The driver can use the pfnSetErrorCb callback function to set an error code.

The driver might run out of memory. Therefore, the driver can pass E_OUTOFMEMORY or D3DDDIERR_DEVICEREMOVED in a call to the pfnSetErrorCb function. The driver can also pass DXGI_DDI_ERR_UNSUPPORTED in a call to pfnSetErrorCb. For more information about passing DXGI_DDI_ERR_UNSUPPORTED, see the Remarks section of the BltDXGI reference page. The Direct3D runtime will determine that any other errors are critical. If the driver passes any errors, including D3DDDIERR_DEVICEREMOVED, the Direct3D runtime will determine that the handle is invalid; therefore, the runtime will not call the DestroyResource(D3D10) function to destroy the handle that the hResource parameter specifies.

The runtime will validate all parameters against the parameters that an application sent to create the resource. Therefore, the driver should not receive invalid combinations.

If the application does not require the contents of the resource to persist across presentations, the runtime will set the D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT flag of the D3D10_DDI_RESOURCE_MISC_FLAG enumeration in the MiscFlags member of the D3D10DDIARG_CREATERESOURCE structure that the pCreateResource parameter points to. Presentation occurs when the driver's PresentDXGI or BltDXGI (with the Present flag set in the DXGI_DDI_ARG_BLT_FLAGS structure) function is called. The runtime uses the D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT flag to create swap-chain back buffers when an application uses the DXGI_SWAP_EFFECT_DISCARD value to request swap chains.

Creating a Stereo Back Buffer

Beginning in Windows 8, if the driver must create a stereo back buffer, it should set members of the D3D10DDIARG_CREATERESOURCE structure pointed to by pCreateResource as follows:
  1. Set the ArraySize member to a value of 2.
  2. Set the D3D10_DDI_BIND_PRESENT flag value in the BindFlags member.
Additionally, to support stereo presentation, the BltDXGI function must allow any values for the DstSubresource and SrcSubresource members of the DXGI_DDI_ARG_BLT structure that are within the range of the source and destination resources.

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Target Platform Desktop
Header d3d10umddi.h (include D3d10umddi.h)

See also

BltDXGI

CalcPrivateResourceSize

D3D10DDIARG_CREATERESOURCE

D3D10DDI_DEVICEFUNCS

DXGI_DDI_ARG_BLT

DestroyResource(D3D10)

pfnSetErrorCb