Browse Source

another fix for vertex+fragment buffer binding

Nicolas Cannasse 4 years ago
parent
commit
9c75c6adff
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/impl/GlDriver.hx

+ 1 - 1
h3d/impl/GlDriver.hx

@@ -540,7 +540,7 @@ class GlDriver extends Driver {
 		case Buffers:
 		case Buffers:
 			if( s.buffers != null ) {
 			if( s.buffers != null ) {
 				for( i in 0...s.buffers.length )
 				for( i in 0...s.buffers.length )
-					gl.bindBufferBase(GL2.UNIFORM_BUFFER, i, @:privateAccess buf.buffers[i].buffer.vbuf.b);
+					gl.bindBufferBase(GL2.UNIFORM_BUFFER, s.vertex ? i : curShader.vertex.buffers.length + i, @:privateAccess buf.buffers[i].buffer.vbuf.b);
 			}
 			}
 		case Textures:
 		case Textures:
 			var tcount = s.textures.length;
 			var tcount = s.textures.length;