Explorar o código

disable gpu timeout by default in hl 1.12+

Nicolas Cannasse %!s(int64=5) %!d(string=hai) anos
pai
achega
fd7a30fb69
Modificáronse 1 ficheiros con 12 adicións e 6 borrados
  1. 12 6
      h3d/impl/DirectXDriver.hx

+ 12 - 6
h3d/impl/DirectXDriver.hx

@@ -129,6 +129,17 @@ class DirectXDriver extends h3d.impl.Driver {
 		reset();
 	}
 
+	public dynamic function getDriverFlags() : dx.Driver.DriverInitFlags {
+		var options : dx.Driver.DriverInitFlags = None;
+		#if debug
+		options |= DebugLayer;
+		#end
+		#if (hl_ver >= version("1.12.0"))
+		options |= DisableGpuTimeout;
+		#end
+		return options;
+	}
+
 	function reset() {
 		allowDraw = false;
 		targetsCount = 1;
@@ -154,13 +165,8 @@ class DirectXDriver extends h3d.impl.Driver {
 		vertexShader = new PipelineState(Vertex);
 		pixelShader = new PipelineState(Pixel);
 
-		var options : dx.Driver.DriverInitFlags = None;
-		#if debug
-		options |= DebugLayer;
-		#end
-
 		try
-			driver = Driver.create(window, backBufferFormat, options)
+			driver = Driver.create(window, backBufferFormat, getDriverFlags())
 		catch( e : Dynamic )
 			throw "Failed to initialize DirectX driver (" + e + ")";