Skip to content

add glslang to support webgl frontend reflection#401

Merged
yorkie merged 4 commits intomainfrom
add/glslang
Nov 3, 2025
Merged

add glslang to support webgl frontend reflection#401
yorkie merged 4 commits intomainfrom
add/glslang

Conversation

@yorkie
Copy link
Collaborator

@yorkie yorkie commented Oct 29, 2025

This pull request introduces significant improvements to the WebGL client by integrating the GLSLang shader compiler, refactoring the program and shader management logic, and simplifying the codebase for better maintainability and performance. The most important changes are grouped below.

GLSLang Integration

  • Added GLSLang headers and libraries to the build system (cmake/TransmuteCommon.cmake, cmake/TransmuteClient.cmake), and ensured GLSLang is initialized in the WebGL context (src/client/graphics/webgl_context.cpp). This enables client-side shader compilation and validation. [1] [2] [3] [4]

WebGL Program and Shader Refactoring

  • Refactored program linking and shader compilation to use local methods (link, compile, attachShader, detachShader) instead of relying solely on command buffer requests, allowing for more robust and synchronous error handling and info log retrieval. [1] [2] [3]
  • Simplified retrieval of program and shader info logs, sources, and active attributes/uniforms to use local state instead of asynchronous or blocking command buffer responses. [1] [2] [3]

Codebase Simplification

  • Removed unnecessary waiting and completion checks for program and shader state, streamlining access to attributes, uniforms, and locations. [1] [2]
  • Cleaned up and reduced verbosity in the WebGL context header file, removing redundant comments and improving code readability. [1] [2] [3]

API Improvements

  • Added a new constructor to WebGLActiveInfo for easier instantiation with name, type, and size.

Build System Enhancements

  • Introduced a utility CMake function for linking third-party libraries with custom paths, improving flexibility in build configuration.

These changes collectively modernize the WebGL client infrastructure, improve shader management reliability, and lay the groundwork for future graphics features.

@yorkie yorkie requested a review from Copilot November 3, 2025 08:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds glslang library binary files and headers for Darwin (macOS) and Android platforms, along with minor code refactoring in the renderer module. The key changes involve:

  • Adding precompiled glslang static libraries (.a files) for Darwin and Android/aarch64 platforms
  • Adding glslang public header files for SPIRV-Tools and glslang APIs
  • Refactoring uniform location logic to remove caching mechanism
  • Updating command buffer type checking to use a static method

Reviewed Changes

Copilot reviewed 33 out of 46 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
thirdparty/libs/Darwin/lib/glslang/*.a Darwin (macOS) precompiled glslang libraries (default resource limits, SPIRV, OS-dependent, machine-independent, and generic code gen)
thirdparty/libs/Android/aarch64/lib/glslang/*.a Android ARM64 precompiled glslang libraries
thirdparty/headers/glslang/include/**/*.hpp, *.h Public API headers for SPIRV-Tools optimizer, linker, and glslang build configuration
src/renderer/gles/context_app.cpp Simplified uniform location lookup by removing cached location path
src/renderer/content_renderer.cpp Updated XR frame control check to use static method

@yorkie yorkie merged commit 7aebd10 into main Nov 3, 2025
8 checks passed
@yorkie yorkie deleted the add/glslang branch November 3, 2025 08:50
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.

2 participants