[spv-in] treat Grad on depth textures as level 0

This commit is contained in:
Dzmitry Malyshau
2021-08-15 22:21:52 -04:00
committed by Dzmitry Malyshau
parent 0d829d6bb0
commit 2dfcb7fcf0

View File

@@ -462,9 +462,18 @@ impl<I: Iterator<Item = u32>> super::Parser<I> {
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,
level = if options.compare {
log::debug!(
"Assuming gradients {:?} and {:?} are not greater than 1",
grad_x_handle,
grad_y_handle
);
crate::SampleLevel::Zero
} else {
crate::SampleLevel::Gradient {
x: grad_x_handle,
y: grad_y_handle,
}
};
words_left -= 2;
}