Repository navigation
Commit 57d7331
authored
fix(windows): cache compiled WebGL programs; WebGPU canvases no longer freeze on resize (#184)
* fix(windows): keep compiled WebGL programs across contexts and launches
ANGLE only reuses linked programs when the app installs EGL_ANDROID_blob_cache
callbacks; its own cache size defaults to 0. Without them every new context
recompiled every shader through the HLSL compiler, which blocked large scenes
for about a second on each visit.
Programs are now kept in memory and under %LOCALAPPDATA%\<exe>\canvas\program-cache
(CANVAS_PROGRAM_CACHE_DIR overrides it; empty keeps it in memory only).
* fix(windows): WebGPU canvases no longer freeze the app when resized
Configuring the surface from the layout pass waited for the GPU without a
limit, while the last presented frame waited on the compositor, which waits
on the UI thread. The resize is now applied from the next getCurrentTexture,
once that frame is done, drawing offscreen until then.
Resizing gets a fresh swapchain, since ResizeBuffers fails while the page
still holds a texture of the old one ("window is in use"). getCurrentTexture
falls back to the offscreen texture instead of returning null.
* chore(windows): rebuild canvasnative.node
* fix(webgl): don't wait for a program's link inside linkProgram
linkProgram queried ACTIVE_UNIFORM_BLOCKS straight after glLinkProgram, which
waits for the link to finish, so ANGLE could never link in the background. The
count is now queried (and cached) the first time uniformBlockBinding needs it.
* feat(webgl): KHR_parallel_shader_compile on Windows
ANGLE compiles and links on worker threads once a context enables it, and
COMPLETION_STATUS_KHR lets the page poll without waiting (three.js's
compileAsync, for example).
* chore(windows): rebuild canvasnative.node
* feat(webgl): KHR_parallel_shader_compile on Android
Exposed when the driver reports GL_KHR_parallel_shader_compile. The GL default
for MAX_SHADER_COMPILER_THREADS_KHR already lets the driver use its own maximum,
so nothing else has to be set. COMPLETION_STATUS_KHR reads back as a boolean.
* chore(ios,android): rebuild CanvasNative.xcframework and canvas-release.aar
* chore: 3.0.0-beta.51 parent d30d7ab commit 57d7331
150 files changed
Lines changed: 15902 additions & 15511 deletions
File tree
- crates
- canvas-core/src/gpu/gl
- canvas-c/src
- webgl
- webgpu
- canvas-napi/src/gl
- canvas-webgl/src
- packages
- canvas-babylon
- canvas-chartjs
- canvas-gamepad
- canvas-media
- canvas-phaser-ce
- canvas-phaser
- canvas-pixi
- canvas-polyfill
- canvas-svg
- canvas-three
- canvas
- WebGL
- WebGLExtensions
- WebGLRenderingContext
- platforms
- android
- ios
- CanvasNative.xcframework
- ios-arm64_x86_64-simulator
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations
- aarch64
- x86_64
- ios-arm64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- tvos-arm64-simulator
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- tvos-arm64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- xros-arm64-simulator
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- xros-arm64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- src/cpp
- webgl
- extensions
- windows
- arm64
- x64
- src-native
- canvas-android/canvas/src/main/cpp/include
- canvas-ios
- CanvasNative/include
- dist
- CanvasNative.xcframework
- ios-arm64_x86_64-simulator
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations
- aarch64
- x86_64
- ios-arm64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- tvos-arm64-simulator
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- tvos-arm64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- xros-arm64-simulator
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- xros-arm64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- dSYMs/CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- Release-appletvos
- CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- Release-appletvsimulator
- CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
- Release-xros
- CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- Release-xrsimulator
- CanvasNative.framework.dSYM/Contents/Resources
- DWARF
- Relocations/aarch64
- CanvasNative.framework
- Headers
- Modules/CanvasNative.swiftmodule
- Project
- _CodeSignature
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
94 | 190 | | |
95 | 191 | | |
96 | 192 | | |
| |||
960 | 1056 | | |
961 | 1057 | | |
962 | 1058 | | |
963 | | - | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
964 | 1063 | | |
965 | 1064 | | |
966 | 1065 | | |
| |||
992 | 1091 | | |
993 | 1092 | | |
994 | 1093 | | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
| 1094 | + | |
1006 | 1095 | | |
1007 | 1096 | | |
1008 | 1097 | | |
| |||
1660 | 1749 | | |
1661 | 1750 | | |
1662 | 1751 | | |
1663 | | - | |
1664 | | - | |
1665 | | - | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
1666 | 1769 | | |
1667 | 1770 | | |
1668 | 1771 | | |
| |||
1688 | 1791 | | |
1689 | 1792 | | |
1690 | 1793 | | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
1691 | 1797 | | |
1692 | 1798 | | |
1693 | 1799 | | |
| |||
1766 | 1872 | | |
1767 | 1873 | | |
1768 | 1874 | | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
1769 | 1879 | | |
1770 | 1880 | | |
1771 | 1881 | | |
1772 | 1882 | | |
1773 | 1883 | | |
1774 | 1884 | | |
1775 | | - | |
1776 | | - | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
1777 | 1895 | | |
1778 | 1896 | | |
1779 | 1897 | | |
| |||
1834 | 1952 | | |
1835 | 1953 | | |
1836 | 1954 | | |
1837 | | - | |
| 1955 | + | |
1838 | 1956 | | |
1839 | 1957 | | |
1840 | 1958 | | |
| |||
1855 | 1973 | | |
1856 | 1974 | | |
1857 | 1975 | | |
1858 | | - | |
1859 | | - | |
| 1976 | + | |
| 1977 | + | |
1860 | 1978 | | |
1861 | 1979 | | |
1862 | 1980 | | |
| |||
1901 | 2019 | | |
1902 | 2020 | | |
1903 | 2021 | | |
1904 | | - | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
1905 | 2026 | | |
1906 | 2027 | | |
1907 | 2028 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
0 commit comments