File tree Expand file tree Collapse file tree
jme3-core/src/main/java/com/jme3/renderer/opengl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2009-2021 jMonkeyEngine
2+ * Copyright (c) 2009-2023 jMonkeyEngine
33 * All rights reserved.
44 *
55 * Redistribution and use in source and binary forms, with or without
@@ -2922,13 +2922,16 @@ public void clearVertexAttribs() {
29222922 for (int i = 0 ; i < attribList .oldLen ; i ++) {
29232923 int idx = attribList .oldList [i ];
29242924 gl .glDisableVertexAttribArray (idx );
2925- VertexBuffer buffer = context .boundAttribs [idx ].get ();
2926- if (buffer != null && buffer .isInstanced ()) {
2927- glext .glVertexAttribDivisorARB (idx , 0 );
2925+ WeakReference <VertexBuffer > ref = context .boundAttribs [idx ];
2926+ if (ref != null ) {
2927+ VertexBuffer buffer = ref .get ();
2928+ if (buffer != null && buffer .isInstanced ()) {
2929+ glext .glVertexAttribDivisorARB (idx , 0 );
2930+ }
2931+ context .boundAttribs [idx ] = null ;
29282932 }
2929- context .boundAttribs [idx ] = null ;
29302933 }
2931- context . attribIndexList .copyNewToOld ();
2934+ attribList .copyNewToOld ();
29322935 }
29332936
29342937 public void setVertexAttrib (VertexBuffer vb , VertexBuffer idb ) {
You can’t perform that action at this time.
0 commit comments