diff options
author | David Thompson <dthompson2@worcester.edu> | 2020-10-01 08:14:10 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2020-10-01 08:14:36 -0400 |
commit | 6d7ccaff8777345dfc7387c36c575548f1e44658 (patch) | |
tree | 0694167fcce81f1f91756e24b2a98d3b2ff7db6f | |
parent | 969ca17ca4439ba4e16e3d1b54794e12b5fe09e7 (diff) |
render: gpu: Lookup max texture size.
-rw-r--r-- | chickadee/render/gl.scm | 3 | ||||
-rw-r--r-- | chickadee/render/gpu.scm | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/chickadee/render/gl.scm b/chickadee/render/gl.scm index 0781048..06c20e7 100644 --- a/chickadee/render/gl.scm +++ b/chickadee/render/gl.scm @@ -305,7 +305,8 @@ object.") ;;; Context Queries ;;; -(re-export (%glGetString . gl-get-string)) +(re-export (%glGetString . gl-get-string) + (%glGetIntegerv . gl-get-integer-v)) ;;; diff --git a/chickadee/render/gpu.scm b/chickadee/render/gpu.scm index e01486d..8921062 100644 --- a/chickadee/render/gpu.scm +++ b/chickadee/render/gpu.scm @@ -35,6 +35,7 @@ gpu-gl-context gpu-gl-version gpu-glsl-version + gpu-max-texture-size gpu-blend-mode gpu-depth-test gpu-stencil-test @@ -100,6 +101,7 @@ from the GPU's memory." (%make-gpu gl-context gl-version glsl-version + max-texture-size blend-mode depth-test stencil-test @@ -113,6 +115,7 @@ from the GPU's memory." (gl-context gpu-gl-context) (gl-version gpu-gl-version) (glsl-version gpu-glsl-version) + (max-texture-size gpu-max-texture-size) (blend-mode %gpu-blend-mode) (depth-test %gpu-depth-test) (stencil-test %gpu-stencil-test) @@ -125,6 +128,12 @@ from the GPU's memory." (define current-gpu (make-parameter #f)) +(define (max-texture-size) + (let ((bv (make-s32vector 1))) + (gl-get-integer-v (get-p-name max-texture-size) + (bytevector->pointer bv)) + (s32vector-ref bv 0))) + (define (make-gpu gl-context) (define (extract-version attr) (car (string-split (pointer->string (gl-get-string attr)) #\space))) @@ -152,6 +161,7 @@ from the GPU's memory." (%make-gpu gl-context gl-version glsl-version + (max-texture-size) (make-gpu-state (module-ref blend-module 'apply-blend-mode) 'replace) (make-gpu-state (module-ref depth-module 'apply-depth-test) #f) |