MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / createCommittedResource

Function createCommittedResource

Source/3rdParty/bgfx/src/renderer_d3d12.cpp:506–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504 }
505
506 ID3D12Resource* createCommittedResource(ID3D12Device* _device, HeapProperty::Enum _heapProperty, const D3D12_RESOURCE_DESC* _resourceDesc, const D3D12_CLEAR_VALUE* _clearValue, bool _memSet = false)
507 {
508 const HeapProperty& heapProperty = s_heapProperties[_heapProperty];
509 ID3D12Resource* resource;
510 DX_CHECK(_device->CreateCommittedResource(&heapProperty.m_properties
511 , D3D12_HEAP_FLAG_NONE
512 , _resourceDesc
513 , heapProperty.m_state
514 , _clearValue
515 , IID_ID3D12Resource
516 , (void**)&resource
517 ) );
518 BX_WARN(NULL != resource, "CreateCommittedResource failed (size: %d). Out of memory?"
519 , _resourceDesc->Width
520 );
521
522 if (BX_ENABLED(BX_PLATFORM_XBOXONE)
523 && _memSet)
524 {
525 void* ptr;
526 DX_CHECK(resource->Map(0, NULL, &ptr) );
527 D3D12_RESOURCE_ALLOCATION_INFO rai;
528#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER))
529 rai = _device->GetResourceAllocationInfo(1, 1, _resourceDesc);
530#else
531 _device->GetResourceAllocationInfo(&rai, 1, 1, _resourceDesc);
532#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER))
533 bx::memSet(ptr, 0, size_t(rai.SizeInBytes) );
534 resource->Unmap(0, NULL);
535 }
536
537 return resource;
538 }
539
540 ID3D12Resource* createCommittedResource(ID3D12Device* _device, HeapProperty::Enum _heapProperty, uint64_t _size, D3D12_RESOURCE_FLAGS _flags = D3D12_RESOURCE_FLAG_NONE)
541 {

Callers 8

initMethod · 0.85
readTextureMethod · 0.85
requestScreenShotMethod · 0.85
postResetMethod · 0.85
updateResolutionMethod · 0.85
createMethod · 0.85
updateMethod · 0.85
initMethod · 0.85

Calls 2

memSetFunction · 0.85
MapMethod · 0.80

Tested by

no test coverage detected