Files
jak-project/goal_src/engine/debug/memory-usage-h.gc
T
water111 1898c7c52a [decomp] texture (#684)
* temp

* more cleanup

* fix merge issue

* handle no texture correctly
2021-07-09 22:20:37 -04:00

51 lines
1.3 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: memory-usage-h.gc
;; name in dgo: memory-usage-h
;; dgos: GAME, ENGINE
(deftype memory-usage-info (structure)
((name string :offset-assert 0)
(count int32 :offset-assert 4)
(used int32 :offset-assert 8)
(total int32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype memory-usage-block (basic)
((work-bsp basic :offset-assert 4)
(length int32 :offset-assert 8)
(data memory-usage-info 109 :inline :offset-assert 16) ;; guess
)
:method-count-assert 12
:size-assert #x6e0
:flag-assert #xc000006e0
(:methods
(reset! (_type_) _type_ 9)
(calculate-total (_type_) int 10)
(print-mem-usage (_type_ level object) none 11)
)
)
(define *mem-usage* (new 'debug 'memory-usage-block))
(define *dma-mem-usage* (new 'debug 'memory-usage-block))
(define *temp-mem-usage* (the-as memory-usage-block #f))
;; Memory usage stats are organized by the type of object.
;; This enum allows you to go from type to the index in the memory-usage-block's data array.
(defenum mem-usage-id
:bitfield #f
:type uint32
(texture 79)
)
;; get a memory usage id as an integer.
(defmacro mem-usage-id-int (kind)
`(the int (mem-usage-id ,kind))
)