Skip to content

Report an NVIDIA adapter on the Metal renderer so dynamic shadows render - #21

Merged
kanapitsas merged 1 commit into
mainfrom
fix/shadows-vendor
Nov 7, 2026
Merged

kanapitsas merged 1 commit into
mainfrom
fix/shadows-vendor

Conversation

@kanapitsas

Copy link
Copy Markdown
Owner

Fixes #20.

With the Apple vendor id (0x106b), Source's shaderapivk turns off shadow depth textures, so dynamic lights cast no shadows on Metal. OpenGL has them.

Run (sp_a2_laser_over_goo) r_flashlightdepthtexture r_flashlightdepthres
OpenGL 1 1024
Metal, vendor 106b (before) 0 0
Metal, vendor 10de (this PR) 1 1024

The default becomes NVIDIA (10de). P2_D3D9_VENDOR_ID still overrides it.

Frame rate, Metal, 1440p MSAA 4, 3 alternating rounds: 62.8 fps with 106b, 63.6 with 10de, within noise.

Tests: make check passes; the updated assertions in tests/checks_d3d9.c fail on the old default.

Not tested: iPhone, and play beyond a few rooms on Mac.

🤖 Generated with Claude Code

With the Apple vendor id (0x106b), Source's shaderapivk turns off shadow
depth textures (r_flashlightdepthtexture 0, r_flashlightdepthres 0), so
dynamic lights cast no shadows on the Metal renderer while OpenGL has them
(issue #20). With 0x10de both cvars match OpenGL. P2_D3D9_VENDOR_ID still
overrides the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kanapitsas
kanapitsas merged commit 4d29cea into main Nov 7, 2026
3 checks passed
@kanapitsas
kanapitsas deleted the fix/shadows-vendor branch November 7, 2026 22:07
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.

No dynamic shadows in game

1 participant