generated from emilk/eframe_template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WebGL support to web builds (#52)
* Add new feature `webgl` for enabling WebGL in web builds wgpu doesn't allow supporting both WebGL and WebGPU in the same binary yet so we have to decide at compile time which one to use. (cherry picked from commit ac4d0d9) * Fix "Texture[1] does not exist" when using WebGL (cherry picked from commit 1f6f234) * Set min log level to info in web builds This is to avoid clogging the console with useless messages. (cherry picked from commit cc857b2) * Refactor tilemap shader to not use storage buffers It's not supported in WebGL and probably also not supported in OpenGL. (cherry picked from commit f951d14) * Pad sprite shader uniforms to 16 bytes (cherry picked from commit 92e9aca) * Add a feature test for WebGPU (cherry picked from commit 858fcb0) * Remove extra space from assets/main.js (cherry picked from commit 4cf6193) * Move WebGPU feature detection into a web worker Firefox Nightly apparently only supports WebGPU on the main thread and not in a web worker where we need it, so the test for WebGPU support now runs in a worker thread. (cherry picked from commit 5d6bbb2) * Replace all double quotes in assets/main.js with single quotes (cherry picked from commit d9ec1b6)
- Loading branch information
Showing
16 changed files
with
110 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (C) 2023 Lily Lyons | ||
// | ||
// This file is part of Luminol. | ||
// | ||
// Luminol is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Luminol is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Luminol. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
onmessage = async function () { | ||
let gpu = false; | ||
try { | ||
let adapter = await navigator.gpu?.requestAdapter(); | ||
gpu = typeof GPUAdapter === 'function' && adapter instanceof GPUAdapter; | ||
} catch (e) {} | ||
postMessage(gpu); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters