Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture snatching #4969

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Texture snatching #4969

merged 2 commits into from
Jan 5, 2024

Conversation

nical
Copy link
Contributor

@nical nical commented Jan 3, 2024

Connections

Most of the remaining work towards #4787
Depends on #4954

Description

This is almost identical to the work that was done to snatch buffers.

  • When accessing a raw bind group, check that the underlying raw textures are not destroyed.
  • Add a DestroyedTexture structure that will hold the snatched texture until it is ready to be deleted (pending writes/submissions are done).
  • Snatch the raw texture in Texture::destroy.

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.

@nical nical requested a review from a team as a code owner January 3, 2024 13:32
@nical
Copy link
Contributor Author

nical commented Jan 3, 2024

There appears to be a deadlock that is sometimes reproducible in the multithreaded_compute, I'm looking into it.

Edit: Nevermind, this is a preexisting issue.

@cwfitzgerald
Copy link
Member

This failure is solved by #4980

@nical nical force-pushed the destroyed-texture branch from 026775d to a8dfcfc Compare January 4, 2024 10:30
@nical nical force-pushed the destroyed-texture branch from a8dfcfc to 8a36e9e Compare January 5, 2024 10:31
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistent with the buffer logic, good stuff!

@teoxoy teoxoy merged commit 4b82121 into gfx-rs:trunk Jan 5, 2024
26 checks passed
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 6, 2024
…a54af3aa12d. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler

Changelog

 * #4927 BGL Weak Pointer Deduplication Pool
   By cwfitzgerald in gfx-rs/wgpu#4927
 * #4958 Change examples page menu on smaller screens
   By Dinnerbone in gfx-rs/wgpu#4958
 * #4950 Bump anyhow from 1.0.77 to 1.0.78
   By dependabot[bot] in gfx-rs/wgpu#4950
 * #4957 Disable Linux Tests
   By cwfitzgerald in gfx-rs/wgpu#4957
 * #4960 Fix incorrect ConfigureSurfaceError::TooLarge message
   By Dinnerbone in gfx-rs/wgpu#4960
 * #4935 Add `cfg_aliases` to `wgpu`
   By daxpedda in gfx-rs/wgpu#4935
 * #4939 hello_compute: check for missing command-line args
   By vilcans in gfx-rs/wgpu#4939
 * #4948 Bump winit from 0.29.6 to 0.29.8
   By dependabot[bot] in gfx-rs/wgpu#4948
 * #4944 Fix xtask wasm-bindgen install
   By rukai in gfx-rs/wgpu#4944
 * #4858 [glsl-in] fix swizzle in global const context
   By teoxoy in gfx-rs/wgpu#4858
 * #4968 [gl] fix RGBA8 format capabilities
   By teoxoy in gfx-rs/wgpu#4968
 * #4947 Avoid allocating during queue submit
   By udoprog in gfx-rs/wgpu#4947
 * #4965 Bump serde from 1.0.193 to 1.0.194
   By dependabot[bot] in gfx-rs/wgpu#4965
 * #4975 Fix Hang in Multithreaded Compute Test
   By cwfitzgerald in gfx-rs/wgpu#4975
 * #4966 Bump anyhow from 1.0.78 to 1.0.79
   By dependabot[bot] in gfx-rs/wgpu#4966
 * #4978 Bump thiserror from 1.0.52 to 1.0.56
   By dependabot[bot] in gfx-rs/wgpu#4978
 * #4979 Bump syn from 2.0.46 to 2.0.47
   By dependabot[bot] in gfx-rs/wgpu#4979
 * #4977 Use Custom Mesa for Building
   By cwfitzgerald in gfx-rs/wgpu#4977
 * #4981 Bump serde_json from 1.0.108 to 1.0.110
   By dependabot[bot] in gfx-rs/wgpu#4981
 * #4959 wgpu-hal: Fix Mesa version check for version with suffix containing `.`
   By ids1024 in gfx-rs/wgpu#4959
 * #4976 Shorten Lock Lifetimes
   By cwfitzgerald in gfx-rs/wgpu#4976
 * #4980 Pin DXC and Vulkan SDK version
   By cwfitzgerald in gfx-rs/wgpu#4980
 * #4974 gles: use already existing debug__fn private capabilty instead of checking extensions
   By valaphee in gfx-rs/wgpu#4974
 * #4987 Remove Mac CI
   By cwfitzgerald in gfx-rs/wgpu#4987
 * #4990 Fix Queue::write_texture, Fix DX12 write_texture_subset_2d and re-enable the test.
   By dtzxporter in gfx-rs/wgpu#4990
 * #4994 Bump syn from 2.0.47 to 2.0.48
   By dependabot[bot] in gfx-rs/wgpu#4994
 * #4993 Bump serde_json from 1.0.110 to 1.0.111
   By dependabot[bot] in gfx-rs/wgpu#4993
 * #4992 Bump gpu-allocator from 0.24.0 to 0.25.0
   By dependabot[bot] in gfx-rs/wgpu#4992
 * #4995 Add Verbosity Flags to wgpu-info
   By cwfitzgerald in gfx-rs/wgpu#4995
 * #4996 Dependency Update Rollup
   By cwfitzgerald in gfx-rs/wgpu#4996
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969

