mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 17:19:11 +01:00
[spv-in] emit the cast expression for builtin signness
This commit is contained in:
1 parent
dd1d9fe290
commit
bb29f8e142
1 file changed
+7
-2
@@ -212,11 +212,16 @@ impl<I: Iterator<Item = u32>> super::Parser<I> {
|
||||
} else {
|
||||
// The only case where the type is different is if we need to treat
|
||||
// unsigned integer as signed.
|
||||
function.expressions.append(crate::Expression::As {
|
||||
let old_len = function.expressions.len();
|
||||
let handle = function.expressions.append(crate::Expression::As {
|
||||
expr: arg_expr,
|
||||
kind: crate::ScalarKind::Sint,
|
||||
convert: true,
|
||||
})
|
||||
});
|
||||
function.body.push(crate::Statement::Emit(
|
||||
function.expressions.range_from(old_len),
|
||||
));
|
||||
handle
|
||||
};
|
||||
function.body.push(crate::Statement::Store {
|
||||
pointer: function
|
||||
|
||||
Reference in new issue
Block a user