Skip to content

Commit 2303416

Browse files
fjtrujyclaude
andcommitted
cmake: per-renderer SCE-VSM override; default general_quad to Sony's VSM
Adds PS2GL_USE_SCE_VSM_FOR (semicolon-separated list of renderer names) which forces those specific renderers to assemble from Sony's reference VSM even when PS2GL_USE_SCE_VSM=OFF (the default open-source pipeline). Defaults to "general_quad" because of a residual openvcl bug in that specific shader: lesson04 / lesson05 render correctly (they route to the simpler general_pv_diff_quad shader), but box.elf enables specular lighting and routes to general_quad where the colors come out wrong such that the cube blends into the clear color and is invisible. Spliced Sony's general_quad VSM into an otherwise-openvcl build and confirmed box.elf renders the cube clearly — proving the bug is scoped to that one shader's emission, not a wider regression. This keeps the open-source pipeline as the default for 12 of 13 renderers while shipping a working box.elf today. Once openvcl's general_quad emission is fixed, the default for this option can drop back to an empty list. See memory/project_quad_bug_investigation_notes.md for the per-shader splice experiment and the full breadcrumbs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a0a4b0c commit 2303416

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ option(PS2GL_USE_SCE_VSM
112112
"Bypass the .vcl pipeline; assemble vu1/sce_<X>_vcl.vsm directly"
113113
OFF)
114114

115+
# Per-renderer override list: even when PS2GL_USE_SCE_VSM=OFF (the default
116+
# open-source pipeline), force these specific renderers to assemble from
117+
# Sony's reference VSMs. Used to ship a working build while individual
118+
# openvcl-emitted shaders are still being debugged.
119+
#
120+
# As of 2026-05-12 the residual openvcl bug is in `general_quad`'s
121+
# lighting section: lesson04 / lesson05 render correctly because they
122+
# route to the simpler `general_pv_diff_quad` shader (single light, no
123+
# specular), but box.elf enables specular and routes to `general_quad`,
124+
# where the colors come out wrong such that the cube is invisible.
125+
# Default the override to include `general_quad` until that's fixed.
126+
set(PS2GL_USE_SCE_VSM_FOR "general_quad"
127+
CACHE STRING
128+
"Semicolon-separated list of renderer names to force-use Sony's reference VSM for, even when PS2GL_USE_SCE_VSM=OFF")
129+
115130
# Check for VU1 tools availability
116131
# Prefer open-source tools (openvcl + masp) over proprietary ones (vcl + gasp)
117132
find_program(OPENVCL_FOUND openvcl)
@@ -177,7 +192,21 @@ foreach(RENDERER ${RENDERERS})
177192
continue()
178193
endif()
179194

195+
# Decide whether this renderer should use Sony's reference VSM:
196+
# either PS2GL_USE_SCE_VSM is ON globally, OR this renderer name is
197+
# in the per-renderer override list PS2GL_USE_SCE_VSM_FOR.
198+
set(_use_sce_for_this OFF)
180199
if(PS2GL_USE_SCE_VSM)
200+
set(_use_sce_for_this ON)
201+
elseif(PS2GL_USE_SCE_VSM_FOR)
202+
list(FIND PS2GL_USE_SCE_VSM_FOR ${RENDERER} _override_idx)
203+
if(NOT _override_idx EQUAL -1)
204+
set(_use_sce_for_this ON)
205+
message(STATUS "Per-renderer SCE-VSM override: ${RENDERER}")
206+
endif()
207+
endif()
208+
209+
if(_use_sce_for_this)
181210
# Bypass the .vcl pipeline entirely; assemble the in-tree Sony
182211
# reference VSM directly. scei's reference uses a different
183212
# naming convention (`scei_vcl.vsm`, no `sce_` prefix), so

0 commit comments

Comments
 (0)