# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/firefox/hotfix-wgpu-atomicu64.patch # Copyright (C) 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- --- firefox-124.0.1/third_party/rust/wgpu-core/src/device/resource.rs.vanilla 2024-02-16 21:58:52.850354732 +0100 +++ firefox-124.0.1/third_party/rust/wgpu-core/src/device/resource.rs 2024-02-16 21:59:37.777350403 +0100 @@ -47,7 +47,7 @@ iter, num::NonZeroU32, sync::{ - atomic::{AtomicBool, AtomicU64, Ordering}, + atomic::{AtomicBool, AtomicUsize, Ordering}, Arc, Weak, }, }; @@ -92,7 +92,7 @@ pub(crate) command_allocator: Mutex>>, //Note: The submission index here corresponds to the last submission that is done. - pub(crate) active_submission_index: AtomicU64, //SubmissionIndex, + pub(crate) active_submission_index: AtomicUsize, //SubmissionIndex, pub(crate) fence: RwLock>, /// Is this device valid? Valid is closely associated with "lose the device", @@ -252,7 +252,7 @@ zero_buffer: Some(zero_buffer), info: ResourceInfo::new(""), command_allocator: Mutex::new(Some(com_alloc)), - active_submission_index: AtomicU64::new(0), + active_submission_index: AtomicUsize::new(0), fence: RwLock::new(Some(fence)), valid: AtomicBool::new(true), trackers: Mutex::new(Tracker::new()), --- firefox-124.0/third_party/rust/wgpu-core/src/resource.rs.vanilla 2024-02-19 21:08:28.866324387 +0100 +++ firefox-124.0/third_party/rust/wgpu-core/src/resource.rs 2024-02-19 21:22:43.532242036 +0100 @@ -611,7 +611,7 @@ device: Arc>, label: String, pub(crate) id: BufferId, - pub(crate) submission_index: u64, + pub(crate) submission_index: usize, bind_groups: Vec>>, } @@ -978,7 +978,7 @@ device: Arc>, label: String, pub(crate) id: TextureId, - pub(crate) submission_index: u64, + pub(crate) submission_index: usize, } impl DestroyedTexture { --- firefox-122.0.1/third_party/rust/wgpu-hal/src/lib.rs.vanilla 2024-02-16 22:16:04.720255307 +0100 +++ firefox-122.0.1/third_party/rust/wgpu-hal/src/lib.rs 2024-02-16 22:16:23.561253492 +0100 @@ -106,7 +106,7 @@ pub type Label<'a> = Option<&'a str>; pub type MemoryRange = Range; -pub type FenceValue = u64; +pub type FenceValue = usize; /// Drop guard to signal wgpu-hal is no longer using an externally created object. pub type DropGuard = Box; --- firefox-122.0.1/third_party/rust/ash/src/vk/definitions.rs.vanilla 2024-02-16 22:32:32.080160171 +0100 +++ firefox-122.0.1/third_party/rust/ash/src/vk/definitions.rs 2024-02-16 22:42:02.668105193 +0100 @@ -31142,13 +31142,13 @@ } impl<'a> TimelineSemaphoreSubmitInfoBuilder<'a> { #[inline] - pub fn wait_semaphore_values(mut self, wait_semaphore_values: &'a [u64]) -> Self { + pub fn wait_semaphore_values(mut self, wait_semaphore_values: &'a [usize]) -> Self { self.inner.wait_semaphore_value_count = wait_semaphore_values.len() as _; self.inner.p_wait_semaphore_values = wait_semaphore_values.as_ptr(); self } #[inline] - pub fn signal_semaphore_values(mut self, signal_semaphore_values: &'a [u64]) -> Self { + pub fn signal_semaphore_values(mut self, signal_semaphore_values: &'a [usize]) -> Self { self.inner.signal_semaphore_value_count = signal_semaphore_values.len() as _; self.inner.p_signal_semaphore_values = signal_semaphore_values.as_ptr(); self @@ -31225,7 +31225,7 @@ self } #[inline] - pub fn values(mut self, values: &'a [u64]) -> Self { + pub fn values(mut self, values: &'a [usize]) -> Self { self.inner.semaphore_count = values.len() as _; self.inner.p_values = values.as_ptr(); self --- firefox-122.0.1/third_party/rust/ash/src/device.rs.vanilla 2024-02-16 23:09:37.968945698 +0100 +++ firefox-122.0.1/third_party/rust/ash/src/device.rs 2024-02-16 23:10:12.436942377 +0100 @@ -654,7 +654,7 @@ /// #[inline] - pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { + pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { let mut value = 0; (self.device_fn_1_2.get_semaphore_counter_value)(self.handle(), semaphore, &mut value) .result_with_success(value) --- firefox-122.0.1/third_party/rust/ash/src/extensions/khr/timeline_semaphore.rs.vanilla 2024-02-16 23:10:48.236938928 +0100 +++ firefox-122.0.1/third_party/rust/ash/src/extensions/khr/timeline_semaphore.rs 2024-02-16 23:10:58.528937936 +0100 @@ -21,7 +21,7 @@ /// #[inline] - pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { + pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { let mut value = 0; (self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, &mut value) .result_with_success(value) --- firefox-122.0.1/third_party/rust/ash/src/vk/definitions.rs.vanilla 2024-02-16 22:53:37.857038209 +0100 +++ firefox-122.0.1/third_party/rust/ash/src/vk/definitions.rs 2024-02-16 22:59:45.737002762 +0100 @@ -17837,9 +17837,9 @@ pub s_type: StructureType, pub p_next: *const c_void, pub wait_semaphore_values_count: u32, - pub p_wait_semaphore_values: *const u64, + pub p_wait_semaphore_values: *const usize, pub signal_semaphore_values_count: u32, - pub p_signal_semaphore_values: *const u64, + pub p_signal_semaphore_values: *const usize, } impl ::std::default::Default for D3D12FenceSubmitInfoKHR { #[inline] @@ -17885,13 +17885,13 @@ } impl<'a> D3D12FenceSubmitInfoKHRBuilder<'a> { #[inline] - pub fn wait_semaphore_values(mut self, wait_semaphore_values: &'a [u64]) -> Self { + pub fn wait_semaphore_values(mut self, wait_semaphore_values: &'a [usize]) -> Self { self.inner.wait_semaphore_values_count = wait_semaphore_values.len() as _; self.inner.p_wait_semaphore_values = wait_semaphore_values.as_ptr(); self } #[inline] - pub fn signal_semaphore_values(mut self, signal_semaphore_values: &'a [u64]) -> Self { + pub fn signal_semaphore_values(mut self, signal_semaphore_values: &'a [usize]) -> Self { self.inner.signal_semaphore_values_count = signal_semaphore_values.len() as _; self.inner.p_signal_semaphore_values = signal_semaphore_values.as_ptr(); self @@ -31092,9 +31092,9 @@ pub s_type: StructureType, pub p_next: *const c_void, pub wait_semaphore_value_count: u32, - pub p_wait_semaphore_values: *const u64, + pub p_wait_semaphore_values: *const usize, pub signal_semaphore_value_count: u32, - pub p_signal_semaphore_values: *const u64, + pub p_signal_semaphore_values: *const usize, } impl ::std::default::Default for TimelineSemaphoreSubmitInfo { #[inline] @@ -31170,7 +31170,7 @@ pub flags: SemaphoreWaitFlags, pub semaphore_count: u32, pub p_semaphores: *const Semaphore, - pub p_values: *const u64, + pub p_values: *const usize, } impl ::std::default::Default for SemaphoreWaitInfo { #[inline] --- firefox-122.0.1/third_party/rust/ash/src/vk/features.rs.vanilla 2024-02-19 23:44:56.823721072 +0100 +++ firefox-122.0.1/third_party/rust/ash/src/vk/features.rs 2024-02-19 23:45:37.183717184 +0100 @@ -4484,7 +4484,7 @@ unsafe extern "system" fn get_semaphore_counter_value( _device: Device, _semaphore: Semaphore, - _p_value: *mut u64, + _p_value: *mut usize, ) -> Result { panic!(concat!( "Unable to load ", --- firefox-122.0.1/third_party/rust/ash/src/vk/extensions.rs.vanilla 2024-02-19 23:38:03.967760853 +0100 +++ firefox-122.0.1/third_party/rust/ash/src/vk/extensions.rs 2024-02-19 23:44:29.253723729 +0100 @@ -12496,7 +12496,7 @@ } #[allow(non_camel_case_types)] pub type PFN_vkGetSemaphoreCounterValue = - unsafe extern "system" fn(device: Device, semaphore: Semaphore, p_value: *mut u64) -> Result; + unsafe extern "system" fn(device: Device, semaphore: Semaphore, p_value: *mut usize) -> Result; #[allow(non_camel_case_types)] pub type PFN_vkWaitSemaphores = unsafe extern "system" fn( device: Device, @@ -12524,7 +12524,7 @@ unsafe extern "system" fn get_semaphore_counter_value_khr( _device: Device, _semaphore: Semaphore, - _p_value: *mut u64, + _p_value: *mut usize, ) -> Result { panic!(concat!( "Unable to load ", --- firefox-124.0/gfx/wgpu_bindings/src/server.rs.vanilla 2024-03-19 10:40:03.807887783 +0100 +++ firefox-124.0/gfx/wgpu_bindings/src/server.rs 2024-03-19 10:41:47.314882569 +0100 @@ -1128,7 +1128,7 @@ command_buffer_ids: *const id::CommandBufferId, command_buffer_id_length: usize, mut error_buf: ErrorBuffer, -) -> u64 { +) -> usize { let command_buffers = slice::from_raw_parts(command_buffer_ids, command_buffer_id_length); let result = gfx_select!(self_id => global.queue_submit(self_id, command_buffers));