yudshj/GL2GPU
关于
This repository contains the official implementation of the paper "GL2GPU: Accelerating WebGL Applications via Dynamic API Translation to WebGPU", presented at WWW 2025. https://doi.org/10.1145/3696410.3714785
设计与媒体可以做什么
- ✅ Dynamic Translation: Automatically intercepts and translates WebGL calls to WebGPU in real time.
- 🚀 Performance Boost: Achieves significant speedups (up to 87.7% on mobile) without modifying original applications.
- 📦 No Browser or App Modifications: Works entirely via JavaScript runtime and prototype patching.
- 📊 Benchmarks Validated: Validated using MotionMark, JSGameBench, and WebGL Aquarium.
实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文GL2GPU: Accelerating WebGL Applications via Dynamic API Translation to WebGPU
gl2gpu-demo-www25-submission-6.webm
GL2GPU is a dynamic translator that boosts WebGL rendering performance by converting WebGL API calls into WebGPU at JavaScript runtime — with no need to rewrite source code or modify the browser. Our evaluations show up to 45% average frame time reduction across platforms while preserving visual consistency.
🔥 Key Features
- ✅ Dynamic Translation: Automatically intercepts and translates WebGL calls to WebGPU in real time.
- 🚀 Performance Boost: Achieves significant speedups (up to 87.7% on mobile) without modifying original applications.
- 📦 No Browser or App Modifications: Works entirely via JavaScript runtime and prototype patching.
- 📊 Benchmarks Validated: Validated using MotionMark, JSGameBench, and WebGL Aquarium.
- 🧠 Adaptive Optimizations: Uses shader translation, render state caching, uniform batching, and bundle reuse for efficiency.
📄 How It Works
GL2GPU captures WebGL rendering commands, emulates WebGL state, and dynamically generates equivalent WebGPU shaders and descriptors. The system applies several optimization strategies:
- WebGL State Emulation: Tracks state changes using JavaScript prototype patching.
- Shader Translation: Converts GLSL to WGSL with shared variable merging.
- Two-Level Caching: Avoids redundant resource generation.
- Uniform Batching: Reduces GPU memory traffic.
- Render Bundle Management: Reuses WebGPU command sequences via Trie structure.
For architectural details, see our WWW 2025 paper.
🛠 Installation
You can integrate GL2GPU into your web application as a standalone JavaScript module:
<script src="path/to/gl2gpu.bundle.js"></script>
Note: WebGPU support requires recent versions of Chrome (v114+) with WebGPU enabled.
🧪 Benchmarks
| Benchmark | Avg. Frame Time Reduction |
|---|---|
| MotionMark | 73.9% – 87.7% |
| JSGameBench | 19.3% – 61.4% |
| Aquarium | 3.3% – 63.8% |
Tested across Mac, Windows, and Android devices with various GPUs (AMD, NVIDIA, Intel, Snapdragon).
📺 Live Demo
- 🌐 Live site: https://gl2gpu.hanyd.site/
- 🧪 Demo source: https://github.com/yudshj/gl2gpu-demo
📄 Citation
If you use GL2GPU in your research, please cite:
@inproceedings{10.1145/3696410.3714785,
author = {Han, Yudong and Bi, Weichen and An, Ruibo and Tian, Deyu and Yang, Qi and Ma, Yun},
title = {GL2GPU: Accelerating WebGL Applications via Dynamic API Translation to WebGPU},
year = {2025},
isbn = {9798400712746},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3696410.3714785},
doi = {10.1145/3696410.3714785},
booktitle = {Proceedings of the ACM on Web Conference 2025},
pages = {751–762},
numpages = {12},
keywords = {api translation, graphics, web applications, webgl, webgpu},
location = {Sydney NSW, Australia},
series = {WWW '25}
}
👥 Contributors
- Yudong Han, Weichen Bi, Ruibo An, Deyu Tian, Qi Yang, Yun Ma (Peking University)
探索相关项目
加载中…