renderdoc_get_buffers
Retrieve and list all buffers from RenderDoc capture files with their properties like size and type to analyze graphics resources for debugging.
Instructions
Get a list of all buffers in the capture with their properties (size, type, etc.).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Optional filter pattern for buffer names. |
Implementation Reference
- src/renderdoc_mcp/server.py:333-353 (handler)The main handler for renderdoc_get_buffers tool. It checks if a capture is open, calls wrapper.get_buffers(), applies optional filtering by name, formats the buffer info, and returns the results as text content.
elif name == "renderdoc_get_buffers": if not wrapper.current_file: return [TextContent(type="text", text="Error: No capture is currently open.")] buffers = wrapper.get_buffers() filter_pattern = arguments.get("filter", "").lower() if filter_pattern: buffers = [b for b in buffers if filter_pattern in b.name.lower()] if not buffers: return [TextContent(type="text", text="No buffers found.")] output = [f"Buffers ({len(buffers)} found):\n"] for buf in buffers[:100]: output.append(_format_buffer_info(buf)) if len(buffers) > 100: output.append(f"\n... and {len(buffers) - 100} more") return [TextContent(type="text", text="\n".join(output))] - src/renderdoc_mcp/server.py:94-107 (registration)Tool registration defining the renderdoc_get_buffers tool with its name, description, and input schema including an optional filter parameter for buffer names.
Tool( name="renderdoc_get_buffers", description="Get a list of all buffers in the capture with their properties (size, type, etc.).", inputSchema={ "type": "object", "properties": { "filter": { "type": "string", "description": "Optional filter pattern for buffer names.", }, }, "required": [], }, ), - The get_buffers() implementation in RenderDocWrapper that retrieves all buffers from the open capture using the RenderDoc API, creates BufferInfo objects for each, and handles both native and fallback modes.
def get_buffers(self) -> list[BufferInfo]: """ Get list of all buffers in the capture. Returns: List of BufferInfo objects. """ if self._use_fallback: return self._get_buffers_fallback() if not self.controller: raise RuntimeError("No capture is currently open") buffers = self.controller.GetBuffers() result = [] for buf in buffers: result.append(BufferInfo( name=buf.name or f"Buffer_{buf.resourceId}", resource_id=str(buf.resourceId), byte_size=buf.byteSize, creation_flags=buf.creationFlags, )) return result def _get_buffers_fallback(self) -> list[BufferInfo]: """Get buffers using renderdoccmd as fallback.""" return [] - The BufferInfo dataclass schema defining the structure for buffer information including name, resource_id, byte_size, and creation_flags.
@dataclass class BufferInfo: """Information about a buffer resource.""" name: str resource_id: str byte_size: int creation_flags: int - src/renderdoc_mcp/server.py:245-250 (helper)Helper function that formats BufferInfo objects into human-readable text output for display to the user.
def _format_buffer_info(buf: BufferInfo) -> str: """Format buffer info for display.""" size_kb = buf.byte_size / 1024 return f"""- {buf.name} (ID: {buf.resource_id}) Size: {size_kb:.2f} KB ({buf.byte_size} bytes) Flags: {buf.creation_flags}"""