Skip to content

Commit

Permalink
Fix more bit rotting in webgpu_player
Browse files Browse the repository at this point in the history
Diffs=
b03d365c93 Fix more bit rotting in webgpu_player (#8906)

Co-authored-by: Chris Dalton <[email protected]>
  • Loading branch information
csmartdalton and csmartdalton committed Jan 22, 2025
1 parent 40afae8 commit f87e58e
Show file tree
Hide file tree
Showing 31 changed files with 196 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
77a886e2855287d72c853d3da89a09db3f139e42
b03d365c93d0d52f0f05ae598deacbf7dd330a53
330 changes: 166 additions & 164 deletions renderer/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,161 +9,163 @@ if _OPTIONS['with-skia'] then
dofile(RIVE_RUNTIME_DIR .. '/skia/renderer/build/premake5.lua')
end

project('path_fiddle')
do
dependson('rive')
kind('ConsoleApp')
includedirs({
'include',
RIVE_RUNTIME_DIR .. '/include',
'include',
RIVE_RUNTIME_DIR .. '/renderer/src',
})
externalincludedirs({
'glad',
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw/include',
yoga,
})

flags({ 'FatalCompileWarnings' })

defines({ 'YOGA_EXPORT=' })

files({ 'path_fiddle/**.cpp' })

links({
'rive',
'rive_pls_renderer',
'rive_decoders',
'libwebp',
'rive_harfbuzz',
'rive_sheenbidi',
'rive_yoga',
})
filter({ 'options:not no_rive_png' })
if not _OPTIONS['with-webgpu'] then
project('path_fiddle')
do
links({ 'zlib', 'libpng' })
end
filter({ 'options:not no_rive_jpeg' })
do
links({ 'libjpeg' })
end
filter({})
dependson('rive')
kind('ConsoleApp')
includedirs({
'include',
RIVE_RUNTIME_DIR .. '/include',
'include',
RIVE_RUNTIME_DIR .. '/renderer/src',
})
externalincludedirs({
'glad',
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw/include',
yoga,
})

if _OPTIONS['with_vulkan'] then
dofile('rive_vk_bootstrap/bootstrap_project.lua')
end
flags({ 'FatalCompileWarnings' })

filter('action:xcode4')
do
-- xcode doesnt like angle brackets except for -isystem
-- should use externalincludedirs but GitHub runners dont have latest premake5 binaries
buildoptions({ '-isystem' .. yoga })
end
defines({ 'YOGA_EXPORT=' })

filter({ 'toolset:not msc' })
do
buildoptions({ '-Wshorten-64-to-32' })
end
files({ 'path_fiddle/**.cpp' })

filter('options:with-skia')
do
includedirs({
RIVE_RUNTIME_DIR .. '/skia/renderer/include',
RIVE_RUNTIME_DIR .. '/skia/dependencies',
RIVE_RUNTIME_DIR .. '/skia/dependencies/skia',
links({
'rive',
'rive_pls_renderer',
'rive_decoders',
'libwebp',
'rive_harfbuzz',
'rive_sheenbidi',
'rive_yoga',
})
defines({ 'RIVE_SKIA', 'SK_GL' })
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/skia/out/static' })
links({ 'skia', 'rive_skia_renderer' })
end
filter({ 'options:not no_rive_png' })
do
links({ 'zlib', 'libpng' })
end
filter({ 'options:not no_rive_jpeg' })
do
links({ 'libjpeg' })
end
filter({})

filter('system:windows')
do
architecture('x64')
defines({ 'RIVE_WINDOWS', '_CRT_SECURE_NO_WARNINGS' })
libdirs({
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src/Release',
})
links({ 'glfw3', 'opengl32', 'd3d11', 'dxgi', 'd3dcompiler' })
end
if _OPTIONS['with_vulkan'] then
dofile('rive_vk_bootstrap/bootstrap_project.lua')
end

filter('system:macosx')
do
files({ 'path_fiddle/**.mm' })
buildoptions({ '-fobjc-arc' })
links({
'glfw3',
'Cocoa.framework',
'Metal.framework',
'QuartzCore.framework',
'IOKit.framework',
})
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
end
filter('action:xcode4')
do
-- xcode doesnt like angle brackets except for -isystem
-- should use externalincludedirs but GitHub runners dont have latest premake5 binaries
buildoptions({ '-isystem' .. yoga })
end

filter('system:linux')
do
links({ 'glfw3' })
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
end
filter({ 'toolset:not msc' })
do
buildoptions({ '-Wshorten-64-to-32' })
end

filter('options:with-dawn')
do
includedirs({
'dependencies/dawn/include',
'dependencies/dawn/out/release/gen/include',
})
libdirs({
'dependencies/dawn/out/release/obj/src/dawn',
'dependencies/dawn/out/release/obj/src/dawn/native',
'dependencies/dawn/out/release/obj/src/dawn/platform',
'dependencies/dawn/out/release/obj/src/dawn/platform',
})
links({
'dawn_native_static',
'webgpu_dawn',
'dawn_platform_static',
'dawn_proc_static',
})
end
filter('options:with-skia')
do
includedirs({
RIVE_RUNTIME_DIR .. '/skia/renderer/include',
RIVE_RUNTIME_DIR .. '/skia/dependencies',
RIVE_RUNTIME_DIR .. '/skia/dependencies/skia',
})
defines({ 'RIVE_SKIA', 'SK_GL' })
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/skia/out/static' })
links({ 'skia', 'rive_skia_renderer' })
end

filter({ 'options:with-dawn', 'system:windows' })
do
links({ 'dxguid' })
end
filter('system:windows')
do
architecture('x64')
defines({ 'RIVE_WINDOWS', '_CRT_SECURE_NO_WARNINGS' })
libdirs({
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src/Release',
})
links({ 'glfw3', 'opengl32', 'd3d11', 'dxgi', 'd3dcompiler' })
end

filter({ 'options:with-dawn', 'system:macosx' })
do
links({ 'IOSurface.framework' })
end
filter('system:macosx')
do
files({ 'path_fiddle/**.mm' })
buildoptions({ '-fobjc-arc' })
links({
'glfw3',
'Cocoa.framework',
'Metal.framework',
'QuartzCore.framework',
'IOKit.framework',
})
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
end

filter('system:emscripten')
do
targetname('path_fiddle.js')
linkoptions({
'-sUSE_GLFW=3',
'-sMIN_WEBGL_VERSION=2',
'-sMAX_WEBGL_VERSION=2',
'--preload-file ' .. path.getabsolute('../../../gold') .. '/rivs@/',
})
files({ 'path_fiddle/index.html' })
end
filter('system:linux')
do
links({ 'glfw3' })
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
end

filter({ 'options:with_rive_layout' })
do
defines({ 'YOGA_EXPORT=' })
includedirs({ yoga })
links({
'rive_yoga',
})
end
filter('options:with-dawn')
do
includedirs({
'dependencies/dawn/include',
'dependencies/dawn/out/release/gen/include',
})
libdirs({
'dependencies/dawn/out/release/obj/src/dawn',
'dependencies/dawn/out/release/obj/src/dawn/native',
'dependencies/dawn/out/release/obj/src/dawn/platform',
'dependencies/dawn/out/release/obj/src/dawn/platform',
})
links({
'dawn_native_static',
'webgpu_dawn',
'dawn_platform_static',
'dawn_proc_static',
})
end

filter('files:**.html')
do
buildmessage('Copying %{file.relpath} to %{cfg.targetdir}')
buildcommands({ 'cp %{file.relpath} %{cfg.targetdir}/%{file.name}' })
buildoutputs({ '%{cfg.targetdir}/%{file.name}' })
filter({ 'options:with-dawn', 'system:windows' })
do
links({ 'dxguid' })
end

filter({ 'options:with-dawn', 'system:macosx' })
do
links({ 'IOSurface.framework' })
end

filter('system:emscripten')
do
targetname('path_fiddle.js')
linkoptions({
'-sUSE_GLFW=3',
'-sMIN_WEBGL_VERSION=2',
'-sMAX_WEBGL_VERSION=2',
'--preload-file ' .. path.getabsolute('../../../gold') .. '/rivs@/',
})
files({ 'path_fiddle/index.html' })
end

filter({ 'options:with_rive_layout' })
do
defines({ 'YOGA_EXPORT=' })
includedirs({ yoga })
links({
'rive_yoga',
})
end

filter('files:**.html')
do
buildmessage('Copying %{file.relpath} to %{cfg.targetdir}')
buildcommands({ 'cp %{file.relpath} %{cfg.targetdir}/%{file.name}' })
buildoutputs({ '%{cfg.targetdir}/%{file.name}' })
end
end
end

Expand All @@ -187,30 +189,30 @@ if _OPTIONS['with-webgpu'] or _OPTIONS['with-dawn'] then
'webgpu_player/index.html',
'webgpu_player/icons.html',
'webgpu_player/rive.js',
'../../../gold/rivs/Santa_Claus.riv',
'../../../gold/rivs/Coffee_Cup.riv',
'../../../gold/rivs/skull_404.riv',
'../../../gold/rivs/octopus_loop.riv',
'../../../gold/rivs/planets.riv',
'../../../gold/rivs/Timer.riv',
'../../../gold/rivs/adventuretime_marceline-pb.riv',
'../../../gold/rivs/towersDemo.riv',
'../../../gold/rivs/skills_demov1.riv',
'../../../gold/rivs/car_demo.riv',
'../../../gold/rivs/cloud_icon.riv',
'../../../gold/rivs/coffee_loader.riv',
'../../../gold/rivs/documentation.riv',
'../../../gold/rivs/fire_button.riv',
'../../../gold/rivs/lumberjackfinal.riv',
'../../../gold/rivs/mail_box.riv',
'../../../gold/rivs/new_file.riv',
'../../../gold/rivs/poison_loader.riv',
'../../../gold/rivs/popsicle_loader.riv',
'../../../gold/rivs/radio_button_example.riv',
'../../../gold/rivs/avatar_demo.riv',
'../../../gold/rivs/stopwatch.riv',
'../../../gold/rivs/volume_bars.riv',
'../../../gold/rivs/travel_icons.riv',
'webgpu_player/rivs/Santa_Claus.riv',
'webgpu_player/rivs/Coffee_Cup.riv',
'webgpu_player/rivs/skull_404.riv',
'webgpu_player/rivs/octopus_loop.riv',
'webgpu_player/rivs/planets.riv',
'webgpu_player/rivs/Timer.riv',
'webgpu_player/rivs/adventuretime_marceline-pb.riv',
'webgpu_player/rivs/towersDemo.riv',
'webgpu_player/rivs/skills_demov1.riv',
'webgpu_player/rivs/car_demo.riv',
'webgpu_player/rivs/cloud_icon.riv',
'webgpu_player/rivs/coffee_loader.riv',
'webgpu_player/rivs/documentation.riv',
'webgpu_player/rivs/fire_button.riv',
'webgpu_player/rivs/lumberjackfinal.riv',
'webgpu_player/rivs/mail_box.riv',
'webgpu_player/rivs/new_file.riv',
'webgpu_player/rivs/poison_loader.riv',
'webgpu_player/rivs/popsicle_loader.riv',
'webgpu_player/rivs/radio_button_example.riv',
'webgpu_player/rivs/avatar_demo.riv',
'webgpu_player/rivs/stopwatch.riv',
'webgpu_player/rivs/volume_bars.riv',
'webgpu_player/rivs/travel_icons.riv',
})

links({
Expand Down
12 changes: 3 additions & 9 deletions renderer/src/webgpu/render_context_webgpu_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,7 @@ class RenderContextWebGPUImpl::ColorRampPipeline
{
return m_bindGroupLayout;
}
const wgpu::RenderPipeline& renderPipeline() const
{
return m_renderPipeline;
}
wgpu::RenderPipeline renderPipeline() const { return m_renderPipeline; }

private:
wgpu::BindGroupLayout m_bindGroupLayout;
Expand Down Expand Up @@ -551,10 +548,7 @@ class RenderContextWebGPUImpl::TessellatePipeline
{
return m_bindGroupLayout;
}
const wgpu::RenderPipeline renderPipeline() const
{
return m_renderPipeline;
}
wgpu::RenderPipeline renderPipeline() const { return m_renderPipeline; }

private:
wgpu::BindGroupLayout m_bindGroupLayout;
Expand Down Expand Up @@ -793,7 +787,7 @@ class RenderContextWebGPUImpl::DrawPipeline
}
}

const wgpu::RenderPipeline renderPipeline(
wgpu::RenderPipeline renderPipeline(
wgpu::TextureFormat framebufferFormat) const
{
return m_renderPipelines[RenderPipelineIdx(framebufferFormat)];
Expand Down
Loading

0 comments on commit f87e58e

Please sign in to comment.