rendering-wpf-architecture

Explains WPF rendering pipeline passes and hardware acceleration tiers for layout debugging.

Updated Nov 22, 2023
One-click install
npx skills add https://github.com/parksanghoon-sys/TestCode --skill rendering-wpf-architecture-parksanghoon-sys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rendering-wpf-architecture
Source: https://github.com/parksanghoon-sys/TestCode/tree/main/src/Modbus/wpf-dev-pack/.agents/skills/rendering-wpf-architecture
Command: npx skills add https://github.com/parksanghoon-sys/TestCode --skill rendering-wpf-architecture-parksanghoon-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? WPF developers often struggle to diagnose layout glitches, slow rendering, and unexpected software rendering fallbacks because the underlying Measure/Arrange/Render pipeline and GPU tier system are opaque. ## Core Features & Use Cases - Rendering Pipeline Reference: Documents the Measure, Arrange, and Render passes, invalidation methods (InvalidateMeasure, InvalidateArrange, InvalidateVisual), and FrameworkPropertyMetadata flags that trigger each pass. - Hardware Acceleration Diagnostics: Explains rendering tiers 0-2, how to read RenderCapability.Tier, and conditions that force software fallback such as RDP sessions, AllowsTransparency, and oversized textures. - Performance Optimization Patterns: Provides batch update patterns with Dispatcher.DisableProcessing, RenderOptions caching hints, and tier-adaptive rendering strategies. - Use Case: When a WPF app renders slowly over Remote Desktop, use this Skill to identify the software rendering fallback cause and apply tier-adaptive visual simplification. ## Quick Start Ask the AI to explain why your WPF custom control triggers repeated layout passes and how to check the current hardware acceleration tier.

Frequently Asked Questions about rendering-wpf-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does the WPF rendering pipeline work with Measure and Arrange passes?▼

The WPF rendering pipeline runs three passes: Measure determines each element's DesiredSize, Arrange assigns final position and ActualSize, and Render draws visuals via OnRender and DrawingContext. Output then flows through the Composition Tree, MILCore, and DirectX to the GPU.

How do I check the WPF hardware acceleration tier on my machine?▼

Read RenderCapability.Tier and shift right by 16 bits to get the tier value. Tier 0 means software rendering, Tier 1 is partial hardware acceleration, and Tier 2 indicates full GPU acceleration with at least 120MB of GPU memory.

Why is my WPF app using software rendering instead of the GPU?▼

WPF falls back to software rendering when GPU memory is insufficient, textures exceed 8192 pixels, the app runs in a Remote Desktop session, the Window uses AllowsTransparency, or legacy BitmapEffect is applied. Check RenderCapability.Tier to confirm.

What is the difference between InvalidateMeasure, InvalidateArrange, and InvalidateVisual?▼

InvalidateMeasure triggers Measure, Arrange, and Render passes when size might change. InvalidateArrange triggers Arrange and Render for position changes. InvalidateVisual triggers only the Render pass for appearance changes, making it the cheapest option.

How do I reduce layout thrashing when updating many WPF elements?▼

Batch updates by wrapping the loop in Dispatcher.DisableProcessing so layout runs once after all property changes complete. Setting properties individually inside a loop otherwise triggers a layout pass per change.

When should I use FrameworkPropertyMetadataOptions AffectsRender versus AffectsMeasure?▼

Use AffectsMeasure when a dependency property changes the element's desired size, AffectsArrange when it changes position, and AffectsRender when only the visual appearance changes. Choosing the narrowest flag avoids unnecessary layout passes.