;;-*-Lisp-*-
(in-package goal)

;; name: texture-upload.gc
;; name in dgo: texture-upload
;; dgos: ART, GAME

#|@file
this file is loaded immediately before boot textures are loaded.
|#

;; DECOMP BEGINS

(define *generic-envmap-texture* (get-texture pal-environment-front environment-generic))

(define *default-envmap-shader* (new 'global 'adgif-shader))

(let ((gp-0 *default-envmap-shader*))
  (let ((a1-1 *generic-envmap-texture*))
    (adgif-shader<-texture! gp-0 a1-1)
    )
  (set! (-> gp-0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
  (set! (-> gp-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
  (set! (-> gp-0 alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1))
  (set! (-> gp-0 prims 1) (gs-reg64 tex0-1))
  (set! (-> gp-0 prims 3) (gs-reg64 tex1-1))
  (set! (-> gp-0 prims 5) (gs-reg64 miptbp1-1))
  (set! (-> gp-0 clamp-reg) (gs-reg64 clamp-1))
  (set! (-> gp-0 prims 9) (gs-reg64 alpha-1))
  )

(set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate)

(kmemopen global "tpages")
