Skip to content

Commit

Permalink
Optimize atomic rendering for input attachments
Browse files Browse the repository at this point in the history
Pack clip data into an RGBA8 attachment and turn on src-over blending for both color and clip.

Handle advanced blend modes by rearranging the math such that the correct color isn't reached until *AFTER* the hardware blend state is applied.

This allows us to preserve clip and color contents by just emitting a=0 instead of loading the current value. It also saves flops by offloading the blending work onto the ROP blending unit, and serves as a hint to the hardware that it doesn't need to read or write anything when a == 0.

Diffs=
1b5e50fce Optimize atomic rendering for input attachments (#8310)
  • Loading branch information
csmartdalton committed Oct 11, 2024
1 parent 3042d4a commit c53b66b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1cc5f2b6f6cf02d15bcb3654343e4f3322a95402
1b5e50fcec4a38fc5056c0dff630d115f547cfb9
2 changes: 1 addition & 1 deletion wasm/submodules/rive-runtime
Submodule rive-runtime updated 36 files
+1 −1 .rive_head
+4 −5 renderer/include/rive/renderer/gpu.hpp
+1 −1 renderer/include/rive/renderer/vulkan/render_context_vulkan_impl.hpp
+1 −0 renderer/include/rive/renderer/vulkan/vulkan_context.hpp
+6 −2 renderer/path_fiddle/fiddle_context_vulkan.cpp
+2 −0 renderer/rive_vk_bootstrap/include/rive_vk_bootstrap/rive_vk_bootstrap.hpp
+3 −1 renderer/rive_vk_bootstrap/rive_vk_bootstrap.cpp
+3 −3 renderer/src/d3d/render_context_d3d_impl.cpp
+0 −1 renderer/src/draw.cpp
+1 −1 renderer/src/gl/pls_impl_rw_texture.cpp
+2 −2 renderer/src/gl/render_context_gl_impl.cpp
+1 −1 renderer/src/gpu.cpp
+1 −1 renderer/src/metal/background_shader_compiler.mm
+6 −10 renderer/src/metal/render_context_metal_impl.mm
+1 −1 renderer/src/render_context.cpp
+8 −8 renderer/src/shaders/Makefile
+82 −49 renderer/src/shaders/advanced_blend.glsl
+294 −238 renderer/src/shaders/atomic_draw.glsl
+20 −5 renderer/src/shaders/common.glsl
+6 −5 renderer/src/shaders/constants.glsl
+7 −3 renderer/src/shaders/glsl.glsl
+4 −1 renderer/src/shaders/hlsl.glsl
+4 −1 renderer/src/shaders/metal.glsl
+1 −0 renderer/src/shaders/spirv/atomic_base.glsl
+165 −102 renderer/src/vulkan/render_context_vulkan_impl.cpp
+2 −1 tests/common/testing_gl_renderer.cpp
+1 −1 tests/common/testing_gl_renderer.hpp
+1 −1 tests/common/testing_window.cpp
+3 −2 tests/common/testing_window.hpp
+13 −6 tests/common/testing_window_android_vulkan.cpp
+3 −1 tests/common/testing_window_coregraphics.cpp
+4 −2 tests/common/testing_window_egl.cpp
+4 −1 tests/common/testing_window_fiddle_context.cpp
+4 −1 tests/common/testing_window_metal_texture.mm
+6 −1 tests/common/testing_window_vulkan_texture.cpp
+31 −11 tests/player/player.cpp

0 comments on commit c53b66b

Please sign in to comment.