You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: desktop-src/direct3dtools/pix/articles/gpu-captures/pix-custom-visualizers.md
+82-4Lines changed: 82 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Custom texture/mesh visualizers in PIX
3
3
description: Documenting how to use custom texture/mesh visualizers with PIX
4
4
ms.topic: concept-article
5
-
ms.date: 10/18/2024
5
+
ms.date: 01/30/2025
6
6
---
7
7
8
8
# Custom texture/mesh visualizers in PIX
@@ -82,7 +82,7 @@ To get more information on the API, refer to the HLSL API section.
82
82
83
83

84
84
85
-
## Custom buffer visualizer
85
+
## Custom mesh visualizer
86
86
87
87
Assuming you've set up paths to your visualizer shaders in the settings, you can now see your visualizers listed in the *Custom Visualization* panel, which you can open using the following buffer viewer toolbar icon: `{}`.
88
88
@@ -92,7 +92,7 @@ From that panel, you can select any available custom visualizer, and see any war
92
92
93
93

94
94
95
-
### Creating a custom buffer visualizer
95
+
### Creating a custom mesh visualizer
96
96
97
97
A visualizer is a compute shader running against the selected event, and whose output will be displayed in the mesh viewer in place of the buffer viewer showing the currently selected buffer data. To be successfully recognized by PIX, your entry point must be named **main**.
98
98
@@ -141,13 +141,51 @@ In the example above, we access vertices declaring `Vertices` to point to the pi
141
141
142
142
To get more information on the API, refer to the HLSL API section.
143
143
144
-

144
+

145
145
146
146
### Visualize a buffer as a texture
147
147
148
148
It is also possible to select a buffer and a custom visualizer outputting to a texture. In that case,
149
149
the texture viewer will be displayed in place of the regular buffer viewer to display the result.
150
150
151
+
## Custom buffer visualizer
152
+
153
+
The custom buffer visualizer works the same as the custom mesh visualizer, except instead of outputing to a pair of index and vertex buffers, it outputs to a `RWStructuredBuffer`. The buffer viewer is shown displaying the output and the buffer format applied to the viewer is automatically populated from the structured buffer template type. This kind of visualizer is useful, among other things, to reinterpret buffer data where multiple indirections might be involved or where the meaning of the data is not easily human-readable without further modification and interpretation. It can also be used to aggregate information coming from multiple resources and display the result in a specified format.
154
+
155
+
### Creating a custom buffer visualizer
156
+
157
+
To create the visualizer, there are two required steps. A type is declared as the output type using `PixExt_Declare_BufferOutput_Type`. The buffer viewer format is derived from that type. Then, data is sent to output using `PixExt_StoreBufferData` where the offset into the structured buffer and the data to store are specified.
158
+
159
+
To get more information on the API, refer to the HLSL API section.

188
+
151
189
## User constants
152
190
153
191
It is possible to add constants whose values can be set from the UI for every visualizer invocation. They are supported for all custom visualizer types.
Custom visualizer shaders will be compiled using Shader Model 6.6 (namely cs_6_6) and HLSL version 2021. We plan to support newer shader models and relax the restriction on HLSL 2021 in a future release.
0 commit comments