NVIDIA® Nsight™ Development Platform, Visual Studio Edition 3.2 User Guide
Send Feedback
Sometimes starting up an application and getting to a specific spot can take a very long time. Instead, you can save the capture to disk, and reload it later for a much faster startup. Using this method, the capture can also be shared among the development team, to point out any potential errors or problems.
![]() |
Note that the supported APIs for this feature are Direct3D 9, Direct3D 11, and Direct3D 11.1. |
Documents\NVIDIA Nsight\Captures
directory. Captures
directory in Visual Studio. Saving a capture will generate the source code, as well as project and solution files for Visual Studio 2008 and 2010. ![]() | Note that the Visual Studio 2010 solution files can be opened in Visual Studio 2012, where you can choose to upgrade the files for compatibility. |
Main.cpp
– This is where all of the initialization code is called, resources are created, and each frame portion is called in a message loop.ResourcesNN.cpp
– Depending on the number of resources to be created, there will be multiple ResourcesNN.cpp
files, each with a CreateResourcesNN
call in them, that will construct all of the resources (device(s), textures, shaders, etc.) that are used in the scene. These are called in Main.cpp
before replaying the frame in the message loop.FrameSetup.cpp
– This file contains all of the state setting calls to set the API state to the proper values for the beginning of the frame, including what buffers are bound, which shaders are enabled, etc.FrameNPartMM.cpp
– These files contain the API functions, each named RunFrameNPartMM()
, to replay the frame. It is split into multiple files so generated code is easier to work with. These functions are called sequentially in the message loop in Main.cpp
.ReadOnlyDatabase.cpp
– This is a helper class to access resource data that is stored in the data.bin
file. It is accessed throughout the code via the GetResource()
call.Helpers.cpp
– These functions are used throughout the replayer for various conversions and access to the ReadOnlyDatabase
.If you want to change a resource (for example, to swap in a different texture), you can change the parameters for the construction by looking within the ResourcesNN.cpp
files for the texture in question. Textures can be matched by size and/or format. Once you find the variable for the texture (or in the case of Direct3D 9, contained surface), look for that name in the FrameSetup.cpp
file. This will contain source lines to lock the texture, call GetResource()
to retrieve the data from the ReadOnlyDatabase
, and then call memcpy(…)
to link the data to the texture. You can substitute the call to the ReadOnlyDatabase
with a call to read from a file of choice to load the alternate texture.
If you want to change the state for a given draw call, you can locate the draw call by replaying the capture within NVIDIA Nsight and scrubbing to find the call you want to examine. Search in the FrameNPartMM.cpp
files for Draw NN, where NN is the 0-based draw call index that NVIDIA Nsight displayed on the scrubber. Doing this will bring you to the source line for that draw call, and from here, you can add any state changes before that call. Alternatively, you can also disable that specific call by commenting out the source call containing the draw call.
-repeat N
– This setting enables NVIDIA Nsight to use serialized captures in the normal arch workflow. The N setting indicates the number of times to repeat the entire capture; the default setting is -1, which keeps the capture running on an infinite loop.
NVIDIA® Nsight™ Development Platform, Visual Studio Edition User Guide Rev. 3.2.131009 ©2009-2013. NVIDIA Corporation. All Rights Reserved.