Download
writing your application to shine on modern graphics hardware directx for mainstream applications n.
Skip this Video
Loading SlideShow in 5 Seconds..
Writing Your Application to Shine on Modern Graphics Hardware DirectX for mainstream applications PowerPoint Presentation
Download Presentation
Writing Your Application to Shine on Modern Graphics Hardware DirectX for mainstream applications

Writing Your Application to Shine on Modern Graphics Hardware DirectX for mainstream applications

443 Views Download Presentation
Download Presentation

Writing Your Application to Shine on Modern Graphics Hardware DirectX for mainstream applications

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. PC04 Writing Your Application to Shine on Modern Graphics Hardware DirectX for mainstream applications Anantha Kancherla Group Program Manager Microsoft Corporation

  2. Agenda • Where is Graphics Hardware headed • How does Win7 adapt to HW changes • The expanding role of DirectX in Windows 7 • Addressing new graphics scenarios and fundamentals in Windows 7 timeframe

  3. Increasing generalism. Array of SIMD ALUs • Arithmetic, flow control, read, write • Some fixed function units such as tessellation Order of magnitude difference between low and high end Courtesy: Tom’s Hardware

  4. Windows 7's Usage of the GPU • Continues from Windows Vista… • Media Center UI • Video Playback • Desktop Window Manager (DWM) • Windows 7 DWM uses Direct3D10.1 API • Scales in performance all the way from low end integrated to high end GPUs • Shaders are used for blurs in the Glass • Windows 7 cuts memory consumption is cut by 50% per window • More and richer animations of the thumbnails

  5. High DPI • High Color

  6. High DPI Displays are Common • Improvements in Windows UI & IE • Automatic configuration in OOBE • Promotion the Control Panel UI for DPI

  7. High Color • Wider Gamut • Bigger than sRGB eg. xvYCC, AdobeRGB • Higher precision • Higher Dynamic Range

  8. High Color • Wider Gamut • Bigger than sRGB eg. xvYCC, AdobeRGB • Higher precision • Higher Dynamic Range • Windows 7 Provides: • Color Calibration Tool • GammaLUT Loader

  9. Systems configurations impact Graphics • Laptop sales are now >50% of PC sales

  10. Overview of Changes in Windows 7To adapt to HW changes • Addresses ranges of GPU performance characteristics • Cuts memory consumption by 50% per window • High DPI • Number of changes in User Interface and IE • Color: • Color Calibration Wizard and LUT Loader • Laptop scenarios • Monitor hot plug detect • Now let us look at how you can take advantage of this powerful hardware…

  11. Agenda • Where is Graphics Hardware headed • How does Win7 adapt to HW changes • The expanding role of DirectX in Windows 7 • Addressing new graphics scenarios and fundamentals in Windows 7 timeframe

  12. Graphics APIs for Rich Client Applications

  13. When to use which API • DirectX: When the application needs control over features and performance • WPF: When the application needs richness but needs to be built quickly and there is no need for fine grained control over hw performance and features • GDI: When the application needs to work on all Microsoft OSs and the lowest common denominator functionality is sufficient Increasing HW Exploitiveness

  14. DirectX Evolution • Originally designed for Games and to abstract HW • DX9 introduced Floating point shaders • HLSL to program shaders • Windows Vista adopted it for many features: • UI: Aero and MCE • Image Processing: Windows Photo Gallery • DX10 was designed for more than games • Clean API to minimize API overhead • Consistent implementation across HW – No Caps • Refactored Infrastructure API: DXGI

  15. DirectX == High Performance Graphics

  16. Broad Usage of Direct3D Today • Typical user is someone who needs great performance and very custom/rich rendering • Mapping applications: • Eg. VirtualEarth and Google Earth • UI and Application Frameworks: • WPF, XNA • User Interfaces: • MCE, Zune, DWM • Workstation Applications: • Eg. Dassault Systèmes-3DLive, AutoDesk Applications, Bentley Microstation, SoftImage XSI

  17. 3D Product LifeCycle Management with DirectX10 Jean Buffet R&DProduct Manager Dassault Systèmes demo Dassault Systèmes – 3DLive

  18. 3DLive : feature at glance

  19. Demo Dassault Systèmes 3DLive 3DLive DirectX10 in Action on Windows 7

  20. DS - 3D Visualization Objectives • Providing “Life-like experience” of the virtual product in 3D • Ambiance, animation • Realistic rendering (shaders like Car Paint, Sky shader) • AAA game level rendering for CAD : Ambient Occlusion, Full Scene AA, IBL, soft shadows, true transparency • Best graphics performances to reach high interactivity (60 fps) • While matching CAD constraints • Ability to manage large number of triangles (10 M tri to 100 M tri) : Level of Details, viewpoint-dependent tessellation • Ability to manage hundreds of textures & shaders • Reach an interactive frame rate (20 fps) • Support of CAD-specific visualization mode : wireframe, outlines, hidden edges, hidden line removal

  21. Developer journey from OpenGL to DirectX10 • D3D10 is the right level of API for Dassault Systèmes 3D - PLM Applications • D3D9 were gaming oriented API • New features proposed by D3D10 allowed developers to implement advanced 3D & CAD-specific features • “Geometry Shader” is the D3D10 answer for specific 3D entities • Line type, line thickness, 3D marker… • Challenges • Technical Challenge • Full Shader pipe-line at application level • Having a native Vertex Buffer/Index Buffer management • Emulate the OpenGL immediate mode in an efficient way • Review your design pattern • More work at apps level but gives more room for optimization • Good opportunity to rework applicative architecture

  22. Follow Up • http://www.3ds.com • http://www.3dvia.com

  23. Current Platform Challenges

  24. Advancing the platform

  25. Advancing the platform

  26. Advancing the platform • Introducing… Direct2D DirectWrite

  27. Microsoft Confidential WIC DirectWrite DWM Direct2D DXVA Direct3D 11 Direct3D 10 GDI+ DXGI Direct3D9 USER GDI Win32K DXGKernel Hardware

  28. Properties of DirectX APIs • Primary focus: • Large scale Win32 application developers with existing codebases • Designed around needs of Windows UI, Internet Explorer, Microsoft Office • Side-by-side components • Can mix-n-match • Interface based APIs w/ C/C++ • Hardware accelerated • Immediate mode rendering • Interops with older Win32 APIs • Available on Windows Vista

  29. Direct3D 10.1 is the Foundation • Always available: • D3D10L9 for DX9 HW • Full SW emulation when there is no HW • Fully remoted via primitives and bitmaps • Supports GDI compatible color channel ordering • Direct3D 10 HW is a Premium Logo requirement in Vista

  30. Direct3D 11: Increasing GPU Utility • Strict superset of Direct3D10 • Runs on Direct3D 9, 10 and 11 HW • New Graphics features • Improved multi-threading support • (Need new HW) Tessellation • (Need new HW) Subroutine support in shaders • Compute Shader Enables non-Graphics usages (GPGPU) • Integrated with graphics for imaging usage • Program with familiar HLSL and D3D resource model • PC03: Unlocking the GPU with Direct3D • ES21: Windows 7 Presentation Virtualization: Graphics Remoting ( RDP) Today and Tomorrow

  31. Direct2D: New in Windows 7 • Rendering Focused Immediate Mode API: • 2D Vectors & Geometry, Bitmaps and Text • Hardware and Software Pipelines • Built for Performance on Direct3D 10.1 • Interoperable with Direct3D and GDI • High Quality Rendering: • Per Primitive Anti-Aliasing and MSAA via Direct3D • Remoted via Direct3D 10.1 • Printing support via XPS

  32. DirectWrite: New in Windows 7 • Modern Typography • Enables world-wide applications • ClearType advances • Works with any rendering technology • Hardware accelerated via Direct2D

  33. API Interop • All DirectX APIs interop with each other. Eg. • D2D/D3D, DWrite/D2D etc. • DirectX APIs interop with GDI • Interop between DX and GDI is high performance in Win7 • Directly blitting to front buffer via GDI can cause unpredictable results • GetDC() is the preferred way

  34. DX/GDI Interop Windows Vista Windows 7 //DX Code CreateRenderTarget() Draw() Present() // GDI Code GetDC() DrawLine() ReleaseDC() Copy 1 Copy 2

  35. More Details… • Direct2D, DirectWrite and Interop between APIs are covered in: • PC18: Introducing Direct2D and DirectWrite • Hands on Lab: DirectX

  36. Performance with DirectX • Very important to scale graphics content by HW • Since GPUs vary widely in performance • Identify min-bar and tiers of performance • Important to always respond • Main loop should handle only input and rendering • No disk or network I/O and computation in this loop • Have a benchmark mode in your application • PIX is a powerful performance debugging tool in DX SDK

  37. demo PIX

  38. GDI+ in Win7 • GDI+ is largely unchanged. Except: • v1.1 is default • CMYK support • Effects (Blur, Sharpen, Tint etc.) • GDI+ 1.1 uses WIC for image loading • v1.0 is deprecated • can be forced via manifest

  39. DirectX Going Ahead • DirectX is for all applications that need high performance graphics, not just games • Windows 7 Desktop itself is now built on Direct3D 10.1 • Direct3D 10.1 is the Foundation API • Two new DirectX APIs in Win7 • Direct2D and DirectWrite • PIX in DX SDK helps with tuning performance • Longer term DirectX APIs will replace GDI functionality

  40. Agenda • Where is Graphics Hardware headed • How does Win7 adapt to HW changes • The expanding role of DirectX in Windows 7 • Addressing new graphics scenarios and fundamentals in Windows 7 timeframe

  41. High Color

  42. Areas of Application • Primarily Imaging Applications • Medical • Visualization • Presentation • Photography • CAD

  43. Windows7 High Color Support • 3 new formats added in WIC, WCS and DXGI • Works in full-screen and overlay mode

  44. Dynamic HW Changes

  45. Common Scenarios • Laptop docking/un-docking • USB Displays plug/un-plug • Other full-screen exclusive mode applications launching • Hybrid laptops where GPUs switch

  46. Dynamic System ChangesGDI Applications • Heed WM_DISPLAYCHANGE message • Tells you when the resolution has changed • Always stick with the desktop resolution • Unless for perf • Adapt your layout if needed • Heed WM_DEVICECHANGE message • Tells you when laptop docks/undocks

  47. Dynamic System ChangesDX Applications • Monitor via return value from IDXGISwapChain::Present() API and respond based on the return code: • DXGI_STATUS_OCCLUDED - Wait • DXGI_STATUS_MODE_CHANGED – “Reset” adapt to the new mode • DXGI_ERROR_DEVICE_REMOVED – Stop rendering and wait for WM_DEVICECHANGE message to re-enumerate HW and re-create device. • IDXGISwapChain::GetDeviceRemovedReason() returns: • DXGI_ERROR_DEVICE_HUNG or DXGI_ERROR_DEVICE_RESET for HW hangs • DXGI_ERROR_REMOTE_DISCONNECT tells the app if the network dropped off

  48. Graphics Fundamental: High DPI

  49. This was very surprising to us… Users with Max Resolution of 1600X1200 Details Almost half of all of users are not configuring their display to native resolution (!) Users are lowering their screen resolution to get larger text…

  50. High DPI Issues Clipped Text Layout Issues & Image Size Issues Layout Issues Pixilated Bitmaps Mismatched Font Sizes Blurry UI