ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow...

29

Transcript of ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow...

Page 1: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background
Page 2: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

ADVANCED RENDERING EFFECTS USING OPENCLTM AND APUSession 2117Olivier ZegdounAMDSr. Software Engineer

Page 3: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

3 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

CONTENTS

Rendering Effects

Before Fusion: single discrete GPU case

Before Fusion: multiple discrete GPU case

With Fusion: APU + discrete GPU

User Interface case

Scene and Environment case

Page 4: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

4 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

RENDERING EFFECTS

Page 5: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

5 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

GRAPHIC ENGINE FREQUENT CASE

Distinct rendering tasks that:– Do not share resources (texture/geometry)– Have different update frequency / refresh rate– Have different priorities (when it is ok to skip a few frames for the benefit of the other task)

Typical example is User Interface on top of a content creation package, or animated environment scene (clouds, water, trees,…)

Page 6: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

6 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

OFF-SCREEN RENDERING AND COMPOSITION

Render targets are your best friend– Framebuffer Object (FBO) / RenderTargets– Specific size/format according to need

Open the door to many special effects– Shadow (map, SSAO,…)– Animated/distorted reflection (water/glass)– Overlay/Background– PostProcess (blurring, grayscale)

Allow optimization in the engine– Layer cache

Page 7: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

7 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

RENDER TARGETS AND COMPOSITION

Page 8: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

8 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

SINGLE GPU BEFORE FUSION

Page 9: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

9 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

SINGLE GPU CASE

Single thread:– Time slice only works if workload is predictable (UI is not)– One rendering task will stall the other

Multithreading:– Create 2 threads with their own OpenGL contexts : bad performance if shared– Only 1 thread owns OpenGL means only data, no rendering in other thread : hard to sync– 2 threads with only 1 OpenGL context and switch current : not ideal

Bottom line: a single GPU doesn’t like to be shared!

Page 10: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

10 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

MULTI GPU BEFORE FUSION

Page 11: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

11 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

MULTI – DISCRETE GPU

AMD CrossFireTM / SLI

Deployment– Power– Heat– Space– Cost– Better with identical cards

Page 12: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

12 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

MULTI – DISCRETE GPU

Workload Balancing– No fine control– GPU Affinity (WGL_AMD_gpu_association)– Brute force

Alternate Frame Rendering

Split Frame Rendering

Tiled Rendering

Page 13: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

13 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

MULTI – DISCRETE GPU

Resource Balancing– 2x, 3x or 4x 1GB cards,

still only 1GB VRAM available– Textures– Geometry– Even with affinity: no sharing possible

without slow copy

Page 14: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

14 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

APU + DISCRETE GPU

Page 15: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

15 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

APU + DISCRETE GPU

Fusion advantage

Deployment– Low Power– No Extra Heat– Space– Cost

Page 16: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

16 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

APU + DISCRETE GPU

Workload Balancing– Fine control through OpenCLTM

– Delegate specific tasks to the APUBackground Layer

Overlay Layer

Color buffer

Color + Depth buffer

– Composition on the discrete GPUBlending

Depth testing

Page 17: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

17 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

APU + DISCRETE GPU

Resource Balancing– Only load resources for the task at hand– Textures– Geometry (scene)– Fast sharing through Pinned memory

Page 18: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

18 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

SHARING LAYERS THROUGH PINNED MEMORY

APU (write) GPU (read)

Page 19: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

19 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

USER INTERFACE

Page 20: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

20 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

DEDICATED UI THREAD ON THE APU

MouseKeyboardTouch

User Events

Process EventsLogic

Page 21: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

21 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

CUSTOM USER INTERFACE

APUProcessing User Input logicRendering UI on layerCan be Animated: free for actual

GPURendering actualBlending UI result

Page 22: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

22 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

RENDERING UI INSIDE THE SCENE

Resulting texture interleaved– Immersive feeling– Cool user experience– Better relate to context

Page 23: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

23 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

SCENE AND ENVIRONMENT

Page 24: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

24 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

SCENE & ENVIRONMENT

APURendering particles effectRendering 3D scene

GPURendering actualDepth compositionBlending overlay

Page 25: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

25 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

ANIMATED ENVIRONMENT

Floor pad, surrounding

Page 26: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

26 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

CONCLUSION

Page 27: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

27 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

FINAL THOUGHTS

These are not new techniques but…– Hard to budget with only one GPU– Priority to content / user experience

APU opportunity:– Extra horsepower– Architecture allowing optimized resource access/zero copy

Page 28: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

QUESTIONS

Page 29: ADVANCED RENDERING EFFECTSdeveloper.amd.com/wordpress/media/2013/06/2117_final.pdf · – Shadow (map, SSAO,…) – Animated/distorted reflection (water/glass) – Overlay/Background

29 | Advanced Rendering Effects Using OpenCLTM and APU | June 2011

Disclaimer & AttributionThe information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors.

The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limitedto product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. There is no obligation to update or otherwise correct or revise this information. However, we reserve the right to revise this information and to make changes from time to time to the content hereof without obligation to notify any person of such revisions or changes.

NO REPRESENTATIONS OR WARRANTIES ARE MADE WITH RESPECT TO THE CONTENTS HEREOF AND NO RESPONSIBILITY IS ASSUMED FOR ANY INACCURACIES, ERRORS OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION.

ALL IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. IN NO EVENT WILL ANY LIABILITY TO ANY PERSON BE INCURRED FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

AMD, AMD Crossfire, the AMD arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. All other names used in this presentation are for informational purposes only and may be trademarks of their respective owners.

OpenCL is a trademark of Apple Inc. used with permission by Khronos.

© 2011 Advanced Micro Devices, Inc. All rights reserved.