-
Notifications
You must be signed in to change notification settings - Fork 0
/
vulkan-app.scm
executable file
·64 lines (46 loc) · 1.45 KB
/
vulkan-app.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /usr/bin/scheme
(library-directories '("./thunderchez" "."))
(import (chezscheme)
(vulkan)
(matchable))
;; (define (print-stack-trace e)
;; (define (get-func c)
;; (let ((cc ((c 'code) 'name)))
;; (if cc cc "--main--")))
;; (display-condition e) (newline)
;; (let p ((t (inspect/object (condition-continuation e))))
;; (call/cc
;; (lambda (ret)
;; (if (> (t 'depth) 1)
;; (begin
;; (call-with-values
;; (lambda () (t 'source-path))
;; (case-lambda
;; ((file line column)
;; (printf "\tat ~a (~a:~a,~a)\n" (get-func t) file line column))
;; (else (ret))))
;; (p (t 'link)))))))
;; (exit))
;; (base-exception-handler print-stack-trace)
(define state (setup-vulkan))
(define shaders (make-shaders "shaders/shader.vert" "shaders/shader.frag"))
(define p (create-pipeline-from-model state
shaders
"models/cube.obj"))
(define vertex-input-metadata (car p))
(define pipeline (cdr p))
(define buffers (create-buffers state
vertex-input-metadata
pipeline))
(define uniform-buffers (car buffers))
(define command-buffers (cdr buffers))
(run-draw-loop state uniform-buffers command-buffers)
;; (let ((state (setup-vulkan))
;; (shaders ))
;; (match-let* (((vertex-input-metadata . pipeline)
;; )
;; ((uniform-buffers . command-buffers) ))
;; ))
;; (parameterize ([optimize-level 3]
;; [debug-level 0])
;; (compile-library "app.scm"))