Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rudolph Balaz PRS311 Program Manager Microsoft Corporation

Similar presentations


Presentation on theme: "Rudolph Balaz PRS311 Program Manager Microsoft Corporation"— Presentation transcript:

1 Rudolph Balaz PRS311 Program Manager Microsoft Corporation
Direct 3D Part 1: Utilizing The Maximum Power Of The GPU In Your Graphic-Intensive Windows Vista ("Longhorn") Application Rudolph Balaz PRS311 Program Manager Microsoft Corporation ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2 Session Focus PRS 311 (This talk) PRS 416
4/17/2017 8:45 AM Session Focus PRS 311 (This talk) Overview of Windows Vista Graphics Stack Focus on Direct3D technologies Discover Graphics Stack changes Learn how to unleash the GPU Understand what it means to your application PRS 416 Building applications using HLSL Cool things you can do with Direct3D Next generation uses of the GPU ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

3 Topics Covered Windows Vista Direct3D Goals
4/17/2017 8:45 AM Topics Covered Windows Vista Direct3D Goals More Scalable / More Reliable New uses of the GPU Better visuals and effects Windows Vista Direct 3D Technologies New Display Driver Model Direct 3D 9.0 Direct 3D 10 ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

4 Direct 3D Direct access to 3D hardware Real time frame rates
Graphics Intensive Applications Games, Productivity, Workstation Applications Native & Managed APIs ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

5 Windows Vista Graphics Stack
4/17/2017 8:45 AM Windows Vista Graphics Stack Applications Desktop Windows Manager Windows Presentation Foundation Managed Direct3D9 Managed Direct3D10 Effects D3DX9 D3DX10 Direct3D9 Runtime Direct3D10 Runtime Windows Vista Display Driver Model ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

6 Subtle Windows Vista Changes
4/17/2017 8:45 AM Subtle Windows Vista Changes GDI –software only Desktop Composition Your timing may vary Actions may disable Desktop Composition GetDC(NULL), Locking GDI primary surface Shader Model 2.0 baseline ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

7 Things To Do Don’t lock the front buffer
4/17/2017 8:45 AM Things To Do Don’t lock the front buffer Throttle rendering in Windowed mode Test Fully Windows XP driver model Windows Vista driver model With/Without Desktop Window Manager Windowed/Fullscreen ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

8 Scalability / Reliability
4/17/2017 8:45 AM Scalability / Reliability ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

9 GPU Is A Shared Resource
4/17/2017 8:45 AM GPU Is A Shared Resource Presentation Desktop Manager Applications Games Multimedia Workstation Graphics Multi-monitor Mobile Remote (terminal server) ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

10 Scalability / Reliability
4/17/2017 8:45 AM Scalability / Reliability Windows Vista Display Driver Model ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

11 Display Driver Model Highlights
4/17/2017 8:45 AM Display Driver Model Highlights Virtualized graphics memory GPU Command Scheduling & Multitasking Command translation moved to user mode Managed Primaries Fault tolerance Plug and Play Rebootless driver upgrade Shared Surfaces Secure Surfaces ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12 Driver Model Details Basic Model Advanced Model
4/17/2017 8:45 AM Driver Model Details Basic Model Available in Windows Vista Virtualization is resource granularity Command Scheduling is in Software Advanced Model Available Shortly after Windows Vista Page-level faulting Hardware context switching ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

13 Subtle Windows Vista Changes
4/17/2017 8:45 AM Subtle Windows Vista Changes Can’t interleave GDI and D3D content Don’t draw lines, Bit Blts, etc. on Window DC Use Direct3D GetDC on Backbuffer GDI is software Not as performant as before Managed Primaries GDI popup flicker is gone for D3D9Ex GDI Desktop ≠ Buffer in swap chain ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

14 Things to do Recreate Swap chain Don’t mix GDI & D3D content
4/17/2017 8:45 AM Things to do Recreate Swap chain If Window size ≠ Backbuffer Size Desktop is rotated Don’t mix GDI & D3D content ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

15 Scalability / Reliability
4/17/2017 8:45 AM Scalability / Reliability Direct3D 9.0 on Vista ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

16 4/17/2017 8:45 AM Direct3D9 for Vista All Direct3D applications benefit from new Driver Model Improved Stability Multiple Applications Direct3D 9.0c applications just work Expose new driver model benefits to Applications Direct3D9Ex Vista Desktop built on top of D3D9 ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

17 Creating a Direct3D Device
4/17/2017 8:45 AM Creating a Direct3D Device pD3D = Direct3DCreate9( D3D_SDK_VERSION ); pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_DIREC3D9EX | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pd3dDevice ) ; pd3dDevice->QueryInterface( pd3dDevice, D3DCREATEDEVICEEX, pd3dDeviceEx ); Above is changing for Windows Vista Beta 2 Direct3D10 not in Windows Vista Beta 1 but coming Beta 2 ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

18 Shared Surfaces Parameter HANDLE* pSharedHandle
CreateTexture CreateVolumeTexture CreateCubeTexture CreateRenderTarget CreateVertexBuffer CreateIndexBuffer CreateDepthStencilSurface CreateOffscreenPlainSurface Resource can be re-opened using this shared handle. Restrictions: Resource attributes must match Only creating Process can Lock surface No automatic synchronization provided. Must be D3DPOOL_DEFAULT ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

19 Initialize Textures at Creation
4/17/2017 8:45 AM Initialize Textures at Creation Parameter HANDLE* pSharedHandle Pointer to texture Restrictions: Must be D3DPOOL_SYSTEMMEM Format must match texture being created ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

