• Intel® Graphics Performance Analyzers 2019 R4
  • 12/20/2019
  • Public Content
Contents

Desktop API: Optimizing Shaders

To determine whether shaders cause a performance bottleneck for the selected draw calls, you can change the shader code inside Graphics Frame Analyzer and check the performance effect without recompiling your code.
To experiment with shader code:
  1. Select one or more draw calls for which you would like to analyze the shader code.
  2. From the Resource List, choose the shader used in the selected draw calls.
    Graphics Frame Analyzer
    displays the shader source code and all the resources used by the shader.
  3. In the
    Shader Resource List
    , analyze resources used in the shaders grouped by type:
    • Atomic Buffer (atomic)
    • Image (IMG)
    • Render Target (RT)
    • Sampler
    • Shader Storage Buffer Object (SSBO)
    • Texture (TEX)
    • Transform Feedback Buffer Object (TFBO)
    • Uniforms
    • Uniform Buffer Object (UBO)
    • Vertex Buffer Object (VBO)
    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:
    <shader name>:<register ID>         <resource type>:<resource ID> (<view type><view ID>) <resource debug name>
    To open a resource, click the desired resource name.
  4. From the
    Shader Type
    drop-down list, select the type of shader you would like to analyze from the drop down menu . The shader code opens in the
    Shader Editor
      . For easier reading, you can click the
    button to indent the code, and the
    button to preprocess the selected shader and hide the code paths that do not get executed.
  5. 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 the
    Shader Viewer
    . The shader recompiles on the fly. If you introduced any errors, you can see the corresponding message in the
    Notification
    pane below the
    Shader Editor
    .
  6. If the code looks fine, click the
    button to save the changes. Graphics Frame Analyzer recalculates all metrics and displays new data in the
    Metrics
    pane and in the
    Main
    bar Chart.
    TIP
    When you click the
    button, Graphics Frame Analyzer saves all the shaders. This enables you to write your own code and replace the whole shader to experiment.
  7. If you want to undo your edits, click the
    button. The original shaders are restored.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804