Skip to content

Commit

Permalink
rtx fix, filers zero size dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
shiinamiyuki committed Dec 13, 2023
1 parent 04c3e79 commit ebff783
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion luisa_compute/src/rtx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl SurfaceHitExpr {
self.inst.ne(u32::MAX)
}
pub fn miss(&self) -> Expr<bool> {
self.prim.eq(u32::MAX)
self.inst.eq(u32::MAX)
}
pub fn is_curve(&self) -> Expr<bool> {
self.bary.y.lt(0.0)
Expand Down
10 changes: 9 additions & 1 deletion luisa_compute/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,15 @@ impl<'a> Scope<'a> {
callback: F,
) {
self.synchronized.set(false);
let api_commands = commands.iter().map(|c| c.inner).collect::<Vec<_>>();
let api_commands = commands
.iter()
.map(|c| c.inner)
.filter(|c| match c {
// filters zero-size dispatches
api::Command::ShaderDispatch(c) => c.dispatch_size.iter().all(|&s| s > 0),
_ => true,
})
.collect::<Vec<_>>();
let ctx = CommandCallbackCtx {
commands,
f: callback,
Expand Down

0 comments on commit ebff783

Please sign in to comment.