MCPcopy Create free account
hub / github.com/baldurk/renderdoc / sampleCode

Function sampleCode

docs/python_api/examples/renderdoc/decode_mesh.py:223–249  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

221 print("\tAttribute '%s': %s" % (attr.name, value))
222
223def sampleCode(controller):
224 # Find the biggest drawcall in the whole capture
225 draw = None
226 for d in controller.GetRootActions():
227 draw = biggestDraw(draw, d)
228
229 # Move to that draw
230 controller.SetFrameEvent(draw.eventId, True)
231
232 print("Decoding mesh inputs at %d: %s\n\n" % (draw.eventId, draw.GetName(controller.GetStructuredFile())))
233
234 # Calculate the mesh input configuration
235 meshInputs = getMeshInputs(controller, draw)
236
237 # Fetch and print the data from the mesh inputs
238 printMeshData(controller, meshInputs)
239
240 print("Decoding mesh outputs\n\n")
241
242 # Fetch the postvs data
243 postvs = controller.GetPostVSData(0, 0, rd.MeshDataStage.VSOut)
244
245 # Calcualte the mesh configuration from that
246 meshOutputs = getMeshOutputs(controller, postvs)
247
248 # Print it
249 printMeshData(controller, meshOutputs)
250
251def loadCapture(filename):
252 # Open a capture file handle

Callers 2

remote_capture.pyFile · 0.70
decode_mesh.pyFile · 0.70

Calls 9

printFunction · 0.85
getMeshInputsFunction · 0.85
printMeshDataFunction · 0.85
getMeshOutputsFunction · 0.85
GetPostVSDataMethod · 0.80
biggestDrawFunction · 0.70
SetFrameEventMethod · 0.45
GetNameMethod · 0.45
GetStructuredFileMethod · 0.45

Tested by

no test coverage detected