RenderMan Shader Profiling

March 2006


1 Introduction

Shader profiling identifies hotspots in shaders, taking the guesswork out of optimization. Shader hotspots include call stacks, allowing a detailed understanding of the context in which heavily used library routines are called. Each hotspot is linked to its source code, simplifying browsing and analysis.

Profiling is enabled with the following RIB option, which specifies an output filename:

    Option "statistics" "shaderprofile" ["profile.xml"]
When profiling is enabled, single-threaded rendering should be used to ensure accurate timing, i.e. using "prman -t:1"

The impact on execution time and memory is modest. Profiling typically increases overall time by less than 5% and uses a few hundred kilobytes per shader.

Important: Shaders compiled with older versions of the shader compiler (before Release 13) will not be profiled. The output of the profiler includes a list of any shaders that require recompilation.

2 Viewing hotspots

The output file is XML, which is linked to a stylesheet. Simply load the file in a Web browser (IE 6, NS 7, or Firefox) to browse the results. The profiling results contain a list of shading hotspots, each of which includes the elapsed time, source filename and line number, and the name of the calling function.

If problems arise, try the following:

3 Browsing source code

Simply click on the line number of a hotspot to inspect its source code:

Filesystem issues can complicate source code browsing. The full path to each source file (including header files) is recorded when a shader is compiled. If those paths are not valid on the computer where the results are viewed, source browsing is not possible. A simple workaround is to search-and-replace directory names in the profiler output file.

Other issues may arise:


4 Viewing hotspot contexts

If a hotspot is in a function with more than one caller, you might want to know which call site was the most expensive. Simply click on the "Details" checkbox to see the list of callers, along with the percentage contributed by each call site:


5 Viewing call stacks

The complete call stack of a hotspot can also be examined by selecting the "Details" checkbox of a particular caller:


 

Pixar Animation Studios
(510) 752-3000 (voice)  (510) 752-3151 (fax)
Copyright © 1996- Pixar. All rights reserved.
RenderMan® is a registered trademark of Pixar.