Skip to content

Commit

Permalink
Added texture r/w without var() call.
Browse files Browse the repository at this point in the history
  • Loading branch information
entropylost committed Sep 21, 2023
1 parent ca2e50a commit 35465f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions luisa_compute/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,12 @@ impl<T: IoTexel> Tex2d<T> {
pub fn format(&self) -> PixelFormat {
self.handle.format
}
pub fn read(&self, uv: impl Into<Expr<Uint2>>) -> Expr<T> {
self.var().read(uv)
}
pub fn write(&self, uv: impl Into<Expr<Uint2>>, v: impl Into<Expr<T>>) {
self.var().write(uv, v)
}
}
impl<T: IoTexel> Tex3d<T> {
pub fn view(&self, level: u32) -> Tex3dView<T> {
Expand All @@ -1294,6 +1300,12 @@ impl<T: IoTexel> Tex3d<T> {
pub fn format(&self) -> PixelFormat {
self.handle.format
}
pub fn read(&self, uv: impl Into<Expr<Uint3>>) -> Expr<T> {
self.var().read(uv)
}
pub fn write(&self, uv: impl Into<Expr<Uint3>>, v: impl Into<Expr<T>>) {
self.var().write(uv, v)
}
}
#[derive(Clone)]
pub struct BufferVar<T: Value> {
Expand Down

0 comments on commit 35465f0

Please sign in to comment.