Creates both a resource and an implicit heap large enough to contain the entire resource; the resource is mapped to the heap.
public:
HRESULT D3DAPI CreateCommittedResourceX(
const D3D12_HEAP_PROPERTIES *pHeapProperties,
D3D12_HEAP_FLAGS HeapFlags,
const D3D12XBOX_RESOURCE_DESC *pResourceDesc,
D3D12_RESOURCE_STATES InitialState,
const D3D12_CLEAR_VALUE *pOptimizedClearValue,
REFIID riidResource,
void **ppvResource
)
pHeapProperties
Type: D3D12_HEAP_PROPERTIES *
[in] A pointer to a D3D12_HEAP_PROPERTIES structure that provides properties for the resource’s heap.
HeapFlags
Type: D3D12_HEAP_FLAGS
Heap options as a bitwise-OR’d combination of D3D12_HEAP_FLAGS enumeration constants.
pResourceDesc
Type: D3D12XBOX_RESOURCE_DESC *
[in] A pointer to a D3D12XBOX_RESOURCE_DESC structure that describes the resource.
InitialState
Type: D3D12_RESOURCE_STATES
The initial state of the resource as a bitwise-OR’d combination of D3D12_RESOURCE_STATES enumeration constants.
When a resource is created together with a D3D12_HEAP_TYPE_UPLOAD heap, InitialState must be D3D_RESOURCE_STATE_GENERIC_READ; when created together with a D3D12_HEAP_TYPE_READBACK heap, InitialState must be D3D12_RESOURCE_STATE_COPY_DEST.
pOptimizedClearValue
Type: D3D12_CLEAR_VALUE *
[in, optional] Specifies a D3D12_CLEAR_VALUE that describes the default value for a clear color.
pOptimizedClearValue specifies a value for which clear operations are most optimal. When the created resource is a texture with either the D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL flags, titles should choose the value that the clear operation will be called with most commonly. Clear operations can be called with other values, but those operations will not be as efficient as when the value matches the one passed into resource creation. pOptimizedClearValue must be null when used with D3D12_RESOURCE_DIMENSION_BUFFER.
riidResource
Type: REFIID
The globally unique identifier (GUID) for the resource interface. This is an input parameter. The REFIID, or GUID, of the interface to the resource can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12Resource) will get the GUID of the interface to a resource.
While riidResource is most commonly the GUID for ID3D12Resource, it may be any GUID for any interface. If the resource object doesn’t support the interface for this GUID, creation will fail with E_NOINTERFACE.
**ppvResource
Type: void
[out, optional] A pointer to memory that receives the requested interface pointer to the created resource object. ppvResource can be null to enable capability testing; when CreateCommittedResourceX is called with ppvResource set to null, no object will be created and S_FALSE will be returned when pResourceDesc is valid.
Type: HRESULT D3DAPI
E_OUTOFMEMORY if there is insufficient memory to create the resource. For other possible return values, see Direct3D 12 return codes.
This method creates both a resource and an implicit heap large enough to contain the entire resource, which is mapped there. The created heap is known as an implicit heap because the heap object cannot be obtained by the application. The application must ensure the GPU will no longer read or write to this resource before releasing the final reference on the resource.
The implicit heap is made resident for GPU access before the method returns to the application. See Residency.
The resource GPU VA mapping cannot be changed. See ID3D12CommandQueue::UpdateTileMappings and Volume Tiled Resources.
This method may be called by multiple threads concurrently.
Header: Declared in d3d12_x.h.
Library: Use d3d12_x.lib.