Repository Overview
The Virtual Display Driver repository contains multiple components organized into logical directories.Main Driver Directory
Virtual Display Driver (HDR)
The primary driver implementation using IddCx 1.10 with HDR support.Key Source Files
Driver.cpp (Virtual Display Driver (HDR)/MttVDD/Driver.cpp)
The main driver implementation file containing: Size: ~5,000 lines of C++17 code Key Components:1. Driver Entry and Initialization
DriverEntry()- Driver initialization entry pointInitAdapter()- Initialize IddCx adapterFinishInit()- Complete driver initialization
2. Monitor Management
- Create virtual monitor instances
- Configure display modes and capabilities
- Load EDID profiles
- Handle monitor arrival/removal events
3. SwapChain Processing
- Process frame buffers from applications
- Manage frame presentation timing
- Handle buffer synchronization
- Coordinate with GPU rendering
4. Direct3D Device Management
- Create and manage D3D11 devices
- Handle GPU adapter selection
- Cache devices for performance
- Support multi-GPU configurations
5. Configuration Parsing
XML Configuration Handling:- Parse
vdd_settings.xml - Apply monitor configurations
- Handle EDID profile loading
- Manage GPU adapter preferences
6. Phase 5 Integration Functions
Driver.h (Virtual Display Driver (HDR)/MttVDD/Driver.h)
Header file with class definitions and declarations: Key Classes:Trace.h (Virtual Display Driver (HDR)/MttVDD/Trace.h)
Windows Performance Toolkit (WPP) tracing configuration:MttVDD.inf (Virtual Display Driver (HDR)/MttVDD/MttVDD.inf)
Driver installation file defining: Sections:[Version]- Driver metadata and signature[Manufacturer]- Manufacturer information[Standard.NT$ARCH$]- Hardware IDs (Root\MttVDD)[MyDevice_Install.NT]- Installation instructions[MyDevice_HardwareDeviceSettings]- Registry settings[MttVDD_Install]- UMDF service configuration
Common Headers
AdapterOption.h (Common/Include/AdapterOption.h)
GPU adapter selection and management: Key Components:- Enumerate available GPUs via DXGI
- Select adapter by name or PCI bus number
- Resolve adapter LUID from PCI bus (more deterministic)
- Automatic fallback to best GPU (most VRAM)
- Integration with vdd_settings.xml
Configuration Files
vdd_settings.xml (Virtual Display Driver (HDR)/vdd_settings.xml)
Runtime configuration file defining: Structure (example):C:\VirtualDisplayDriver\vdd_settings.xml on installation
option.txt (Virtual Display Driver (HDR)/option.txt)
Legacy configuration file (pre-XML):- Simple text file
- GPU adapter name on first line
- Maintained for backward compatibility
EDID Profiles
EDID Directory (Virtual Display Driver (HDR)/EDID/)
Contains binary EDID files for different display profiles: Purpose:- Define monitor capabilities (resolutions, color spaces, HDR)
- Emulate specific hardware displays
- Custom display naming and manufacturer info
Utility Components
GetIddCx (Virtual Display Driver (HDR)/GetIddCx/)
Utility to query installed IddCx version: Source:IddCxVersionQuery.cpp
Purpose:
- Detect IddCx version on system
- Verify driver compatibility
- Debugging and support
Third-Party Dependencies
Windows-Driver-Frameworks (ThirdParty/Windows-Driver-Frameworks/)
Contains:- UMDF 2.15 public headers
- Additional WDF header files not in standard WDK
Community Scripts
Community Scripts/ Directory
User-contributed PowerShell scripts: Common Scripts:- Monitor creation and removal
- Batch configuration
- Display settings automation
- EDID generation helpers
Build Scripts
scripts/ Directory
Build and deployment automation:- CI/CD scripts
- Release packaging
- Automated testing
GitHub Configuration
.github/ Directory
workflows/:- GitHub Actions CI/CD pipelines
- Automated builds
- Release creation
bug_report.yml- Bug report templatefeature_request.yml- Feature request templateQuestion.yml- Question templateHelpWanted.yml- Help wanted template
- Sponsor links for project maintainers
Code Flow Overview
Driver Initialization Flow
Frame Processing Flow
Architecture Patterns
Device Caching
Direct3D devices are cached per LUID:- Avoid recreating D3D devices
- Support multiple monitors on same GPU
- Thread-safe access with mutex
LUID-Based GPU Selection
Older approach: Match by GPU name string Current approach: Match by PCI bus → resolve to LUID Advantages:- More deterministic in multi-GPU setups
- Handles renamed/duplicate GPU names
- Survives driver updates
WPP Tracing
Using WPP (Windows software trace preprocessor) instead of DbgPrint: Benefits:- Low overhead when not tracing
- Rich structured logging
- ETW (Event Tracing for Windows) integration
- Production-safe diagnostics
Key Technologies
| Technology | Purpose | Location |
|---|---|---|
| IddCx 1.10 | Indirect display framework | Driver.cpp, Windows SDK |
| UMDF 2.25 | User-mode driver framework | Entire driver |
| Direct3D 11 | GPU rendering interface | Direct3DDevice, SwapChainProcessor |
| DXGI 1.5 | Graphics infrastructure | Adapter enumeration |
| WPP Tracing | Diagnostic logging | Trace.h, Driver.cpp |
| XMLLite | Configuration parsing | Driver.cpp |
| WRL | COM smart pointers | Throughout (Microsoft::WRL::ComPtr) |
| STL | C++ standard library | vector, map, string, mutex |
Next Steps
Building from Source
Compile the driver with your changes
Testing
Test your modifications safely