diff --git a/docs/python_api/examples/renderdoc/fetch_shader.py b/docs/python_api/examples/renderdoc/fetch_shader.py index 32191f8b3..c005b7431 100644 --- a/docs/python_api/examples/renderdoc/fetch_shader.py +++ b/docs/python_api/examples/renderdoc/fetch_shader.py @@ -45,12 +45,12 @@ def sampleCode(controller): # Get the pixel shader's reflection object ps = state.GetShaderReflection(rd.ShaderStage.Pixel) - cb = state.GetConstantBuffer(rd.ShaderStage.Pixel, 0, 0) + cb = state.GetConstantBlock(rd.ShaderStage.Pixel, 0, 0) print("Pixel shader:") print(controller.DisassembleShader(pipe, ps, target)) - cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, rd.ShaderStage.Pixel, entry, 0, cb.resourceId, 0, 0) + cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, rd.ShaderStage.Pixel, entry, 0, cb.descriptor.resource, 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 23d75e43f..babd19a2c 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, rd.ShaderStage.Pixel, entry, 0, cb.resourceId, 0, 0) + cbufferVars = controller.GetCBufferVariableContents(pipe, ps.resourceId, rd.ShaderStage.Pixel, entry, 0, cb.descriptor.resource, 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.