Merge pull request #634 from SAitken91/shader/image-sample-o

Shaders: image_sample_o with constant offsets
This commit is contained in:
Marvis authored and GitHub committed 2026-11-24 09:19:15 +01:00
commit 6f0a10a758
2 files changed
+31 -1

No files matched your search

+11
View File
@@ -291,6 +291,17 @@ impl Module {
self.constant(ty, Const::Aggregate(ids))
}
/// The value of an integer constant; `None` for anything else.
pub fn int_value(&self, v: V) -> Option<i64> {
match v {
V::Const(i) => match self.consts[i as usize].1 {
Const::Int(x) => Some(x),
_ => None,
},
_ => None,
}
}
/// Gives constant `old` the content of `new` (both stay valid).
pub fn replace_const(&mut self, old: V, new: V) {
if let (V::Const(o), V::Const(n)) = (old, new) {