Differential Revision: https://phabricator.services.mozilla.com/D197786
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Jan 9, 2024
…a54af3aa12d. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler

Changelog

 * #4927 BGL Weak Pointer Deduplication Pool
   By cwfitzgerald in gfx-rs/wgpu#4927
 * #4958 Change examples page menu on smaller screens
   By Dinnerbone in gfx-rs/wgpu#4958
 * #4950 Bump anyhow from 1.0.77 to 1.0.78
   By dependabot[bot] in gfx-rs/wgpu#4950
 * #4957 Disable Linux Tests
   By cwfitzgerald in gfx-rs/wgpu#4957
 * #4960 Fix incorrect ConfigureSurfaceError::TooLarge message
   By Dinnerbone in gfx-rs/wgpu#4960
 * #4935 Add `cfg_aliases` to `wgpu`
   By daxpedda in gfx-rs/wgpu#4935
 * #4939 hello_compute: check for missing command-line args
   By vilcans in gfx-rs/wgpu#4939
 * #4948 Bump winit from 0.29.6 to 0.29.8
   By dependabot[bot] in gfx-rs/wgpu#4948
 * #4944 Fix xtask wasm-bindgen install
   By rukai in gfx-rs/wgpu#4944
 * #4858 [glsl-in] fix swizzle in global const context
   By teoxoy in gfx-rs/wgpu#4858
 * #4968 [gl] fix RGBA8 format capabilities
   By teoxoy in gfx-rs/wgpu#4968
 * #4947 Avoid allocating during queue submit
   By udoprog in gfx-rs/wgpu#4947
 * #4965 Bump serde from 1.0.193 to 1.0.194
   By dependabot[bot] in gfx-rs/wgpu#4965
 * #4975 Fix Hang in Multithreaded Compute Test
   By cwfitzgerald in gfx-rs/wgpu#4975
 * #4966 Bump anyhow from 1.0.78 to 1.0.79
   By dependabot[bot] in gfx-rs/wgpu#4966
 * #4978 Bump thiserror from 1.0.52 to 1.0.56
   By dependabot[bot] in gfx-rs/wgpu#4978
 * #4979 Bump syn from 2.0.46 to 2.0.47
   By dependabot[bot] in gfx-rs/wgpu#4979
 * #4977 Use Custom Mesa for Building
   By cwfitzgerald in gfx-rs/wgpu#4977
 * #4981 Bump serde_json from 1.0.108 to 1.0.110
   By dependabot[bot] in gfx-rs/wgpu#4981
 * #4959 wgpu-hal: Fix Mesa version check for version with suffix containing `.`
   By ids1024 in gfx-rs/wgpu#4959
 * #4976 Shorten Lock Lifetimes
   By cwfitzgerald in gfx-rs/wgpu#4976
 * #4980 Pin DXC and Vulkan SDK version
   By cwfitzgerald in gfx-rs/wgpu#4980
 * #4974 gles: use already existing debug__fn private capabilty instead of checking extensions
   By valaphee in gfx-rs/wgpu#4974
 * #4987 Remove Mac CI
   By cwfitzgerald in gfx-rs/wgpu#4987
 * #4990 Fix Queue::write_texture, Fix DX12 write_texture_subset_2d and re-enable the test.
   By dtzxporter in gfx-rs/wgpu#4990
 * #4994 Bump syn from 2.0.47 to 2.0.48
   By dependabot[bot] in gfx-rs/wgpu#4994
 * #4993 Bump serde_json from 1.0.110 to 1.0.111
   By dependabot[bot] in gfx-rs/wgpu#4993
 * #4992 Bump gpu-allocator from 0.24.0 to 0.25.0
   By dependabot[bot] in gfx-rs/wgpu#4992
 * #4995 Add Verbosity Flags to wgpu-info
   By cwfitzgerald in gfx-rs/wgpu#4995
 * #4996 Dependency Update Rollup
   By cwfitzgerald in gfx-rs/wgpu#4996
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969

