浏览代码

fixed clear() when no render target

Nicolas Cannasse 1 年之前
父节点
当前提交
09d248ae2b
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      h3d/impl/DX12Driver.hx

+ 3 - 0
h3d/impl/DX12Driver.hx

@@ -485,6 +485,9 @@ class DX12Driver extends h3d.impl.Driver {
 				}
 				frame.commandList.clearRenderTargetView(tmp.renderTargets[i], clear);
 			}
+			// clear backbuffer
+			if( count == 0 )
+				frame.commandList.clearRenderTargetView(tmp.renderTargets[0], clear);
 		}
 		if( depth != null || stencil != null )
 			frame.commandList.clearDepthStencilView(tmp.depthStencils[0], depth != null ? (stencil != null ? BOTH : DEPTH) : STENCIL, (depth:Float), stencil);