|
PS2GL
OpenGL*-like API for the PS2
|
This document describes how to build ps2gl using CMake instead of the traditional Makefile.
PS2DEV environment variable setopenvcl, masp, dvp-asvcl, gasp, dvp-asNote:
openvcl + masp) over proprietary ones (vcl + gasp).vo object files from the vu1/ directoryindexed and scei) now compile successfully with openvcl + masp. The proprietary vcl + gasp toolchain remains supported as a fallback, but is no longer required.To enable debug symbols and _DEBUG definition:
To build the test executables (when available):
To install the library and headers to $PS2SDK/ports:
This will:
libps2gl.a to $PS2SDK/ports/lib/$PS2SDK/ports/include/GL/$PS2SDK/ports/include/ps2gl/The following CMake options are available:
| Option | Default | Description |
|---|---|---|
DEBUG | OFF | Enable debug build with _DEBUG definition |
BUILD_TESTS | OFF | Build test executables |
BUILD_EXAMPLES | OFF | Build the example ELFs under examples/ |
BUILD_GLUT | ON | Build the GLUT-compat library |
PS2GL_USE_SCE_VSM | OFF | Bypass the .vcl pipeline; assemble Sony's reference VSMs (vu1/sce_<X>_vcl.vsm) directly with dvp-as. Diagnostic mode: lets us isolate "openvcl produces wrong VSMs" from "ps2gl host-side bug" by comparing the SCE-built ELF behavior against the openvcl-built one. |
The CMake build automatically applies the following flags:
-DNO_VU0_VECTORS - Disables VU0 vector code (currently broken)-DNO_ASM - Disables assembly optimizations-Wno-strict-aliasing - Suppresses strict aliasing warnings-Wno-conversion-null - Suppresses conversion null warningsps2gl includes VU1 assembly renderers that go through a complex preprocessing pipeline:
gasp/masp assembler preprocessingvcl/openvcl compiler generates .vsm filesdvp-as assembler generates .vo object filesThe CMake build handles all these steps automatically for all 13 renderers:
All 13 build with either openvcl + masp (preferred) or vcl + gasp (legacy fallback). The output .vsm from the open pipeline can be compared against the in-tree Sony reference (vu1/sce_*_vcl.vsm) for validation.
The build uses the PS2DEV CMake toolchain file located at:
This toolchain file is automatically detected when PS2DEV is set.
To perform a clean build:
The CMake build produces the same output as the traditional Makefile:
The CMake build system was designed to be compatible with the existing Makefile build. Both build systems can coexist in the repository.
build/ directoryIf you get an error about PS2DEV not being set:
Make sure the toolchain file exists at $PS2DEV/share/ps2dev.cmake.
Make sure the VU1 tools are in your PATH. For open-source tools:
Or for proprietary tools:
The dvp-as tool should be installed as part of PS2DEV. For openvcl and masp:
Try a clean build:
If VU1 preprocessing fails, check that:
.vcl source files exist in vu1/vu1/vu1_mem_linear.h and vu1/vu1_mem_indexed.h