Skip to content

Repository files navigation

OpenGNM Stack

The OpenGNM Stack is a complete open-source graphics stack for the PlayStation 4, providing drop-in API compatibility with the Sony official GNM/GraphNext graphics library.

This umbrella repository ties together the individual components via git submodules. Clone with --recursive to get the working build layout where all sibling-directory references resolve correctly.

Architecture

┌─────────────────────────────────────────────────────────┐
│                    Your PS4 Application                  │
│              (written against Sony SDK headers)          │
└────────────┬──────────────────────────┬──────────────────┘
             │                          │
             ▼                          ▼
┌────────────────────┐     ┌─────────────────────────────┐
│      opengnm       │     │         vulkan-ps4          │
│   sceGnm*/sceGpa*  │     │     Vulkan 1.0 ICD          │
│   207 functions    │◄────│  (translates Vk → GNM/PM4)  │
│   2 backends:      │     └─────────────────────────────┘
│   • orbis (FW)     │
│   • generic (host) │
└────────┬───────────┘
         │ uses shader binaries from
         ▼
┌────────────────────┐     ┌─────────────────────────────┐
│   opengnm-psbc     │     │     freegnm-examples        │
│  SPIR-V → PS4 SB   │     │   triangle, cube, gltf,     │
│  (Mesa 26.2 NIR+   │     │   Eden composite, etc.      │
│   ACO compiler)    │     │   (USE_OPENGNM=1 to link    │
│                    │     │    against opengnm)         │
└────────────────────┘     └─────────────────────────────┘

Components

Repo Description
opengnm Core GNM library — sceGnm*/sceGpa* drop-in API (207 functions, 2 backends)
opengnm-psbc SPIR-V → PS4/PS5 Shader Binary compiler (Mesa 26.2.0 NIR+ACO)
vulkan-ps4 Vulkan 1.0 ICD over OpenGNM — run Vulkan apps on PS4
freegnm-examples Example programs (triangle, cube, gltf, Eden composite, and more)

Quick Start

1. Clone the stack

git clone --recursive https://github.com/PS4-OpenGNM/opengnm-stack.git
cd opengnm-stack

2. Add external dependencies

The build system expects Vulkan-Headers and SPIRV-Headers as sibling directories:

git clone https://github.com/KhronosGroup/Vulkan-Headers.git
git clone https://github.com/KhronosGroup/SPIRV-Headers.git

3. Install the OpenOrbis PS4 Toolchain

git clone https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain.git
export OO_PS4_TOOLCHAIN=$(pwd)/OpenOrbis-PS4-Toolchain

4. Build

See the Build Guide for full instructions, or the quick version below:

# Build opengnm (PS4 target)
cd opengnm
cp config.orbis.mak config.mak
make
cd ..

# Build opengnm-psbc (host CLI + PS4 library)
cd opengnm-psbc
make -j$(nproc)                    # host CLI + libpsbc.a
make -f Makefile.orbis -j$(nproc)  # PS4 libpsbc.orbis.a
cd ..

# Build vulkan-ps4 (PS4 ICD)
cd vulkan-ps4
make -f Makefile.orbis -j$(nproc)
cd ..

# Build examples (with OpenGNM)
cd freegnm-examples/triangle
make USE_OPENGNM=1

Documentation

Individual component docs:

Requirements

  • C11 + C++17 compiler (clang recommended)
  • GNU Make + CMake (≥ 3.15)
  • LLD linker + llvm-ar
  • Python 3 + py3-mako (for Mesa codegen in opengnm-psbc)
  • OpenOrbis PS4 Toolchain (for PS4 cross-compilation)
  • Vulkan-Headers + SPIRV-Headers (for vulkan-ps4 and opengnm-psbc)

Status

All components are feature-complete and hardware-validated on PS4 FW 9.00:

  • opengnm: 207+ sceGnm* functions, 88 host tests passing, hardware smoke test passing
  • opengnm-psbc: All 8 shader stages, VS+PS hardware-validated (60fps triangle rendering)
  • vulkan-ps4: Full Vulkan 1.0 ICD with graphics + compute pipelines
  • freegnm-examples: All examples build with USE_OPENGNM=1

License

All repos in the OpenGNM stack are licensed under the MIT License — see the LICENSE file in each repo. Vendored third-party libraries (Mesa, cgltf, Nuklear, stb) retain their original licenses as noted in their respective repos.

Contributing

Issues and pull requests are welcome at the individual component repos. Cross-repo coordination is tracked on the GitHub Project board.

About

Umbrella repo for the OpenGNM PS4 graphics stack — clone --recursive for working build layout

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors