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

don't use setTarget in clear() if texture is 1x1 - prevent target switch during realloc, close #723

Nicolas Cannasse 5 жил өмнө
parent
commit
7dda3371bf
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      h3d/mat/Texture.hx

+ 3 - 3
h3d/mat/Texture.hx

@@ -50,9 +50,9 @@ class Texture {
 		If set to null, depth testing is disabled.
 	**/
 	public var depthBuffer : DepthBuffer;
-	
+
 	var _lastFrame:Int;
-	
+
 	function set_lastFrame(lf:Int) {
 		// Make sure we do not override lastFrame of textures set to prevent auto dispose
 		if(_lastFrame != PREVENT_AUTO_DISPOSE) {
@@ -218,7 +218,7 @@ class Texture {
 
 	public function clear( color : Int, alpha = 1., ?layer = -1 ) {
 		alloc();
-		if( flags.has(Target) #if (usegl || hlsdl || js) || true #end ) {
+		if( #if (usegl || hlsdl || js) true #else flags.has(Target) #end && (width != 1 || height != 1) ) {
 			var engine = h3d.Engine.getCurrent();
 			color |= Std.int(hxd.Math.clamp(alpha)*255) << 24;
 			if( layer < 0 ) {