2
0
Эх сурвалжийг харах

Modified the multi-slot buffer support to work even
if the buffer is not instanced. Saw no real reason
not to and it makes buffer support more flexible.

pspeed42 11 жил өмнө
parent
commit
e76e770d17

+ 4 - 2
jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java

@@ -2226,7 +2226,6 @@ public class LwjglRenderer implements Renderer {
                 }
             }
             
-            int slotsRequired = 1;
             if (vb.isInstanced()) {
                 if (!ctxCaps.GL_ARB_instanced_arrays
                  || !ctxCaps.GL_ARB_draw_instanced) {
@@ -2234,7 +2233,10 @@ public class LwjglRenderer implements Renderer {
                             + "but not supported by the "
                             + "graphics hardware");
                 }
-                if (vb.getNumComponents() > 4 && vb.getNumComponents() % 4 != 0) {
+            }
+            int slotsRequired = 1;
+            if (vb.getNumComponents() > 4) {
+                if (vb.getNumComponents() % 4 != 0) {
                     throw new RendererException("Number of components in multi-slot "
                             + "buffers must be divisible by 4");
                 }