Skip to content

Commit

Permalink
[spv-in] use grad image operand
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored and kvark committed Aug 10, 2021
1 parent e384bce commit 551b711
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/front/spv/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,17 @@ impl<I: Iterator<Item = u32>> super::Parser<I> {
level = crate::SampleLevel::Exact(lod_handle);
words_left -= 1;
}
spirv::ImageOperands::GRAD => {
let grad_x_expr = self.next()?;
let grad_x_handle = self.lookup_expression.lookup(grad_x_expr)?.handle;
let grad_y_expr = self.next()?;
let grad_y_handle = self.lookup_expression.lookup(grad_y_expr)?.handle;
level = crate::SampleLevel::Gradient {
x: grad_x_handle,
y: grad_y_handle,
};
words_left -= 2;
}
spirv::ImageOperands::CONST_OFFSET => {
let offset_constant = self.next()?;
let offset_handle = self.lookup_constant.lookup(offset_constant)?.handle;
Expand Down

0 comments on commit 551b711

Please sign in to comment.