gles

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 0 Imported by: 1

Documentation

Overview

Package gles implements the HAL backend for OpenGL ES 3.0 / OpenGL 3.3+.

This backend provides a Pure Go implementation using syscall directly, without any CGO or external dependencies.

Platform Support

Currently supported:

  • Windows (WGL) - via hal/gles/wgl package

Planned:

  • Linux (GLX/EGL)
  • macOS (CGL/EGL)
  • Android (EGL)
  • WebGL (via wasm)

Architecture

The backend is organized into subpackages:

hal/gles/
├── gl/       - OpenGL function bindings
├── wgl/      - Windows GL context management
├── glx/      - Linux X11 GL context (planned)
├── egl/      - EGL context for mobile/modern Linux (planned)
└── cgl/      - macOS CGL context (planned)

Usage

Import this package to register the OpenGL backend:

import _ "github.com/gogpu/wgpu/hal/gles"

The backend is then available via hal.GetBackend(types.BackendGL).

OpenGL Version Requirements

Minimum requirements:

  • OpenGL 3.3 Core Profile (desktop)
  • OpenGL ES 3.0 (mobile/embedded)

The backend queries actual capabilities at runtime and adjusts feature availability accordingly.

Limitations

Compared to Vulkan/Metal/DX12:

  • No async compute (compute runs on graphics queue)
  • Limited bindless resource support
  • Single command queue
  • Synchronous texture uploads

Command Recording

This backend uses a command recording pattern similar to wgpu-hal. Commands are recorded during render/compute pass encoding and executed during Queue.Submit. This allows for:

  • State tracking and optimization
  • Better error handling
  • Potential future multithreading

Directories

Path Synopsis
Package gl provides OpenGL constants and types for the GLES backend.
Package gl provides OpenGL constants and types for the GLES backend.
Package wgl provides Windows OpenGL (WGL) context management.
Package wgl provides Windows OpenGL (WGL) context management.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL