Desktop API: Optimizing Shaders
- Select one or more draw calls for which you would like to analyze the shader code.
- From the Resource List, choose the shader used in the selected draw calls.Graphics Frame Analyzerdisplays the shader source code and all the resources used by the shader.
- In theShader Resource List, analyze resources used in the shaders grouped by type:
Graphics Frame Analyzer displays various resource parameters, the shader type using the resource, and shader registers each resource is bound to. Resources are listed in the following format:To open a resource, click the desired resource name.<shader name>:<register ID> <resource type>:<resource ID> (<view type><view ID>) <resource debug name>
- Atomic Buffer (atomic)
- Image (IMG)
- Render Target (RT)
- Shader Storage Buffer Object (SSBO)
- Texture (TEX)
- Transform Feedback Buffer Object (TFBO)
- Uniform Buffer Object (UBO)
- Vertex Buffer Object (VBO)
- From theShader Typedrop-down list, select the type of shader you would like to analyze from the drop down menu . The shader code opens in theShader Editor. For easier reading, you can click the
- While Assembly code is read-only, you can experiment with the HLSL code for DirectX* and HLSL and GLSL for Vulkan*, if these codes are available for your shader. In this case, select HLSL or GLSL from the respective drop-down menu and edit the code directly in theShader Viewer. The shader recompiles on the fly. If you introduced any errors, you can see the corresponding message in theNotificationpane below theShader Editor.
- If the code looks fine, click theMetricspane and in theMainbar Chart.TIPWhen you click the
- If you want to undo your edits, click the