Skip to content

fix: use Common Pipeline State API for cross-API compatibility in get_pipeline_state#4

Open
lou-gege wants to merge 1 commit intohalby24:mainfrom
lou-gege:feature/cross-api-compatibility
Open

fix: use Common Pipeline State API for cross-API compatibility in get_pipeline_state#4
lou-gege wants to merge 1 commit intohalby24:mainfrom
lou-gege:feature/cross-api-compatibility

Conversation

@lou-gege
Copy link

Fix: get_pipeline_state returns incomplete data on OpenGL/Vulkan captures

Problem

get_pipeline_state only returned event_id, api, and shaders fields
on OpenGL/Vulkan captures. All other pipeline state (viewports, render targets,
depth target, input assembly) was silently lost.

Root cause: The code used D3D-specific methods (GetViewportScissor(),
GetOutputMerger(), GetIAState()) that don't exist in the Common Pipeline
State Abstraction. These calls threw exceptions on GL/VK, which were caught
by except Exception: pass and silently discarded.

Solution

Replaced all D3D-specific API calls with RenderDoc's Common Pipeline State
Abstraction
(PipeState) methods that work across all graphics APIs:

Before (D3D-only) After (Cross-API)
pipe.GetViewportScissor() pipe.GetViewport(index)
pipe.GetOutputMerger().renderTargets pipe.GetOutputTargets()
pipe.GetOutputMerger().depthTarget pipe.GetDepthTarget()
pipe.GetIAState().topology pipe.GetPrimitiveTopology()
except Exception: pass except Exception as e: info["*_error"] = str(e)

Changes

  • File: renderdoc_extension/services/pipeline_service.py (1 file, +41/-39)
  • No new dependencies, no MCP protocol changes
  • Return JSON structure is backward compatible (same field names)

Testing

Verified on real captures via MCP IPC:

Before fix (OpenGL): {"event_id": 204, "api": "GraphicsAPI.OpenGL"} — only 2 fields
After fix (OpenGL): all 7 fields returned (event_id, api, shaders, viewports, render_targets, depth_target, input_assembly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant