Merge pull request #634 from SAitken91/shader/image-sample-o
Shaders: image_sample_o with constant offsets
This commit is contained in:
commit
cf63d91ac3
2 files changed
+31
-1
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user