Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
89cdf34
refactor: remove all VR support
doodlum Jun 5, 2026
9cc8c6e
fix(shaders): remove stale eyeIndex args from VolumetricShadows calls
doodlum Jun 5, 2026
1221fe4
fix(shaders): remove stale eyeIndex arg from GetWaterData call
doodlum Jun 5, 2026
7caa625
fix(shaders): remove remaining stale eyeIndex args from call sites
doodlum Jun 5, 2026
303714a
fix(shaders): remove stale eyeIndex arg from GetLightingShadow call
doodlum Jun 5, 2026
15c1b84
fix(shaders): remove stale eyeIndex args from HairSelfShadow point li…
doodlum Jun 5, 2026
5aecf3c
refactor(shaders): remove remaining VR dead params and HMD shader
doodlum Jun 5, 2026
8e66d4b
fix(shaders): remove stale eyeIndex args and update i18n
doodlum Jun 5, 2026
8c72598
chore(i18n): sort zh_CN.json to match en.json key order
doodlum Jun 5, 2026
8c405dd
chore(i18n): remove deleted VR upscaling keys from zh_CN.json
doodlum Jun 5, 2026
7fc735e
refactor: remove dead VR eye loop and eyeCount remnants
doodlum Jun 5, 2026
15b6803
refactor: flatten VR [1] eye arrays and inline dead helpers
doodlum Jun 5, 2026
e0081de
fix(i18n): fix dynamic_cubemaps and light_limit_fix key numbering
doodlum Jun 5, 2026
f957d21
refactor: inline GetFlat() and suppress sk_hdr_png warning
doodlum Jun 5, 2026
02a27e3
refactor: remove State::screenSize, read from gameViewport directly
doodlum Jun 5, 2026
c5f86e0
refactor: flatten VR per-eye arrays in LightData and SSGICB
doodlum Jun 5, 2026
d1fa98b
refactor: rename VR-era eye position identifiers
doodlum Jun 6, 2026
9fb7778
refactor: final VR naming/docs cleanup
doodlum Jun 6, 2026
ecede44
refactor: remove dead VR code in REL::Relocate calls and helpers
doodlum Jun 6, 2026
7ceb37d
refactor: final VR reference cleanup
doodlum Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 11 additions & 41 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ powershell.exe -Command "./BuildRelease.bat [PRESET_NAME]"

**Available Presets** (from CMakePresets.json):

- `ALL` (default) - Builds universal binary supporting SE/AE/VR runtime detection
- `ALL` (default) - Builds universal binary supporting SE/AE runtime detection
- `SE` - Skyrim Special Edition only (compile-time targeting)
- `AE` - Anniversary Edition only (compile-time targeting)
- `VR` - Skyrim VR only (compile-time targeting)
- `PRE-AE` - SE + VR (excludes AE)
- `FLATRIM` - SE + AE (excludes VR)
- `FLATRIM` - SE + AE
- `ALL-TRACY` - Universal binary with Tracy profiler support enabled

**User Preset Template**:
Expand All @@ -51,7 +49,7 @@ powershell.exe -Command "./BuildRelease.bat [PRESET_NAME]"
Set `CommunityShadersOutputDir` environment variable to semicolon-separated Skyrim Data directories:

```
CommunityShadersOutputDir=F:/MySkyrimModpack/mods/CommunityShaders;F:/SteamLibrary/steamapps/common/SkyrimVR/Data;F:/SteamLibrary/steamapps/common/Skyrim Special Edition/Data
CommunityShadersOutputDir=F:/MySkyrimModpack/mods/CommunityShaders;F:/SteamLibrary/steamapps/common/Skyrim Special Edition/Data
```

### Shader Development and Testing
Expand All @@ -66,9 +64,6 @@ cmake --build ./build/ALL --target prepare_shaders
# Full shader suite validation (can be time-consuming)
hlslkit-compile --shader-dir build/ALL/aio/Shaders --output-dir build/ShaderCache --config .github/configs/shader-validation.yaml --max-warnings 0 --suppress-warnings X1519

# VR-specific validation
hlslkit-compile --shader-dir build/ALL/aio/Shaders --output-dir build/ShaderCache --config .github/configs/shader-validation-vr.yaml --max-warnings 0 --suppress-warnings X1519

