Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better type suggestions #211

Open
cbaggers opened this issue Jul 11, 2018 · 0 comments
Open

Better type suggestions #211

cbaggers opened this issue Jul 11, 2018 · 0 comments
Assignees

Comments

@cbaggers
Copy link
Owner

We have this supported in some places. Fix it here too

cd /home/baggers/Code/lisp/play-with-verts/
1 compiler notes:

Unknown location:
  error:
    Execution of a form compiled with errors.
    Form:
      (DEFUN-G FXAA-PIXEL-SHADER
        ((UV :VEC4) (TEX :SAMPLER2D) (RCP-FRAME :VEC2))
      (LET* ((FXAA-SPAN-MAX 8.0)
             (FXAA-REDUCE-MUL (/ 1.0 FXAA-SPAN-MAX))
             (FXAA-REDUCE-MIN (/ 1.0 128.0))
             (FXAA-SUBPIX-SHIFT (/ 1.0 4.0))
             (RGB-NW (S~ (TEXTURE-LOD TEX (S~ UV :ZW) 0.0) :XYZ))
             (RGB-NE
              (S~
               (TEXTURE-LOD TEX (+ (S~ UV :ZW) (* (V2! 1 0) (S~ RCP-FRAME :XY)))
                0.0)
               :XYZ))
             (RGB-SW
              (S~
               (TEXTURE-LOD TEX (+ (S~ UV :ZW) (* (V2! 0 1) (S~ RCP-FRAME :XY)))
                0.0)
               :XYZ))
             (RGB-SE
              (S~
               (TEXTURE-LOD TEX (+ (S~ UV :ZW) (* (V2! 1 1) (S~ RCP-FRAME :XY)))
                0.0)
               :XYZ))
             (RGB-M (S~ (TEXTURE-LOD TEX (S~ UV :XY) 0.0) :XYZ))
             (LUMA (V3! 0.29900002 0.587 0.11400001))
             (LUMA-NW (DOT RGB-NW LUMA))
             (LUMA-NE (DOT RGB-NE LUMA))
             (LUMA-SW (DOT RGB-SW LUMA))
             (LUMA-SE (DOT RGB-SE LUMA))
             (LUMA-M (DOT RGB-M LUMA))
             (LUMA-MIN
              (MIN LUMA-M (MIN (MIN LUMA-NW LUMA-NE) (MIN LUMA-SW LUMA-SE))))
             (LUMA-MAX
              (MAX LUMA-M (MAX (MAX LUMA-NW LUMA-NE) (MAX LUMA-SW LUMA-SE))))
             ((DIR :VEC2)))
        (SETF (X DIR) (- (- (+ LUMA-NW LUMA-NE) (+ LUMA-SW LUMA-SE))))
        (SETF (Y DIR) (- (+ LUMA-NW LUMA-SW) (+ LUMA-NE LUMA-SE)))
        (LET* ((DIR-REDUCE
                (MAX
                 (* (+ LUMA-NW (+ LUMA-NE (+ LUMA-SW LUMA-SE)))
                    (* 0.25 FXAA-REDUCE-MUL))
                 FXAA-REDUCE-MIN))
               (RCP-DIR-MIN
                (/ 1.0 (+ (MIN (ABS (X DIR)) (ABS (Y DIR))) DIR-REDUCE))))
          (SETF DIR
                  (*
                   (MIN (V2! FXAA-SPAN-MAX FXAA-SPAN-MAX)
                        (MAX (V2! (- FXAA-SPAN-MAX) (- FXAA-SPAN-MAX))
                             (* DIR RCP-DIR-MIN)))
                   (S~ RCP-FRAME :XY)))
          (LET* ((RGB-A
                  (* (/ 1.0 2.0)
                     (+
                      (S~
                       (TEXTURE-LOD TEX (+ (S~ UV :XY) (* DIR (- (/ 1.0 3.0) 0.5)))
                        0.0)
                       :XYZ)
                      (S~
                       (TEXTURE-LOD TEX (+ (S~ UV :XY) (* DIR (- (/ 2.0 3.0) 0.5)))
                        0.0)
                       :XYZ))))
                 (RGB-B
                  (+ (* RGB-A (/ 1.0 2.0))
                     (* (/ 1.0 4.0)
                        (+
                         (S~
                          (TEXTURE-LOD TEX
                           (+ (S~ UV :XY) (* DIR (- (/ 0.0 3.0) 0.5))) 0.0)
                          :XYZ)
                         (S~
                          (TEXTURE-LOD TEX
                           (+ (S~ UV :XY) (* DIR (- (/ 3.0 3.0) 0.5))) 0.0)
                          :XYZ)))))
                 (LUMA-B (DOT RGB-B LUMA)))
            (WHEN (NIL (< LUMA-B LUMA-MIN) (> LUMA-B LUMA-MAX)) RGB-A)
            RGB-B))))
    Compile-time error:
      (during macroexpansion of (DEFUN-G FXAA-PIXEL-SHADER
        ...))
    Varjo: When defining the function FXAA-PIXEL-SHADER we found some args with types that
    we didnt recognise:

    > (TEX :SAMPLER2D)




fxaa.lisp:4:1:
  error:
    (during macroexpansion of (DEFUN-G FXAA-PIXEL-SHADER
        ...))
    Varjo: When defining the function FXAA-PIXEL-SHADER we found some args with types that
    we didnt recognise:

    > (TEX :SAMPLER2D)
Compilation failed.
@cbaggers cbaggers self-assigned this Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant