GPUOpen-LibrariesAndSDKs / AMF

The Advanced Media Framework (AMF) SDK provides developers with optimal access to AMD devices for multimedia processing
Other
584 stars 149 forks source link

[Question]: Is D3D12 encoding properly supported? #487

Open MichaelLudeo opened 3 days ago

MichaelLudeo commented 3 days ago

I am searching the code samples for d3d12 related encoding example and I can't find one. In SimpleEncoder.cpp I see some functions kind of ready for d3d12, but there is also commented our code like this:

#ifdef _WIN32
//static amf::AMF_MEMORY_TYPE memoryTypeIn  = amf::AMF_MEMORY_DX11;
//static amf::AMF_MEMORY_TYPE memoryTypeIn = amf::AMF_MEMORY_DX12;
static amf::AMF_MEMORY_TYPE memoryTypeIn = amf::AMF_MEMORY_VULKAN;
#else
static amf::AMF_MEMORY_TYPE memoryTypeIn  = amf::AMF_MEMORY_VULKAN;
#endif

Does AMF provide solid support for d3d12? If it is , should I do something specific for this case, like explicit synchronization of data transfer at the start/end of encoding?

For example, when I create D3D texture resource from which I am going to submit image data to the encoder,what flags should be set?

D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET? Or maybe also D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS ?

MikhailAMD commented 2 days ago

AMF does fully support D3D12. But because AMF is kind of abstraction in many cases particular D3D API is not very visible. Agreed, we need to provide more documentation in this area. Few points:

MichaelLudeo commented 2 days ago

Yeah, the lib has thrown me on missing D3D12_HEAP_FLAG_SHARED flag right away. Now it all works. Thanks for the detailed answer ))