aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpudevice.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-05-14 17:40:05 -0400
committerGitHub <noreply@github.com>2020-05-14 17:40:05 -0400
commite1cc38bea8a701108b6f2fa809f341769613b55f (patch)
treef86e587b9bde0b23d0dbe5dd92f27c8e30087279 /components/script/dom/gpudevice.rs
parent3acc0f90778a12f521dc788da2ed39ee24d506f2 (diff)
parente5065c7eb291a83ba489bc41b6c0241f39ed1c0a (diff)
downloadservo-e1cc38bea8a701108b6f2fa809f341769613b55f.tar.gz
servo-e1cc38bea8a701108b6f2fa809f341769613b55f.zip
Auto merge of #26525 - kunalmohan:share-gpu_id_hub, r=jdm
Share single gpu_id_hub among all threads in a process <!-- Please describe your changes on the following line: --> An id_hub for a content process is created when a new script thread is created. This is then cloned whenever a new globalscope object is created. The only exception being service workers because they exist in separate processes, for them a new hub is created. r?@jdm @kvark --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25725 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/script/dom/gpudevice.rs')
-rw-r--r--components/script/dom/gpudevice.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/gpudevice.rs b/components/script/dom/gpudevice.rs
index 571fde904fd..29fe2cda39d 100644
--- a/components/script/dom/gpudevice.rs
+++ b/components/script/dom/gpudevice.rs
@@ -171,6 +171,7 @@ impl GPUDeviceMethods for GPUDevice {
let id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_buffer_id(self.device.0.backend());
self.channel
.0
@@ -208,6 +209,7 @@ impl GPUDeviceMethods for GPUDevice {
let buffer_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_buffer_id(self.device.0.backend());
self.channel
.0
@@ -393,6 +395,7 @@ impl GPUDeviceMethods for GPUDevice {
let bind_group_layout_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_bind_group_layout_id(self.device.0.backend());
self.channel
.0
@@ -472,6 +475,7 @@ impl GPUDeviceMethods for GPUDevice {
let pipeline_layout_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_pipeline_layout_id(self.device.0.backend());
self.channel
.0
@@ -532,6 +536,7 @@ impl GPUDeviceMethods for GPUDevice {
let bind_group_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_bind_group_id(self.device.0.backend());
self.channel
.0
@@ -561,6 +566,7 @@ impl GPUDeviceMethods for GPUDevice {
let program_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_shader_module_id(self.device.0.backend());
self.channel
.0
@@ -587,6 +593,7 @@ impl GPUDeviceMethods for GPUDevice {
let compute_pipeline_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_compute_pipeline_id(self.device.0.backend());
let (sender, receiver) = ipc::channel().unwrap();
self.channel
@@ -613,6 +620,7 @@ impl GPUDeviceMethods for GPUDevice {
let command_encoder_id = self
.global()
.wgpu_id_hub()
+ .lock()
.create_command_encoder_id(self.device.0.backend());
self.channel
.0