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

fixes for reported gl errors

ncannasse 8 жил өмнө
parent
commit
a28fcf2087

+ 2 - 0
h3d/impl/GlDriver.hx

@@ -143,6 +143,7 @@ class GlDriver extends Driver {
 			gl.bindVertexArray( commonVA );
 			gl.bindVertexArray( commonVA );
 		}
 		}
 
 
+
 		var reg = ~/[0-9]+\.[0-9]+/;
 		var reg = ~/[0-9]+\.[0-9]+/;
 		var v : String = gl.getParameter(GL.SHADING_LANGUAGE_VERSION);
 		var v : String = gl.getParameter(GL.SHADING_LANGUAGE_VERSION);
 		if( v.indexOf("ES") < 0 &&reg.match(v) )
 		if( v.indexOf("ES") < 0 &&reg.match(v) )
@@ -150,6 +151,7 @@ class GlDriver extends Driver {
 
 
 		gl.pixelStorei(GL.PACK_ALIGNMENT, 1);
 		gl.pixelStorei(GL.PACK_ALIGNMENT, 1);
 		gl.pixelStorei(GL.UNPACK_ALIGNMENT, 1);
 		gl.pixelStorei(GL.UNPACK_ALIGNMENT, 1);
+		gl.finish(); // prevent glError() on first bufferData
 		#end
 		#end
 	}
 	}
 
 

+ 3 - 0
hxsl/GlslOut.hx

@@ -112,6 +112,8 @@ class GlslOut {
 			switch( size ) {
 			switch( size ) {
 			case SVar(v):
 			case SVar(v):
 				ident(v);
 				ident(v);
+			case SConst(1):
+				add(2); // intel HD driver fix
 			case SConst(v):
 			case SConst(v):
 				add(v);
 				add(v);
 			}
 			}
@@ -129,6 +131,7 @@ class GlslOut {
 			add("[");
 			add("[");
 			switch( size ) {
 			switch( size ) {
 			case SVar(v): ident(v);
 			case SVar(v): ident(v);
+			case SConst(1): add(2); // intel HD driver fix
 			case SConst(n): add(n);
 			case SConst(n): add(n);
 			}
 			}
 			add("]");
 			add("]");