Skip to content

Commit

Permalink
Make sure to rebind buffer to program when setting slot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Sep 18, 2024
1 parent f960a05 commit 18d48e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shader-entity.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,10 @@ void main(){
(unless (slot-boundp entity 'shader-program)
(setf (shader-program entity) (make-shader-program entity))))

(defmethod (setf c2mop:slot-value-using-class) :after (value (class shader-entity-class) (entity standalone-shader-entity) (slotd buffer-slot-definition))
(when (allocated-p (shader-program entity))
(bind value (shader-program entity))))

(defmethod stage :after ((entity standalone-shader-entity) (area staging-area))
(stage (shader-program entity) area))

Expand Down
4 changes: 4 additions & 0 deletions shader-pass.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
(setf (shaders (shader-program pass))
(shaders (make-shader-program pass)))))

(defmethod (setf c2mop:slot-value-using-class) :after (value (class shader-pass-class) (pass single-shader-pass) (slotd buffer-slot-definition))
(when (allocated-p (shader-program pass))
(bind value (shader-program pass))))

(defmethod stage ((pass single-shader-pass) (area staging-area))
(unless (slot-boundp pass 'shader-program)
(setf (shader-program pass) (make-shader-program pass)))
Expand Down

0 comments on commit 18d48e0

Please sign in to comment.