|
|
|
@ -22,15 +22,15 @@ fn test_parse() {
|
|
|
|
|
let src = "
|
|
|
|
|
(module Shader Logical GLSL450)
|
|
|
|
|
(import :std GLSL.std.450)
|
|
|
|
|
(bind (frag-coord:*vec4fi) (Builtin FragCoord))
|
|
|
|
|
(bind (out-color:*vec4fo) (Location 0))
|
|
|
|
|
(dec frag-coord:*vec4fi Input)
|
|
|
|
|
(dec out-color:*vec4fo Output)
|
|
|
|
|
(bind (frag-coord:*v4fi) (Builtin FragCoord))
|
|
|
|
|
(bind (out-color:*v4fo) (Location 0))
|
|
|
|
|
(dec frag-coord:*v4fi Input)
|
|
|
|
|
(dec out-color:*v4fo Output)
|
|
|
|
|
(entry main Fragment OriginUpperLeft (:frag-coord :out-color))
|
|
|
|
|
(fun (main)
|
|
|
|
|
(store-ptr (out-color)
|
|
|
|
|
(vec4fi (/ (.xy (load-ptr frag-coord))
|
|
|
|
|
(vec2f 1920.0 1080.0))
|
|
|
|
|
(v4fi (/ (.xy (load-ptr frag-coord))
|
|
|
|
|
(v2f 1920.0 1080.0))
|
|
|
|
|
1.0
|
|
|
|
|
1.0)))
|
|
|
|
|
";
|
|
|
|
@ -51,7 +51,7 @@ fn test_parse() {
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("bind".to_string()),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("frag-coord:*vec4fi".to_string()),
|
|
|
|
|
Ast::Symbol("frag-coord:*v4fi".to_string()),
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("Builtin".to_string()),
|
|
|
|
@ -61,7 +61,7 @@ fn test_parse() {
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("bind".to_string()),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("out-color:*vec4fo".to_string()),
|
|
|
|
|
Ast::Symbol("out-color:*v4fo".to_string()),
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("Location".to_string()),
|
|
|
|
@ -70,12 +70,12 @@ fn test_parse() {
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("dec".to_string()),
|
|
|
|
|
Ast::Symbol("frag-coord:*vec4fi".to_string()),
|
|
|
|
|
Ast::Symbol("frag-coord:*v4fi".to_string()),
|
|
|
|
|
Ast::Symbol("Input".to_string()),
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("dec".to_string()),
|
|
|
|
|
Ast::Symbol("out-color:*vec4fo".to_string()),
|
|
|
|
|
Ast::Symbol("out-color:*v4fo".to_string()),
|
|
|
|
|
Ast::Symbol("Output".to_string()),
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
@ -99,7 +99,7 @@ fn test_parse() {
|
|
|
|
|
Ast::Symbol("out-color".to_string()),
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("vec4fi".to_string()),
|
|
|
|
|
Ast::Symbol("v4fi".to_string()),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("/".to_string()),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
@ -110,7 +110,7 @@ fn test_parse() {
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
Ast::List(vec![
|
|
|
|
|
Ast::Symbol("vec2f".to_string()),
|
|
|
|
|
Ast::Symbol("v2f".to_string()),
|
|
|
|
|
Ast::Symbol("1920.0".to_string()),
|
|
|
|
|
Ast::Symbol("1080.0".to_string()),
|
|
|
|
|
]),
|
|
|
|
|