Skip to content
Snippets Groups Projects

Misc. GPU improvements

Merged rarbore2 requested to merge edge_gpu into main
2 files
+ 29
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 20
0
@@ -795,6 +795,26 @@ impl<'a, 'b> FunctionEdit<'a, 'b> {
self.add_constant(constant_to_construct)
}
pub fn add_pos_inf_constant(&mut self, id: TypeID) -> ConstantID {
let ty = self.get_type(id).clone();
let constant_to_construct = match ty {
Type::Float32 => Constant::Float32(ordered_float::OrderedFloat(f32::INFINITY)),
Type::Float64 => Constant::Float64(ordered_float::OrderedFloat(f64::INFINITY)),
_ => panic!(),
};
self.add_constant(constant_to_construct)
}
pub fn add_neg_inf_constant(&mut self, id: TypeID) -> ConstantID {
let ty = self.get_type(id).clone();
let constant_to_construct = match ty {
Type::Float32 => Constant::Float32(ordered_float::OrderedFloat(f32::NEG_INFINITY)),
Type::Float64 => Constant::Float64(ordered_float::OrderedFloat(f64::NEG_INFINITY)),
_ => panic!(),
};
self.add_constant(constant_to_construct)
}
pub fn get_constant(&self, id: ConstantID) -> impl Deref<Target = Constant> + '_ {
if id.idx() < self.editor.constants.borrow().len() {
Either::Left(Ref::map(self.editor.constants.borrow(), |constants| {
Loading