diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index b45d53cc23..457bc20028 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -1,9 +1,8 @@ use alloc::{ borrow::ToOwned, format, string::String, string::ToString as _, sync::Arc, vec, vec::Vec, }; -use core::{cmp::max, convert::TryInto, num::NonZeroU32, ptr, sync::atomic::Ordering}; - use arrayvec::ArrayVec; +use core::{cmp::max, convert::TryInto, num::NonZeroU32, ptr, sync::atomic::Ordering}; use glow::HasContext; use naga::FastHashMap; @@ -319,6 +318,11 @@ impl super::Device { shader_id: stage.module.id, entry_point: stage.entry_point.to_owned(), zero_initialize_workgroup_memory: stage.zero_initialize_workgroup_memory, + constant_hash: stage + .constants + .iter() + .map(|(key, value)| format!("{key}:{value}")) + .collect(), }); } let mut guard = self diff --git a/wgpu-hal/src/gles/mod.rs b/wgpu-hal/src/gles/mod.rs index b56a851e39..0a9b41980f 100644 --- a/wgpu-hal/src/gles/mod.rs +++ b/wgpu-hal/src/gles/mod.rs @@ -705,6 +705,7 @@ struct ProgramStage { shader_id: ShaderId, entry_point: String, zero_initialize_workgroup_memory: bool, + constant_hash: String, } #[derive(PartialEq, Eq, Hash)]