# Targeted testing for faster development (recommended during development)
# Test specific base shader
hlslkit-compile --shader-dir build/ALL/aio/Shaders/Lighting.hlsl --output-dir build/ShaderCache --config .github/configs/shader-validation.yaml
Expand All @@ -89,7 +84,7 @@ hlslkit-generate-defines --log CommunityShaders.log
hlslkit-buffer-scan --features-dir features/

# Prove a shader refactor changed no behavior (compiles base ref vs working tree,
# compares DXBC across VR x HDR_OUTPUT permutations; exit 0 identical / 2 differs)
# compares DXBC across HDR_OUTPUT permutations; exit 0 identical / 2 differs)
pwsh tools/verify-shader-refactor.ps1 package/Shaders/Foo.hlsl # bash: tools/verify-shader-refactor.sh
```

Expand Down Expand Up @@ -201,8 +196,7 @@ Each feature follows consistent structure:

### Cross-Platform Support

**Single Binary**: Supports SE/AE/VR through CommonLibSSE-NG runtime detection
**VR Adaptations**: Specialized rendering paths in `src/Features/VR/`
**Single Binary**: Supports SE/AE through CommonLibSSE-NG runtime detection
**API Abstraction**: Dual DirectX 11 support with feature-specific rendering strategies

## Critical Dependencies
Expand Down Expand Up @@ -232,47 +226,28 @@ CommonLibSSE-NG supports multiple Skyrim versions through sophisticated runtime

- `SE` - Skyrim Special Edition only
- `AE` - Anniversary Edition only
- `VR` - Skyrim VR only
- `ALL` - Multi-runtime support (default for this project)
- `ALL` - Multi-runtime SE/AE support (default for this project)

**Compile-Time vs Runtime Patterns**:

**Single Runtime (compile-time)**: When targeting one version, `#ifdef ENABLE_SKYRIM_VR` conditionally compiles VR-specific code:

```cpp
#ifdef ENABLE_SKYRIM_VR
virtual void Unk_09(UI_MENU_Unk09 a_unk); // VR-only vfunc
#endif
```

**Multi-Runtime (runtime detection)**: When targeting ALL, uses runtime accessors:
**Multi-Runtime (runtime detection)**: When targeting ALL, uses runtime accessors for SE vs AE differences:

```cpp
// Runtime member access with different offsets per version
auto& GetRuntimeData() {
return REL::RelocateMemberIfNewer<PLAYER_RUNTIME_DATA>(
SKSE::RUNTIME_SSE_1_6_629, this, 0x3D8, 0x3E0);
}

// VR-specific runtime data (only exists in VR)
auto& GetVRRuntimeData() {
return REL::RelocateMember<VR_PLAYER_RUNTIME_DATA>(this, 0, 0x3D8);
}

// Runtime detection
if (REL::Module::IsVR()) {
// VR-specific code path
}
```

**Key Runtime Utilities**:

- `REL::RelocateMember<T>()` - Access members with different offsets
- `REL::RelocateVirtual<T>()` - Call virtual functions with variant vtables
- `REL::Module::IsVR()`, `IsAE()`, `IsSE()` - Runtime version detection
- `REL::Module::IsAE()`, `IsSE()` - Runtime version detection
- `REL::RelocationID()` - Dynamic address resolution based on version

**Critical for Development**: When modifying classes that inherit from game objects, always check if they have runtime-specific variations and use appropriate accessor patterns.
**Critical for Development**: When modifying classes that inherit from game objects, always check if they have runtime-specific variations (SE vs AE) and use appropriate accessor patterns.

## Core Architecture

Expand Down Expand Up @@ -302,7 +277,6 @@ All graphics features are globally accessible for cross-feature coordination:
- Materials: `extendedMaterials`, `hairSpecular`, `subsurfaceScattering`
- Effects: `screenSpaceGI`, `screenSpaceShadows`, `waterEffects`, `wetnessEffects`
- Environment: `cloudShadows`, `dynamicCubemaps`, `weatherEditor`, `skySync`
- VR: `vr` - VR-specific adaptations and coordinate transformations

### Shared Utilities (`src/Utils/`)