Differential Revision: https://phabricator.services.mozilla.com/D197786
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 16, 2024
…a54af3aa12d. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler

Changelog

 * #4927 BGL Weak Pointer Deduplication Pool
   By cwfitzgerald in gfx-rs/wgpu#4927
 * #4958 Change examples page menu on smaller screens
   By Dinnerbone in gfx-rs/wgpu#4958
 * #4950 Bump anyhow from 1.0.77 to 1.0.78
   By dependabot[bot] in gfx-rs/wgpu#4950
 * #4957 Disable Linux Tests
   By cwfitzgerald in gfx-rs/wgpu#4957
 * #4960 Fix incorrect ConfigureSurfaceError::TooLarge message
   By Dinnerbone in gfx-rs/wgpu#4960
 * #4935 Add `cfg_aliases` to `wgpu`
   By daxpedda in gfx-rs/wgpu#4935
 * #4939 hello_compute: check for missing command-line args
   By vilcans in gfx-rs/wgpu#4939
 * #4948 Bump winit from 0.29.6 to 0.29.8
   By dependabot[bot] in gfx-rs/wgpu#4948
 * #4944 Fix xtask wasm-bindgen install
   By rukai in gfx-rs/wgpu#4944
 * #4858 [glsl-in] fix swizzle in global const context
   By teoxoy in gfx-rs/wgpu#4858
 * #4968 [gl] fix RGBA8 format capabilities
   By teoxoy in gfx-rs/wgpu#4968
 * #4947 Avoid allocating during queue submit
   By udoprog in gfx-rs/wgpu#4947
 * #4965 Bump serde from 1.0.193 to 1.0.194
   By dependabot[bot] in gfx-rs/wgpu#4965
 * #4975 Fix Hang in Multithreaded Compute Test
   By cwfitzgerald in gfx-rs/wgpu#4975
 * #4966 Bump anyhow from 1.0.78 to 1.0.79
   By dependabot[bot] in gfx-rs/wgpu#4966
 * #4978 Bump thiserror from 1.0.52 to 1.0.56
   By dependabot[bot] in gfx-rs/wgpu#4978
 * #4979 Bump syn from 2.0.46 to 2.0.47
   By dependabot[bot] in gfx-rs/wgpu#4979
 * #4977 Use Custom Mesa for Building
   By cwfitzgerald in gfx-rs/wgpu#4977
 * #4981 Bump serde_json from 1.0.108 to 1.0.110
   By dependabot[bot] in gfx-rs/wgpu#4981
 * #4959 wgpu-hal: Fix Mesa version check for version with suffix containing `.`
   By ids1024 in gfx-rs/wgpu#4959
 * #4976 Shorten Lock Lifetimes
   By cwfitzgerald in gfx-rs/wgpu#4976
 * #4980 Pin DXC and Vulkan SDK version
   By cwfitzgerald in gfx-rs/wgpu#4980
 * #4974 gles: use already existing debug__fn private capabilty instead of checking extensions
   By valaphee in gfx-rs/wgpu#4974
 * #4987 Remove Mac CI
   By cwfitzgerald in gfx-rs/wgpu#4987
 * #4990 Fix Queue::write_texture, Fix DX12 write_texture_subset_2d and re-enable the test.
   By dtzxporter in gfx-rs/wgpu#4990
 * #4994 Bump syn from 2.0.47 to 2.0.48
   By dependabot[bot] in gfx-rs/wgpu#4994
 * #4993 Bump serde_json from 1.0.110 to 1.0.111
   By dependabot[bot] in gfx-rs/wgpu#4993
 * #4992 Bump gpu-allocator from 0.24.0 to 0.25.0
   By dependabot[bot] in gfx-rs/wgpu#4992
 * #4995 Add Verbosity Flags to wgpu-info
   By cwfitzgerald in gfx-rs/wgpu#4995
 * #4996 Dependency Update Rollup
   By cwfitzgerald in gfx-rs/wgpu#4996
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969

