File tree 1 file changed +9
-6
lines changed
jme3-core/src/main/java/com/jme3/renderer/opengl
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2009-2021 jMonkeyEngine
2
+ * Copyright (c) 2009-2023 jMonkeyEngine
3
3
* All rights reserved.
4
4
*
5
5
* Redistribution and use in source and binary forms, with or without
@@ -2922,13 +2922,16 @@ public void clearVertexAttribs() {
2922
2922
for (int i = 0 ; i < attribList .oldLen ; i ++) {
2923
2923
int idx = attribList .oldList [i ];
2924
2924
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 ;
2928
2932
}
2929
- context .boundAttribs [idx ] = null ;
2930
2933
}
2931
- context . attribIndexList .copyNewToOld ();
2934
+ attribList .copyNewToOld ();
2932
2935
}
2933
2936
2934
2937
public void setVertexAttrib (VertexBuffer vb , VertexBuffer idb ) {
You can’t perform that action at this time.
0 commit comments