MCPcopy Create free account
hub / github.com/crownengine/crown / createCommittedResource

Function createCommittedResource

3rdparty/bgfx/src/renderer_d3d12.cpp:550–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548 }
549
550 ID3D12Resource* createCommittedResource(ID3D12Device* _device, HeapProperty::Enum _heapProperty, const D3D12_RESOURCE_DESC* _resourceDesc, const D3D12_CLEAR_VALUE* _clearValue, bool _memSet = false)
551 {
552 const HeapProperty& heapProperty = s_heapProperties[_heapProperty];
553 ID3D12Resource* resource;
554 DX_CHECK(_device->CreateCommittedResource(&heapProperty.m_properties
555 , D3D12_HEAP_FLAG_NONE
556 , _resourceDesc
557 , heapProperty.m_state
558 , _clearValue
559 , IID_ID3D12Resource
560 , (void**)&resource
561 ) );
562 BX_WARN(NULL != resource, "CreateCommittedResource failed (size: %d). Out of memory?"
563 , _resourceDesc->Width
564 );
565
566 if (BX_ENABLED(BX_PLATFORM_XBOXONE)
567 && _memSet)
568 {
569 void* ptr;
570 DX_CHECK(resource->Map(0, NULL, &ptr) );
571 D3D12_RESOURCE_ALLOCATION_INFO rai;
572#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER) )
573 rai = _device->GetResourceAllocationInfo(1, 1, _resourceDesc);
574#else
575 _device->GetResourceAllocationInfo(&rai, 1, 1, _resourceDesc);
576#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER) )
577 bx::memSet(ptr, 0, size_t(rai.SizeInBytes) );
578 resource->Unmap(0, NULL);
579 }
580
581 return resource;
582 }
583
584 ID3D12Resource* createCommittedResource(ID3D12Device* _device, HeapProperty::Enum _heapProperty, uint64_t _size, D3D12_RESOURCE_FLAGS _flags = D3D12_RESOURCE_FLAG_NONE)
585 {

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 1

memSetFunction · 0.85

Tested by

no test coverage detected