查看: 394|回复: 9

[编程指南] 【AsyncCompute | Unreal Engine】

[复制链接]

1

主题

342

帖子

7万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
75866
发表于 2016-6-27 00:50:34 | 显示全部楼层 |阅读模式


Introduction
The Rendering Hardware Interface (RHI) now supports asynchronous compute (AsyncCompute) for Xbox One. This is a good way to utilize unused GPU resources (Compute Units (CUs), registers and bandwidth),by running dispatch() calls asynchronously with the rendering. Async compute uses a separate context, and we provide RHI functions tosynchronize the rendering and compute contexts.Dr PIX is useful for identifying areas which might benefit from async compute. For example, if half the CUs are unused during a particularrendering pass, those CUs could potentially be utilized by an asynchronous compute job.Async compute has some restrictions:

Buffers with UAV counters are not supported (this is a limitation of the XDK, and will generate a D3D warning)

Async compute jobs do not show up in PIX GPU captures (although they do appear in Timing Captures)PIX only captures the graphics immediate context (this is a platform limitation).

Automatic pipeline flushes are not provided by the driver. You need to explicitly call RHICSManualGpuFlush if flushes are needed(e.g. if one dispatch is dependent on the previous one)
API
RHIBeginAsyncComputeJob_DrawThread (EAsyncComputePriority Priority)Begins an async compute job from the rendering thread. The priority is used to determine the number of shader resources to allocatefor the job (via ID3D11XComputeContext::SetLimits). There are currently two priorities available, AsyncComputePriority_High andAsyncComputePriority_Default.

RHIEndAsyncComputeJob_DrawThreadEnds an async compute job. Returns a 32-bit Fence Index which can be used for synchronization, or -1 if compute is disabled orthere is no active compute job

RHIGraphicsWaitOnAsyncComputeJobInserts an command in the graphics immediate context to block until an async job is complete. Passing -1 causes this to early-out.

Between calls to RHIBeginAsyncComputeJob_DrawThread and RHIEndAsyncComputeJob_DrawThread, the RHI will be in the async compute state.During this time, supported RHI commands will be executed via the async compute context. Unsupported RHI functions will assert.
Disabling/Enabling
Async compute can be enabled or disabled at compile time with the #define USE_ASYNC_COMPUTE_CONTEXT. It can be disabled at runtimewith the r.AsyncCompute console variable. When async compute is disabled, dispatches within async compute blocks are executed synchronously onthe graphics command buffer. USE_ASYNC_COMPUTE_CONTEXT is defined to 0 on PC, since it's not supported in D3D11.1.
PIX
Async compute context jobs are not captured in GPU captures, so these captures can give a misleading picture of GPU performance whenasync compute is enabled. For graphics debugging purposes, async compute should be disabled using the above cvar.Async compute is supported by PIX timing captures. These show up in the timeline like this:

【虚幻4翻译文档-AsyncCompute | Unreal Engine】[虚幻4中文文档]


Thanks and Future
This feature was implemented by Lionhead Studios. We integrated it and indend to make use of it as a tool to optimize the XboxOne rendering.

As more more APIs expose the hardware feature we would like make the system more cross platform. Features that make use use AsyncCompute you alwaysbe able to run without (console variable / define) to run on other platforms and easier debugging and profiling. AsyncCompute should be used with cautionas it can cause more unpredicatble performance and requires more coding effort for synchromization.
回复

使用道具 举报

0

主题

851

帖子

2784

积分

vip会员

Rank: 1

积分
2784
发表于 2016-7-2 19:33:54 来自手机 | 显示全部楼层
全就行啊,,支持 一下
回复 支持 反对

使用道具 举报

0

主题

888

帖子

2933

积分

vip会员

Rank: 1

积分
2933
发表于 2016-7-3 23:34:56 来自手机 | 显示全部楼层
不错哦  下载看一下啊
回复 支持 反对

使用道具 举报

0

主题

863

帖子

2876

积分

vip会员

Rank: 1

积分
2876
发表于 2016-7-3 23:34:56 | 显示全部楼层
真是是好人啊,,过来看看
回复 支持 反对

使用道具 举报

0

主题

838

帖子

2730

积分

vip会员

Rank: 1

积分
2730
发表于 2016-7-4 11:30:56 | 显示全部楼层
这个必须可以有
回复 支持 反对

使用道具 举报

0

主题

837

帖子

2768

积分

vip会员

Rank: 1

积分
2768
发表于 2016-7-10 13:08:37 来自手机 | 显示全部楼层
真的是全套吗?
回复 支持 反对

使用道具 举报

0

主题

935

帖子

3096

积分

vip会员

Rank: 1

积分
3096
发表于 2016-7-11 07:03:33 来自手机 | 显示全部楼层
不错 可以下来研究研究
回复 支持 反对

使用道具 举报

0

主题

891

帖子

2915

积分

vip会员

Rank: 1

积分
2915
发表于 2016-7-15 07:45:42 | 显示全部楼层
支持一下,3q
回复 支持 反对

使用道具 举报

0

主题

881

帖子

2852

积分

vip会员

Rank: 1

积分
2852
发表于 2016-7-19 08:44:35 来自手机 | 显示全部楼层
不错哦  下载看一下啊
回复 支持 反对

使用道具 举报

0

主题

873

帖子

2919

积分

vip会员

Rank: 1

积分
2919
发表于 2016-7-24 12:13:33 来自手机 | 显示全部楼层
好吗
回复 支持 反对

使用道具 举报

*滑块验证:
您需要登录后才可以回帖 登录 | enginedx注册

本版积分规则

 
 



邮件留言:


 
返回顶部