Differential Revision: https://phabricator.services.mozilla.com/D197786

UltraBlame original commit: 17af24495b14543eed7f3cfd1434a961d879f47e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 16, 2024
…a54af3aa12d. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler

Changelog

 * #4927 BGL Weak Pointer Deduplication Pool
   By cwfitzgerald in gfx-rs/wgpu#4927
 * #4958 Change examples page menu on smaller screens
   By Dinnerbone in gfx-rs/wgpu#4958
 * #4950 Bump anyhow from 1.0.77 to 1.0.78
   By dependabot[bot] in gfx-rs/wgpu#4950
 * #4957 Disable Linux Tests
   By cwfitzgerald in gfx-rs/wgpu#4957
 * #4960 Fix incorrect ConfigureSurfaceError::TooLarge message
   By Dinnerbone in gfx-rs/wgpu#4960
 * #4935 Add `cfg_aliases` to `wgpu`
   By daxpedda in gfx-rs/wgpu#4935
 * #4939 hello_compute: check for missing command-line args
   By vilcans in gfx-rs/wgpu#4939
 * #4948 Bump winit from 0.29.6 to 0.29.8
   By dependabot[bot] in gfx-rs/wgpu#4948
 * #4944 Fix xtask wasm-bindgen install
   By rukai in gfx-rs/wgpu#4944
 * #4858 [glsl-in] fix swizzle in global const context
   By teoxoy in gfx-rs/wgpu#4858
 * #4968 [gl] fix RGBA8 format capabilities
   By teoxoy in gfx-rs/wgpu#4968
 * #4947 Avoid allocating during queue submit
   By udoprog in gfx-rs/wgpu#4947
 * #4965 Bump serde from 1.0.193 to 1.0.194
   By dependabot[bot] in gfx-rs/wgpu#4965
 * #4975 Fix Hang in Multithreaded Compute Test
   By cwfitzgerald in gfx-rs/wgpu#4975
 * #4966 Bump anyhow from 1.0.78 to 1.0.79
   By dependabot[bot] in gfx-rs/wgpu#4966
 * #4978 Bump thiserror from 1.0.52 to 1.0.56
   By dependabot[bot] in gfx-rs/wgpu#4978
 * #4979 Bump syn from 2.0.46 to 2.0.47
   By dependabot[bot] in gfx-rs/wgpu#4979
 * #4977 Use Custom Mesa for Building
   By cwfitzgerald in gfx-rs/wgpu#4977
 * #4981 Bump serde_json from 1.0.108 to 1.0.110
   By dependabot[bot] in gfx-rs/wgpu#4981
 * #4959 wgpu-hal: Fix Mesa version check for version with suffix containing `.`
   By ids1024 in gfx-rs/wgpu#4959
 * #4976 Shorten Lock Lifetimes
   By cwfitzgerald in gfx-rs/wgpu#4976
 * #4980 Pin DXC and Vulkan SDK version
   By cwfitzgerald in gfx-rs/wgpu#4980
 * #4974 gles: use already existing debug__fn private capabilty instead of checking extensions
   By valaphee in gfx-rs/wgpu#4974
 * #4987 Remove Mac CI
   By cwfitzgerald in gfx-rs/wgpu#4987
 * #4990 Fix Queue::write_texture, Fix DX12 write_texture_subset_2d and re-enable the test.
   By dtzxporter in gfx-rs/wgpu#4990
 * #4994 Bump syn from 2.0.47 to 2.0.48
   By dependabot[bot] in gfx-rs/wgpu#4994
 * #4993 Bump serde_json from 1.0.110 to 1.0.111
   By dependabot[bot] in gfx-rs/wgpu#4993
 * #4992 Bump gpu-allocator from 0.24.0 to 0.25.0
   By dependabot[bot] in gfx-rs/wgpu#4992
 * #4995 Add Verbosity Flags to wgpu-info
   By cwfitzgerald in gfx-rs/wgpu#4995
 * #4996 Dependency Update Rollup
   By cwfitzgerald in gfx-rs/wgpu#4996
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969

Differential Revision: https://phabricator.services.mozilla.com/D197786

