mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-27 01:03:41 +00:00
[glsl-new] Add float consts (#119)
This commit is contained in:
parent
747535906f
commit
745ef6a6d6
@ -163,10 +163,28 @@ pomelo! {
|
||||
}
|
||||
}
|
||||
// primary_expression ::= UintConstant;
|
||||
// primary_expression ::= FloatConstant;
|
||||
primary_expression ::= FloatConstant(f) {
|
||||
let ty = extra.types.fetch_or_append(Type {
|
||||
name: None,
|
||||
inner: TypeInner::Scalar {
|
||||
kind: ScalarKind::Float,
|
||||
width: 4,
|
||||
}
|
||||
});
|
||||
let ch = extra.constants.fetch_or_append(Constant {
|
||||
name: None,
|
||||
specialization: None,
|
||||
ty,
|
||||
inner: ConstantInner::Float(f.1 as f64)
|
||||
});
|
||||
ExpressionRule {
|
||||
expression: extra.context.expressions.append(Expression::Constant(ch)),
|
||||
statements: vec![],
|
||||
}
|
||||
}
|
||||
// primary_expression ::= BoolConstant;
|
||||
// primary_expression ::= DoubleConstant;
|
||||
// primary_expression ::= LeftParen expression RightParen;
|
||||
primary_expression ::= LeftParen expression(e) RightParen {e}
|
||||
|
||||
postfix_expression ::= primary_expression;
|
||||
postfix_expression ::= postfix_expression LeftBracket integer_expression RightBracket {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#version 450 core
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(1);
|
||||
gl_Position = vec4(1.0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user