react-native-webgpu 0.19.0 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -116,6 +116,9 @@ final class ViewSnapshot {
|
|
|
116
116
|
HardwareRenderer renderer = new HardwareRenderer();
|
|
117
117
|
Image image = null;
|
|
118
118
|
try {
|
|
119
|
+
// HardwareRenderer is opaque by default and doesn't clear the buffer, so
|
|
120
|
+
// transparent pixels keep whatever was in it (garbage on Mali GPUs).
|
|
121
|
+
renderer.setOpaque(false);
|
|
119
122
|
renderer.setSurface(reader.getSurface());
|
|
120
123
|
// Match the framework's default light so elevation shadows come out
|
|
121
124
|
// like on screen (ThreadedRenderer reads these from the theme; the
|
|
@@ -245,8 +245,20 @@ async::AsyncTaskHandle GPUAdapter::requestDevice(
|
|
|
245
245
|
// and SurfaceControl import there, so skip it on all of Android unless
|
|
246
246
|
// the caller disables the toggle. Dawn drops unknown toggle names, so a
|
|
247
247
|
// build without this toggle is unaffected.
|
|
248
|
+
//
|
|
249
|
+
// One VkPipelineCache per device, as Chrome configures Dawn on every
|
|
250
|
+
// Vulkan device. Without it Dawn creates a VkPipelineCache for each
|
|
251
|
+
// pipeline it compiles, serializes it (for a blob cache these devices
|
|
252
|
+
// do not have) and destroys it, on each of its worker threads at
|
|
253
|
+
// once: that destructor is where the Imagination PowerVR driver
|
|
254
|
+
// (MediaTek mt6855) segfaults while Skia Graphite compiles its
|
|
255
|
+
// pipelines (wcandillon/react-native-skia#4340). With one cache the
|
|
256
|
+
// only vkDestroyPipelineCache runs at device teardown, and pipelines
|
|
257
|
+
// that share binaries compile faster. PerformIdleTasks is not needed:
|
|
258
|
+
// nothing persists the cache.
|
|
248
259
|
static const char *const kAndroidEnabledToggles[] = {
|
|
249
|
-
"ignore_imported_ahardwarebuffer_vulkan_image_size"
|
|
260
|
+
"ignore_imported_ahardwarebuffer_vulkan_image_size",
|
|
261
|
+
"vulkan_monolithic_pipeline_cache"};
|
|
250
262
|
for (const char *name : kAndroidEnabledToggles) {
|
|
251
263
|
const auto named = [name](const char *t) {
|
|
252
264
|
return std::strcmp(t, name) == 0;
|