From 62babcb4974d9df9d2cda2b3f5f6933113f2cf40 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 24 Nov 2021 14:08:52 +0000 Subject: [PATCH] Fix python example for API change --- docs/python_api/examples/renderdoc/fetch_shader.py | 2 +- docs/python_api/examples/renderdoc/fetch_shader.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/python_api/examples/renderdoc/fetch_shader.py b/docs/python_api/examples/renderdoc/fetch_shader.py index f5f5c01d9..1639285db 100644 --- a/docs/python_api/examples/renderdoc/fetch_shader.py +++ b/docs/python_api/examples/renderdoc/fetch_shader.py @@ -50,7 +50,7 @@ def sampleCode(controller): print("Pixel shader:") print(controller.DisassembleShader(pipe, ps, target)) - cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, entry, 0, cb.resourceId, 0, 0) + cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, rd.ShaderStage.Pixel, entry, 0, cb.resourceId, 0, 0) for v in cbufferVars: printVar(v) diff --git a/docs/python_api/examples/renderdoc/fetch_shader.rst b/docs/python_api/examples/renderdoc/fetch_shader.rst index d97987226..7579b82df 100644 --- a/docs/python_api/examples/renderdoc/fetch_shader.rst +++ b/docs/python_api/examples/renderdoc/fetch_shader.rst @@ -43,7 +43,7 @@ Now we want to display the constants bound to this shader. Shader bindings is an .. highlight:: python .. code:: python - cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, entry, 0, cb.resourceId, 0, 0) + cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, rd.ShaderStage.Pixel, entry, 0, cb.resourceId, 0, 0) Since constants can contain structs of other constants, we want to define a recursive function that will iterate over a constant and print it along with its value. We want to handle both vectors and matrices so we need to iterate over both rows and columns for each variable.