From 29a4b033ef32b017ed06fd040a2185fadcad02c5 Mon Sep 17 00:00:00 2001 From: Xiaochun Tong Date: Tue, 21 Nov 2023 06:31:31 -0500 Subject: [PATCH] add fn expr(&self) for Var for consistency --- luisa_compute/src/lang/types.rs | 4 ++++ luisa_compute_sys/LuisaCompute | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/luisa_compute/src/lang/types.rs b/luisa_compute/src/lang/types.rs index 463ad61..15de9c9 100644 --- a/luisa_compute/src/lang/types.rs +++ b/luisa_compute/src/lang/types.rs @@ -337,6 +337,10 @@ impl Var { let node = __current_scope(|b| b.call(Func::Load, &[self_node], T::type_())); Expr::::from_node(node.into()) } + /// Converts this `Var` into an `Expr` by loading + pub fn expr(self) -> Expr { + self.load() + } pub fn store(&self, value: impl AsExpr) { crate::lang::_store(self, &value.as_expr()); } diff --git a/luisa_compute_sys/LuisaCompute b/luisa_compute_sys/LuisaCompute index c5016f8..ea04b92 160000 --- a/luisa_compute_sys/LuisaCompute +++ b/luisa_compute_sys/LuisaCompute @@ -1 +1 @@ -Subproject commit c5016f87f28e7d42fa368bcab636bd23514eaa44 +Subproject commit ea04b924b4686850d1100358685ee592744c7163