Skip to content

Commit

Permalink
Add a WebGPU mode that uses EXT_shader_pixel_local_storage
Browse files Browse the repository at this point in the history
Diffs=
bb00ec119 Add a WebGPU mode that uses EXT_shader_pixel_local_storage (#6048)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
  • Loading branch information
csmartdalton and csmartdalton committed Sep 29, 2023
1 parent 6b4b5a1 commit 0f69c2d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
af873d55a4c80c7ba5982186eed4ceb0a0fe579f
bb00ec119d2ced89395c70e718419aa970b312d8
31 changes: 25 additions & 6 deletions build/setup_compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
-- premake5 still doesn't accept "--os=emscripten" from the command line. To work around this we add
-- a custom "--wasm" flag that sets system to "emscripten" for us.
newoption {
trigger = "wasm",
description = "use emscripten",
trigger = 'emsdk',
value = 'type',
description = 'Build with emscripten',
allowed = {
{'none', "don't use emscripten"},
{'wasm', 'build WASM with emscripten'},
{'js', 'build Javascript with emscripten'},
},
default = 'none'
}
if _OPTIONS['wasm']
if _OPTIONS['emsdk'] ~= 'none'
then
-- Target emscripten via https://github.com/TurkeyMan/premake-emscripten.git
-- Premake doesn't properly load the _preload.lua for this module, so we load it here manually.
Expand All @@ -17,14 +24,26 @@ then
end

filter {'system:emscripten'}
do
linkoptions {
"-sALLOW_MEMORY_GROWTH",
}
end

filter {'system:emscripten', 'options:emsdk=wasm'}
do
buildoptions {
"-msimd128",
}
linkoptions {
"-sMIN_WEBGL_VERSION=2",
"-sMAX_WEBGL_VERSION=2",
"-sALLOW_MEMORY_GROWTH",
"-sWASM=1",
}
end

filter {'system:emscripten', 'options:emsdk=js'}
do
linkoptions {
"-sWASM=0",
}
end

Expand Down

0 comments on commit 0f69c2d

Please sign in to comment.