Expand All @@ -311,7 +285,6 @@ Common functionality organized by domain:
- `UI.h/cpp` - ImGui utilities, input mapping, and UI helper functions
- `D3D.h/cpp` - DirectX utilities and helper functions
- `Game.h/cpp` - Skyrim-specific game state and object utilities
- `VRUtils.h/cpp` - VR-specific utilities and coordinate transformations
- `FileSystem.h/cpp` - File I/O and path manipulation helpers
- `Format.h/cpp` - String formatting and conversion utilities
- `Serialize.h/cpp` - JSON serialization helpers
Expand Down Expand Up @@ -391,7 +364,6 @@ Feature versions are automatically extracted from `.ini` files and compiled into
- **Deferred Rendering Impact**: Features hook into Skyrim's rendering pipeline, adding GPU workload
- **Feature Toggles**: Users can disable individual features at boot if performance is impacted (`Disable at Boot` buttons)
- **A/B Testing Framework**: Built-in performance comparison system for measuring feature impact
- **VR Performance**: VR has higher performance requirements; some features may need different settings
- **Tracy Profiler**: Optional build-time integration (`TRACY_SUPPORT`) for detailed performance analysis

**Shader Performance Patterns**:
Expand All @@ -405,7 +377,6 @@ Feature versions are automatically extracted from `.ini` files and compiled into

- **In-Game Profiling**: Use Tracy integration to measure actual frame impact
- **Feature Isolation**: Test features individually to identify performance bottlenecks
- **Cross-Edition Impact**: SE/AE/VR may have different performance characteristics for the same feature

### Development Performance

Expand All @@ -431,7 +402,7 @@ Feature versions are automatically extracted from `.ini` files and compiled into

- **Performance Concerns**: If code could impact rendering performance, suggest optimizations or user toggles
- **Security Risks**: Flag potential crashes from unvalidated user input, malformed configs, or unsafe DirectX operations
- **Runtime Compatibility**: Warn when code might break SE/AE/VR compatibility or suggest `REL::RelocateMember()` patterns
- **Runtime Compatibility**: Warn when code might break SE/AE compatibility or suggest `REL::RelocateMember()` patterns
- **Buffer Conflicts**: Highlight potential GPU register conflicts and recommend hlslkit buffer scanning
- **Graphics Best Practices**: Suggest more idiomatic DirectX/HLSL patterns when appropriate