20 GPU Resource Management
4/17/2017 8:45 AM GPU Resource Management GPU Thread Priority HRESULT GetGPUThreadPriority(UINT *pPriority); HRESULT SetGPUThreadPriority(UINT Priority);   Resource Priority Soft-pinning Per resource priority Residency Check HRESULT IDirect3DDevice9Ex::CheckResourceResidency( [in, size_is ( NumResources )] IDirect3DResource9 * pResourceArray, [in] UINT32 NumResources); ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

21 Presentation Control Present same frame multiple times VBlank
HRESULT WaitForVBlank(void); Frame Statistics HRESULT GetLastPresentIndex(UINT* pLastPresentCount); HRESULT GetFrameStatistics(D3DPRESENTSTATS* pPresentationStatistics); typedef struct _D3DPRESENTSTATS {     UINT PresentCount;     UINT PresentRefreshCount;     UINT SyncRefreshCount;     LARGE_INTEGER SyncQPCTime;     LARGE_INTEGER SyncGPUTime; } D3DPRESENTSTATS; ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

22 Subtle Windows Vista Changes
4/17/2017 8:45 AM Subtle Windows Vista Changes D3DPOOL_DEFAULT Resources never lost not limited by Video memory D3DERR_DEVICELOST - very rare Example GPU hung and has been reset D3DERR_DEVICEREMOVED New error code Driver uninstalled Hardware removed ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

23 Unsubtle Changes TestCooperativeLevel deprecated Replaced by
4/17/2017 8:45 AM Unsubtle Changes TestCooperativeLevel deprecated Always returns S_OK Replaced by HRESULT CheckDeviceState(HWND hWindow); New Device States D3DERR_DEVICELOST D3DERR_DEVICEHUNG D3DERR_DEVICEREMOVED S_PRESENT_OCCLUDED S_PRESENT_MODE_CHANGED ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

24 When to use Direct3D9Ex Eliminate Video Memory Limit Resource Sharing
4/17/2017 8:45 AM When to use Direct3D9Ex Eliminate Video Memory Limit CAD / Design applications Resource Sharing Application uses multiple: Windows, Monitors, etc. Resource Scheduling Best Windows Vista Experience Willing to have multiple code paths Or only targeting newer hardware ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

25 Things to do Use D3D9Ex on Windows Vista
4/17/2017 8:45 AM Things to do Use D3D9Ex on Windows Vista Use Shared surfaces to limit memory usage Always use D3DPOOL_DEFAULT Recreate everything on D3DDEVICE_REMOVED Don’t use explicit resource management Priority API’s Use limit GPU usage when Windowed ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

26 Better Visuals and Effects
4/17/2017 8:45 AM Better Visuals and Effects D3D10 ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

27 Direct3D10 A Tremendous Step Forward
4/17/2017 8:45 AM Direct3D10 A Tremendous Step Forward Fundamental architecture change A new foundation for future releases Rebuilt from the ground-up Based on your feedback In collaboration with the IHV’s New hardware pipeline and software stack ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

28 DXGI DirectX Graphics Infrastructure
4/17/2017 8:45 AM DXGI DirectX Graphics Infrastructure Common operations refactored into a single DLL, isolated from rapid innovation on the 3D engine Enables resource sharing between Direct3D®10 and future API’s ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

29 Overview: The New Hardware Pipeline
4/17/2017 8:45 AM Overview: The New Hardware Pipeline Guaranteed Feature Set Strictly-defined, consistent behavior across hardware New Pipeline Stages and Primitive types Input Assembler Geometry Shader Common Shader Cores Stream Output New resource types and formats Ubiquity of resource access ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

30 Resource Types And “Views” Ubiquity of Resource Usage
4/17/2017 8:45 AM Resource Types And “Views” Ubiquity of Resource Usage Create multiple “views” of a base resource for usage at different points in the pipeline Pipeline Output Render Target and… Shader Resource Input Texture ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

31 Geometry Shader Per-Primitive Operations
4/17/2017 8:45 AM Geometry Shader Per-Primitive Operations GS Inputs: Operates on entire primitives [with adjacency] Material selection/setup to reduce # of draw() calls Set up barycentrics to exceed # of interpolators Compute edge lengths Compute plane equations Compute silhouette edges ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

32 Single-Pass Render-to-Cubemap
4/17/2017 8:45 AM Single-Pass Render-to-Cubemap Geometry Shader ID3D10ShaderResourceView::GenMips(…) ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

33 Single Pass Render-To-Cubemap
4/17/2017 8:45 AM Single Pass Render-To-Cubemap ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

34 Stream Output Writes GS Output to one or more buffers
DrawAuto() to draw streamed-out data of variable size without CPU intervention Uses: Intra-frame re-use Skin/morph once, render many Inter-frame re-use Iterative/procedural geometry processing All-GPU particle systems ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

35 4/17/2017 8:45 AM Predicated Rendering Predicate draw’s and blit’s with results of asynchronous queries No CPU involvement required Occlusion culling – render bounding box, predicate subsequent (complex) rendering on occlusion query result ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

36 4/17/2017 8:45 AM ©2005 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

37 4/17/2017 8:45 AM ©2005 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

38 Summary Windows Vista Direct3D Goals
4/17/2017 8:45 AM Summary Windows Vista Direct3D Goals Windows Vista Direct 3D Technologies ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

39 Community Resources “Windows Development” MSDN Forums
4/17/2017 8:45 AM Community Resources “Windows Development” MSDN Forums General, Graphics, Tools, Performance, and Audio Notification Alerts, Messages and RSS Feeds Integrated with Visual Studio 2005 Advanced Search FAQs, Answered/Unanswered Questions ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

40 © 2005 Microsoft Corporation. All rights reserved.
4/17/2017 8:45 AM © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "Rudolph Balaz PRS311 Program Manager Microsoft Corporation"

Similar presentations


Ads by Google