From fc69687c270911c782486a2ed63deb04cfd2b554 Mon Sep 17 00:00:00 2001 From: Yukari Hafner Date: Fri, 3 Jan 2025 15:41:51 +0100 Subject: [PATCH] Minor --- gl-features.lisp | 17 ++++++++++++----- pipeline.lisp | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gl-features.lisp b/gl-features.lisp index e383a0d7..c201403c 100644 --- a/gl-features.lisp +++ b/gl-features.lisp @@ -254,9 +254,16 @@ ;; KLUDGE: this sucks. (defvar *depth-mask* T) (defmacro with-depth-mask (mode &body body) - (let ((old-mode (gensym "OLD-MODE"))) + (let ((old-mode (gensym "OLD-MODE")) + (new-mode (gensym "NEW-MODE")) + (thunk (gensym "THUNK"))) `(let ((,old-mode *depth-mask*) - (*depth-mask* ,mode)) - (gl:depth-mask *depth-mask*) - (multiple-value-prog1 (progn ,@body) - (gl:depth-mask ,old-mode))))) + (,new-mode ,mode)) + (flet ((,thunk () + ,@body)) + (if (eq ,new-mode ,old-mode) + (,thunk) + (let ((*depth-mask* ,new-mode)) + (gl:depth-mask ,new-mode) + (multiple-value-prog1 (,thunk) + (gl:depth-mask ,old-mode)))))))) diff --git a/pipeline.lisp b/pipeline.lisp index dd0d0b00..f81ad041 100644 --- a/pipeline.lisp +++ b/pipeline.lisp @@ -143,6 +143,8 @@ (setf (getf texspec :width) 'width)) (unless (getf texspec :height) (setf (getf texspec :height) 'height)) + (unless (getf texspec :depth) + (setf (getf texspec :depth) 'depth)) (unless (getf texspec :target) (setf (getf texspec :target) :texture-2d)) texspec))