From 979a62cafdd31ca18552d1e688ca1019e6e95c1e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 5 Nov 2023 07:19:40 -0500 Subject: webgpu wip stuff --- chickadee.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'chickadee.scm') diff --git a/chickadee.scm b/chickadee.scm index 8343a6b..289bc4d 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -313,7 +313,10 @@ border is disabled, otherwise it is enabled.") (orthographic-projection 0 window-width window-height 0 0 1))) - (gpu (make-gpu (unwrap-window window) (window-gl-context window)))) + (adapter (make-gpu-adapter)) + (device (gpu-adapter-request-device adapter + (unwrap-window window) + (window-gl-context window)))) (define (invert-y y) ;; SDL's origin is the top-left, but our origin is the bottom ;; left so we need to invert Y coordinates that SDL gives us. @@ -421,7 +424,7 @@ border is disabled, otherwise it is enabled.") ;; This is where all user code is executed. (define (game-loop) (parameterize ((current-window window) - (current-gpu gpu)) + (current-gpu-device device)) (run-game* #:init load #:update update #:render draw @@ -442,10 +445,10 @@ border is disabled, otherwise it is enabled.") ;; (clear-viewport) ;; (with-graphics-state ((projection (vector-ref default-projection 0))) ;; (draw alpha))) - (gpu-tick gpu) - (gpu-swap gpu) + (gpu-device-tick device) + (gpu-device-swap device) ;; Free any GPU resources that have been GC'd. - (gpu-gc gpu) + (gpu-device-gc device) (usleep 1) ; don't use 100% of the cpu pls (main-loop)) ;; Attempt to activate vsync, if possible. Some systems do -- cgit v1.2.3