Skip to content

Instantly share code, notes, and snippets.

@vinjn
Last active February 28, 2024 03:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vinjn/fecd33ff8c407d7c31e8392142318f1c to your computer and use it in GitHub Desktop.
Save vinjn/fecd33ff8c407d7c31e8392142318f1c to your computer and use it in GitHub Desktop.
# RenderDoc Python scripts, powered by IronPython 2.7.4.1000
# The 'pyrenderdoc' object is the Core class instance.
# The 'renderdoc' module is available, as the matching namespace in C#
dump_draws = True
dump_draw_events = False
dump_draw_children = True
dump_textures = True
dump_buffers = True
rdc = pyrenderdoc
output_name = rdc.LogFileName + ".txt"
file = open(output_name,"w")
file.write("%s\n" % (rdc.LogFileName))
file.write("%s\n" % (rdc.APIProps.pipelineType))
def dump_draw(draw, level):
file.write("%s%s" % ("\t\t"*level, draw.name))
for output in draw.outputs:
file.write("\tC_%s" % (output))
file.write("\tZ_%s" % (draw.depthOut))
file.write("\n")
if dump_draw_events:
for evt in draw.events:
file.write("%s\n" % (evt.eventDesc))
if dump_draw_children:
for child in draw.children:
dump_draw(child, level+1)
if dump_draws:
file.write("\n============draw=======\n\n")
for draw in rdc.CurDrawcalls:
dump_draw(draw, 0)
if dump_textures:
file.write("\n============texture=======\n\n")
for tex in rdc.CurTextures:
file.write("ResID_%s\t%-18s\t%-25s\t%-20s\t%dx%dx%dx%d[%d]\t\t\t%s\n" %
(tex.ID, tex.resType, tex.format, tex.creationFlags,
tex.width, tex.height, tex.depth, tex.mips,tex.arraysize,
tex.name))
if dump_buffers:
file.write("\n============buffer=======\n")
for buf in rdc.CurBuffers:
file.write("ResID_%-7s\t%-10s\t%s\t%d\n" % (buf.ID, buf.creationFlags, buf.name, buf.length))
print("Written to %s" % (output_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment