瀏覽代碼

fixed clear depth/stencil when no render target depth

ncannasse 7 年之前
父節點
當前提交
5ede0caa08
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      h3d/impl/DirectXDriver.hx

+ 1 - 1
h3d/impl/DirectXDriver.hx

@@ -206,7 +206,7 @@ class DirectXDriver extends h3d.impl.Driver {
 			for( i in 0...targetsCount )
 				Driver.clearColor(currentTargets[i], color.r, color.g, color.b, color.a);
 		}
-		if( depth != null || stencil != null )
+		if( currentDepth != null && (depth != null || stencil != null) )
 			Driver.clearDepthStencilView(currentDepth.view, depth, stencil);
 	}