Radeon™ GPU Analyzer 2.3 for Direct3D® 12 Graphics

Originally posted:

Earlier this year, RGA 2.2 shipped with a new mode of the command line tool that added support for Direct3D® 12 compute pipelines. RGA 2.3 extends that functionality to support graphics pipelines as well. Using the new mode you can compile D3D®12 graphics pipelines and generate GCN/RDNA ISA disassembly and hardware resource usage statistics for a variety of target GPUs, regardless of the device that is physically installed on your system.

Using RGA 2.3 for D3D12

This article explains how RGA for DX12 works. A key difference between the new dx12 mode (-s dx12) and the older dx11 mode (-s dx11, previously named-s hlsl) is that the dx12 mode uses the live driver and follows the same compilation path as a real-world D3D12 application. With that comes the power of generating disassembly and hardware resource usage statistics that are closest to the real-world case, and therefore making better performance optimization decisions.

To compile a D3D12 graphics pipeline, you would need to provide the following inputs to the tool, in addition to the HLSL source files:

  • Root signature: The root signature can be either defined in the HLSL source code or provided in a pre-compiled binary file, as described in our previous article. .gpso file: For compute pipelines, the HLSL source code, together with a valid root signature, are enough for performing a successful compilation of the pipeline. For graphics, however, a subset of the D3D12 graphics pipeline state is required as well. Without that additional data, RGA would not be able to properly set the pipeline state for your shaders and this would result in a compilation failure. The subset of the graphics pipeline state that RGA requires is defined in a custom .gpso file of the following format:
Terminal window
# schemaVersion
1.0
# InputLayoutNumElements: Number of D3D12_INPUT_ELEMENT_DESC elements in the D3D12_INPUT_LAYOUT_DESC structure.
# Must match the following "InputLayout" section.
2
# InputLayout
# { SemanticName, SemanticIndex, Format, InputSlot, AlignedByteOffset, InputSlotClass, InstanceDataStepRate }
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }
# PrimitiveTopologyType: The D3D12_PRIMITIVE_TOPOLOGY_TYPE value to be used when creating the PSO.
D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE
# NumRenderTargets: The number of formats in the upcoming RTVFormats section.
1
# RTVFormats: An array of DXGI_FORMAT-typed values for the render target formats.
# The number of items in the array should match the above NumRenderTargets section.
{ DXGI_FORMAT_R8G8B8A8_UNORM }

Related news and technical articles

Related videos