Expand Down Expand Up @@ -536,7 +507,7 @@ Full details: [Developers wiki — Patch Release Process](https://github.com/com
### Testing and Validation

- **Build Verification**: Always test builds after significant refactoring - this codebase has complex dependencies
- **Cross-Edition Testing**: Changes may affect SE/AE/VR differently due to engine differences
- **Cross-Edition Testing**: Changes may affect SE/AE differently due to engine differences
- **Memory Management**: Pay attention to smart pointer usage and RAII patterns when modifying existing code

### Security and Input Validation
Expand Down Expand Up @@ -567,7 +538,6 @@ Full details: [Developers wiki — Patch Release Process](https://github.com/com

- **Include Dependencies**: New features often require adding includes (ShaderCache.h, imgui_stdlib.h, etc.)
- **Forward Declarations**: Use forward declarations in headers when possible, full includes in .cpp files
- **VR Considerations**: VR has different rendering requirements - check VR-specific code paths when modifying graphics features
- **Feature Versioning**: Feature .ini files use semantic versioning - increment appropriately when changing settings structure
- **Performance Impact**: Always consider GPU workload when adding new rendering features - provide toggle options for users
- **Buffer Conflicts**: Check hlslkit buffer scanning to avoid GPU register conflicts that cause rendering issues
Expand Down
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ reviews:
Length: 50 characters limit for title, 72 for body
Style: lowercase description, no ending period
Examples:
- feat(vr): add cross-eye sampling
- feat(ssgi): add temporal denoising
- fix(water): resolve flowmap bug
- docs: update shader documentation
Expand Down
12 changes: 3 additions & 9 deletions .github/configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,27 @@ This directory contains configuration files used by the CI/CD pipeline for build
## Files

- `shader-validation.yaml`: Configuration for shader compilation validation using hlslkit (Skyrim SE)
- `shader-validation-vr.yaml`: VR Configuration for shader compilation validation using hlslkit (Skyrim VR)

## Generating Configuration Files

These configuration files can be regenerated using the `generate-shader-configs.ps1` script in this directory. This script requires:

1. A valid Skyrim installation (SE and/or VR)
1. A valid Skyrim Special Edition installation
2. The [hlslkit](https://github.com/alandtse/hlslkit) package installed (`pip install hlslkit`)
3. Community Shaders to be run once with specific settings to generate the required log data

### Prerequisites

Before running the generation script, you must run each version of Skyrim (SE and VR) **once** with the following Community Shaders settings:
Before running the generation script, you must run Skyrim SE **once** with the following Community Shaders settings:

1. **Set Debug Log Level**: In the Community Shaders menu, set the log level to "Debug" or "Trace"
2. **Clear Disk Cache**: Clear the shader disk cache before running
3. **Enable Disk Cache**: Ensure disk cache is enabled and will be saved
4. **Run the Game**: Launch and wait for compilation to complete to generate shader compilation logs

The required log files will be created at:
The required log file will be created at:

- **Skyrim SE**: `%USERPROFILE%\Documents\My Games\Skyrim Special Edition\SKSE\CommunityShaders.log`
- **Skyrim VR**: `%USERPROFILE%\Documents\My Games\Skyrim VR\SKSE\CommunityShaders.log`

### Running the Script

Expand All @@ -52,11 +50,7 @@ The script will:
You can also generate the files manually using hlslkit:

```bash
# For Skyrim SE
hlslkit-generate --log "%USERPROFILE%\Documents\My Games\Skyrim Special Edition\SKSE\CommunityShaders.log" --output .\.github\configs\shader-validation.yaml

# For Skyrim VR
hlslkit-generate --log "%USERPROFILE%\Documents\My Games\Skyrim VR\SKSE\CommunityShaders.log" --output .\.github\configs\shader-validation-vr.yaml
```

## Usage in CI/CD
Expand Down
26 changes: 4 additions & 22 deletions .github/configs/generate-shader-configs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Generates shader validation configuration files for Community Shaders.

.DESCRIPTION
This script generates shader-validation.yaml and shader-validation-vr.yaml files by analyzing
Community Shaders log files from Skyrim installations. It requires hlslkit to be installed
and both Skyrim Special Edition and/or Skyrim VR to have been run with specific settings.
This script generates shader-validation.yaml by analyzing Community Shaders log files from
Skyrim Special Edition installations. It requires hlslkit to be installed and Skyrim Special
Edition to have been run with specific settings.

.PARAMETER OutputDir
Directory where the generated YAML files will be saved. Defaults to current directory.
Expand Down Expand Up @@ -88,33 +88,15 @@ function Find-SkyrimPaths {
}
}

# Check for Skyrim VR
$vrPath = Join-Path $myGamesPath "Skyrim VR"
if (Test-Path $vrPath) {
$paths += @{
Name = "Skyrim VR"
Path = $vrPath
LogPath = Join-Path $vrPath "SKSE\CommunityShaders.log"
ConfigName = "shader-validation-vr.yaml"
Type = "VR"
}
}

# Check CommunityShadersOutputDir environment variable
$outputDir = $env:CommunityShadersOutputDir
if ($outputDir -and (Test-Path $outputDir)) {
Write-Host "Found CommunityShadersOutputDir: $outputDir" -ForegroundColor Yellow

# Try to detect if this is a Skyrim installation by looking for common files
$skyrimExe = Get-ChildItem -Path $outputDir -Recurse -Name "SkyrimSE.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
$skyrimVRExe = Get-ChildItem -Path $outputDir -Recurse -Name "SkyrimVR.exe" -ErrorAction SilentlyContinue | Select-Object -First 1

if ($skyrimExe) {
Write-Host "Detected Skyrim SE installation in CommunityShadersOutputDir" -ForegroundColor Green
}
if ($skyrimVRExe) {
Write-Host "Detected Skyrim VR installation in CommunityShadersOutputDir" -ForegroundColor Green
}
}

return $paths
Expand Down Expand Up @@ -207,7 +189,7 @@ if ($LogFile) {
$skyrimPaths = Find-SkyrimPaths

if ($skyrimPaths.Count -eq 0) {
Write-Error "No Skyrim installations found. Please ensure Skyrim SE or VR is installed."
Write-Error "No Skyrim installations found. Please ensure Skyrim Special Edition is installed."
exit 1
}

Expand Down
Loading
Loading