UltraBlame original commit: 17af24495b14543eed7f3cfd1434a961d879f47e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2024
…a54af3aa12d. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler

Changelog

 * #4927 BGL Weak Pointer Deduplication Pool
   By cwfitzgerald in gfx-rs/wgpu#4927
 * #4958 Change examples page menu on smaller screens
   By Dinnerbone in gfx-rs/wgpu#4958
 * #4950 Bump anyhow from 1.0.77 to 1.0.78
   By dependabot[bot] in gfx-rs/wgpu#4950
 * #4957 Disable Linux Tests
   By cwfitzgerald in gfx-rs/wgpu#4957
 * #4960 Fix incorrect ConfigureSurfaceError::TooLarge message
   By Dinnerbone in gfx-rs/wgpu#4960
 * #4935 Add `cfg_aliases` to `wgpu`
   By daxpedda in gfx-rs/wgpu#4935
 * #4939 hello_compute: check for missing command-line args
   By vilcans in gfx-rs/wgpu#4939
 * #4948 Bump winit from 0.29.6 to 0.29.8
   By dependabot[bot] in gfx-rs/wgpu#4948
 * #4944 Fix xtask wasm-bindgen install
   By rukai in gfx-rs/wgpu#4944
 * #4858 [glsl-in] fix swizzle in global const context
   By teoxoy in gfx-rs/wgpu#4858
 * #4968 [gl] fix RGBA8 format capabilities
   By teoxoy in gfx-rs/wgpu#4968
 * #4947 Avoid allocating during queue submit
   By udoprog in gfx-rs/wgpu#4947
 * #4965 Bump serde from 1.0.193 to 1.0.194
   By dependabot[bot] in gfx-rs/wgpu#4965
 * #4975 Fix Hang in Multithreaded Compute Test
   By cwfitzgerald in gfx-rs/wgpu#4975
 * #4966 Bump anyhow from 1.0.78 to 1.0.79
   By dependabot[bot] in gfx-rs/wgpu#4966
 * #4978 Bump thiserror from 1.0.52 to 1.0.56
   By dependabot[bot] in gfx-rs/wgpu#4978
 * #4979 Bump syn from 2.0.46 to 2.0.47
   By dependabot[bot] in gfx-rs/wgpu#4979
 * #4977 Use Custom Mesa for Building
   By cwfitzgerald in gfx-rs/wgpu#4977
 * #4981 Bump serde_json from 1.0.108 to 1.0.110
   By dependabot[bot] in gfx-rs/wgpu#4981
 * #4959 wgpu-hal: Fix Mesa version check for version with suffix containing `.`
   By ids1024 in gfx-rs/wgpu#4959
 * #4976 Shorten Lock Lifetimes
   By cwfitzgerald in gfx-rs/wgpu#4976
 * #4980 Pin DXC and Vulkan SDK version
   By cwfitzgerald in gfx-rs/wgpu#4980
 * #4974 gles: use already existing debug__fn private capabilty instead of checking extensions
   By valaphee in gfx-rs/wgpu#4974
 * #4987 Remove Mac CI
   By cwfitzgerald in gfx-rs/wgpu#4987
 * #4990 Fix Queue::write_texture, Fix DX12 write_texture_subset_2d and re-enable the test.
   By dtzxporter in gfx-rs/wgpu#4990
 * #4994 Bump syn from 2.0.47 to 2.0.48
   By dependabot[bot] in gfx-rs/wgpu#4994
 * #4993 Bump serde_json from 1.0.110 to 1.0.111
   By dependabot[bot] in gfx-rs/wgpu#4993
 * #4992 Bump gpu-allocator from 0.24.0 to 0.25.0
   By dependabot[bot] in gfx-rs/wgpu#4992
 * #4995 Add Verbosity Flags to wgpu-info
   By cwfitzgerald in gfx-rs/wgpu#4995
 * #4996 Dependency Update Rollup
   By cwfitzgerald in gfx-rs/wgpu#4996
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4954 Put raw texture access behind snatch guards
   By nical in gfx-rs/wgpu#4954
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969
 * #4969 Texture snatching
   By nical in gfx-rs/wgpu#4969

Differential Revision: https://phabricator.services.mozilla.com/D197786

UltraBlame original commit: 17af24495b14543eed7f3cfd1434a961d879f47e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants