RadeonImageFilter icon indicating copy to clipboard operation
RadeonImageFilter copied to clipboard

Documentation clarifications

Open BartSiwek opened this issue 3 years ago • 2 comments

I am working on an integration of RadeonImageFilter along side of an existing D3D12 pipeline and I found some parts of the documentation unclear. I am referring here to the documentation posted at https://radeon-pro.github.io/RadeonProRenderDocs/en/rif/.

  • Firstly the rifContextCreateImageFromDirectX12Memory has the following description on the website
Creates a new image object with the defined format and DirectX12 resource associated with the context.

While in the RadeonImageFilters_directx12.h this function is described as

Creates the new rif_image object with defined by \p image_desc format associated with rif_context, and DirectX12 buffer object containing image data.

It any resource (both texture and buffer) as the online docs say or is it just buffers as the header says? Also - are there any requirements on the resource? Like heap it needs to reside in etc.?

  • Secondly the function rifSyncronizeQueue is described as
Syncronizes the queue.

What does that mean? Is is CPU-GPU synchronization? GPU-GPU? Is there a pipeline barrier involved? A fence? It needs to be clarified more. Additionally, I believe its Synchronize not Syncronize (but I am not a native English speaker so I might be wrong).

  • Lastly the rif_performance_statistic is not described on the online documentation at all and the header file is missing any information about units of measurement used by the structure.

BartSiwek avatar Oct 07 '21 19:10 BartSiwek

Hi @BartSiwek, Thanks for your comments. Regarding the first question, the RIF processes both of type. Resource can be a texture or a buffer. It's depend on Dimension of D3D12_RESOURCE_DESC structure. For D3D12_RESOURCE_DIMENSION_BUFFER and D3D12_RESOURCE_DIMENSION_UNKNOWN it'll be a buffer, otherwise a texture. But for DX12, the resource is always committed as a buffer. There are no special requirements on the resource.

Second, Unfortunately, this mechanism is only implemented for the OpenCL backend. It calls clFinish(). This is not implemented for DX12. But we use CPU-GPU synchronization for execution command list. And about the typo, you are absolutely right, thanks a lot.

rif_performance_statistic has boolean parameters corresponding to each type of time measurement (measure_execution_time measures the kernel execution time, and measure_compile_time measures the kernel compilation time). For example, you should create an object { 0, true, 0.0f, true, } and pass a reference to it to rifContextExecuteCommandQueue. The results will be in milliseconds.

Best regards.

givinar avatar Oct 11 '21 14:10 givinar

Hi,

Thank you for the clarifications. They were very useful.

BartSiwek avatar Oct 13 '21 22:10 BartSiwek