direct3d11-development

Implement, debug, and optimize Direct3D 11 rendering on Windows 10 and 11.

3|Updated Aug 8, 2026
One-click install
npx skills add https://github.com/Jose-Polanco-Oxte/Echos-Live-Music-Visualizer --skill direct3d11-development-jose-polanco-oxte
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: direct3d11-development
Source: https://github.com/Jose-Polanco-Oxte/Echos-Live-Music-Visualizer/tree/main/.agents/skills/graphics/direct3d11-development
Command: npx skills add https://github.com/Jose-Polanco-Oxte/Echos-Live-Music-Visualizer --skill direct3d11-development-jose-polanco-oxte

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Direct3D 11 development involves subtle pitfalls around device ownership, resource lifetimes, swap-chain presentation, threading, and device-lost recovery that cause black screens, flicker, leaks, and crashes. This Skill provides authoritative, modular guidance so engineers make correct D3D11/DXGI design decisions instead of copying outdated DirectX SDK or UWP-era code. ## Core Features & Use Cases - Architecture and Device Guidance: Establish graphics ownership models, adapter selection policy, WARP fallback rules, and device-creation flags for C++, C#/.NET, and Rust projects. - Rendering Correctness: Covers resources and views, constant-buffer packing, HLSL/Shader Model 5, sRGB/linear color handling, MSAA resolve, depth/stencil, and flip-model swap-chain presentation with resize handling. - Diagnostics and Recovery: Provides device-removal recovery workflows, debug-layer usage, common failure checklists (black screen, flicker, distortion), GPU timing, and a full review checklist with anti-patterns. - Use Case: When integrating a real-time renderer into a WinUI 3 SwapChainPanel, load the interop and presentation references to create a composition swap chain, handle DPI/size changes, and avoid blocking the UI thread. ## Quick Start Ask the assistant to review or implement a Direct3D 11 rendering component, such as creating a device and flip-model swap chain for a WinUI 3 SwapChainPanel, and it will load the relevant reference documents for the task.

Frequently Asked Questions about direct3d11-development

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

FAQPage Schema
How do I create a Direct3D 11 device and swap chain correctly?

Create the DXGI factory and device explicitly, choose adapters via DXGI enumeration rather than vendor assumptions, and use a flip-model swap chain (FLIP_DISCARD or FLIP_SEQUENTIAL) with at least two buffers. Enable BGRA support when Direct2D, Win2D, or XAML interop is required.

How do I integrate Direct3D 11 rendering into a WinUI 3 app?

Use the WinUI 3 Microsoft.UI.Xaml.Controls.SwapChainPanel with a composition swap chain created via IDXGIFactory2::CreateSwapChainForComposition, then attach it through the panel's native interop interface. Keep XAML DIP dimensions separate from render-target pixels and never block the UI thread on GPU work.

Does Direct3D 11 support Shader Model 6 or feature level 12_x?

No. Direct3D 11's shader ceiling is Shader Model 5.0, even when a device reports 12_x feature levels. Shader Model 6 with DXC is a Direct3D 12 path, and feature level, API version, shader model, and DXGI version are separate concepts.

Why does my Direct3D 11 app show a black screen?

Common causes include failed device or swap-chain creation, missing RTV binding, wrong viewport, incorrect input layout, constant-buffer packing mismatches, or a removed device. Reduce the frame to a clear-only render and check the debug layer output and Present HRESULT first.

How should I handle DXGI_ERROR_DEVICE_REMOVED in Direct3D 11?

Stop submitting work, call GetDeviceRemovedReason for diagnostics, release all device-dependent resources, and recreate the full device, swap chain, and resource graph from CPU-side state. Recreating only the swap chain while keeping old-device resources is incorrect.

Can I use multisampling with a flip-model swap chain?

Not directly. Flip-model swap chains cannot be multisampled, so render into a separate MSAA color target with matching depth, resolve it into the single-sample back buffer, then present. Always verify sample counts with CheckMultisampleQualityLevels.