Presentation is loading. Please wait.

Presentation is loading. Please wait.

4/23/2017 4:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.

Similar presentations


Presentation on theme: "4/23/2017 4:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered."— Presentation transcript:

1 4/23/2017 4:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 Developing Metro style games on the Full Range of Windows 8 Devices
Dan McLachlan Principal Program Manager Lead Direct3D Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 Agenda Windows 8 hardware diversity
A unified 3D API to access the power of the GPU Designing for the Broadest Reach Strategies for dynamic calibration Tile-based rendering optimizations Recommendations

4 Windows 8 Hardware Diversity
4/23/2017 4:23 AM Windows 8 Hardware Diversity © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Hardware Landscape

6 Wider range of hardware implies reconsideration of your design point

7 New Category of Windows PCs
4/23/2017 4:23 AM New Category of Windows PCs New design point Always on, always connected System on a chip Battery is primary power source Focus on low power Both x86/x64 and ARM-based systems Covers a range of form factors

8 4/23/2017 4:23 AM A Unified 3D API © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 DirectX Versions Windows XP  DirectX 9 Hardware  Direct3D 9 API
Windows Vista  DirectX 10 Hardware  Direct3D 10 API Windows 7  DirectX 11 Hardware  Direct3D 11 API How do you design your software for all this hardware?

10 Feature Levels Direct3D 11 provides a uniform interface to access hardware capabilities Feature Levels map to hardware capabilities Feature_Level_9  DirectX 9 Hardware Feature_Level_10  DirectX 10 Hardware Feature_Level_11  DirectX 11 Hardware

11 Direct3D 11 is the API for driving graphics hardware

12 Direct3D Features (all Feature Levels)
HLSL shader programming Low-precision and high-precision instructions Consistent implementation on all devices

13 Feature Level 9 (Available on ALL hardware)
Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression

14 Feature Level 10 (Available on DirectX 10 and later hardware)
Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression Geometry shaders Stream out 128 Textures per shader 8 Render Targets Integers in shaders Vertex textures Shader sampling Constant buffers Alpha-to-coverage Basic DirectCompute Async resource creation

15 Feature Level 11 (Available on DirectX 11 and later hardware)
Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression Geometry shaders Stream out 128 Textures per shader 8 Render Targets Integers in shaders Vertex textures Shader sampling Constant buffers Alpha-to-coverage Basic DirectCompute Async resource creation Full DirectCompute Random access writes Tessellation shaders New compression formats Shader linkage

16 New Direct3D 11.1 Features Logic operations in output merger
Dynamic updates to constant buffers Low-precision math: min16_float, min10_float, min16_int Hardware can promote silently to single-precision float UAVs at every stage Faster double-precision division instructions Video support Graphics + Video integrated driver MSAD4 instruction Headless/Session 0

17 Select Feature Levels to Support
D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_1 }; UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT; © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 Create the Device and Context
ComPtr<ID3D11Device> device; ComPtr<ID3D11DeviceContext> context; D3D11CreateDevice( nullptr, // use the default adapter D3D_DRIVER_TYPE_HARDWARE, 0, // use 0 unless a software device creationFlags, // defined above featureLevels, // what app will support ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, // should always be D3D11_SDK_VERSION &device, // created device &m_featureLevel, // feature level of the device &context // corresponding immediate context ); © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 Designing for Broadest Reach
4/23/2017 4:23 AM Designing for Broadest Reach © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 Particle Systems with Dynamic Calibration
demo © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

21 Development Strategy Develop on DirectX 11 hardware
Target Feature_Level_9 and scale up Include calibration code in game to dynamically configure for current hardware Adjust to maintain performance Be aware of Feature Level differences Test by restricting Feature Level Test on multiple PCs

22 DirectX Control Panel

23 Differentiation Use advanced features when available Stereo 3D
Tessellation Left eye image Right eye image L R

24 Differentiation Increase Visual Quality Higher resolution textures
Use bump maps

25 Texture Considerations
Balance visual quality with performance Scale back on size via mipmap levels Use block-compressed texture formats 1024 x 1024 512 x 512 256 x 256

26 Other Considerations Geometry MultiSampling AntiAliasing (MSAA)
Feature_Level_11 – use tessellation for more polygon count control Consider lower-resolution (lower vertex count) meshes MultiSampling AntiAliasing (MSAA) Reduce sample count to maintain frame rate Render to a lower resolution and scale up for final image For best image quality, do not scale 2D text

27 Feature Level ≠ Performance Dynamic calibration is critical to achieving performance

28 Conventional Belief versus Reality
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

29 Calibration Create device Set limits based on returned Feature Level
Render a set of characteristic frames without presenting Adjust based on results

30 Calibrating Render Performance
ComPtr<ID3D11Query> eventQuery; D3D11_QUERY_DESC queryDesc; queryDesc.Query = D3D11_QUERY_EVENT; queryDesc.MiscFlags = 0; m_d3dDevice->CreateQuery(&queryDesc, &eventQuery); m_timer.reset(); Render(); for (int i = 0; i < 18; i++) { m_d3dDeviceContext->Flush(); } m_d3dDeviceContext->End(eventQuery.Get()); if (S_FALSE == _d3dDeviceContext->GetData(eventQuery.Get(), NULL, 0, 0)) while (S_FALSE == m_d3dDeviceContext->GetData(eventQuery.Get(), NULL, 0, D3D11_ASYNC_GETDATA_DONOTFLUSH)); m_timer.tick(); float elapsedTime = m_timer.getDeltaTime(); Initialize a query event Render a set of frames. Wait until all rendering is completed. Get elapsed time. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

31 Trade-offs: Performance Visual Quality Power Consumption

32 Increasing Performance
Reduce rendering costs Minimize shader computation complexity Minimize redundant work Reduce rasterization work Scale final render target if pixel bound Minimize depth complexity or overdraw

33 Reducing Rendering Costs
New Direct3D features, especially for reducing power consumption Available across ALL feature levels Minimum precision Tile-based rendering optimizations

34 Minimum Precision Reduce the number of bits of precision in shader calculations Hints to the graphics driver where optimizations can be done Specifies minimum rather than actual precision min16float min12int min16int

35 Minimum Precision HLSL Code Sample
static const float brightThreshold = 0.5f; Texture2D sourceTexture : register(t0); float4 DownScale3x3BrightPass(QuadVertexShaderOutput input) : SV_TARGET { float3 brightColor = 0; // Gather 16 adjacent pixels (each bilinear sample reads a 2x2 region) brightColor = sourceTexture.Sample(linearSampler, input.tex, int2(-1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2(-1, 1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1, 1)).rgb; brightColor /= 4.0f; // Brightness thresholding brightColor = max(0, brightColor - brightThreshold); return float4(brightColor, 1.0f); } © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

36 Minimum Precision HLSL Code Sample
static const min16float brightThreshold = (min16float)0.5; Texture2D<min16float4> sourceTexture : register(t0); float4 DownScale3x3BrightPass(QuadVertexShaderOutput input) : SV_TARGET { min16float3 brightColor = 0; // Gather 16 adjacent pixels (each bilinear sample reads a 2x2 region) brightColor = sourceTexture.Sample(linearSampler, input.tex, int2(-1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2(-1, 1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1, 1)).rgb; brightColor /= (min16float)4.0; // Brightness thresholding brightColor = max(0, brightColor - brightThreshold); return float4(brightColor, 1.0f); } © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

37 Tile-based Rendering Some graphics architectures use tile caches
Cache access is much faster than GPU memory bus Goal is to keep data in the cache as long as possible Loops over the command stream once per tile

38 Typical Rendering Command stream sent to GPU Command Stream
CommandBuffer1 Command1 Command2 Command3 Command4 Command5 Command6 CommandBuffer2 CommandBuffer3 Command Stream

39 Tile Based Rendering Display the final image
Send Command Stream to GPU Execute Command Stream for Tile 1 Execute Command Stream for Tile 2 Execute Command Stream for Tile 3 Execute Command Stream for Tile 4 CommandBuffer1 Command1 Command2 Command3 Command4 Command5 Command6 CommandBuffer2 CommandBuffer3 Buffered Commands Execute Command Stream for Tile 5 Execute Command Stream for Tile 6 Display the final image

40 Tile-based Rendering Optimizations
The Challenge: Some rendering sequences result in Direct3D needing to do multiple copies of buffers to ensure rendering correctness. The Solution: New Direct3D APIs provide hints to avoid unnecessary copies. Make a promise about your rendering behavior

41 Take advantage of tile-based rendering hints and optimizations

42 Tile-based Rendering Strategies
Avoid mid-scene flushes Avoid swapping back and forth between RenderTargets Use scissors when updating small portions of a RenderTarget Use DISCARD and NO_OVERWRITE when possible

43 Tile-based Rendering Optimizations
GPUs with a tile-based rendering architecture can get a performance boost with a special flag: m_swapChain->Present(1, 0); // present the image on the display ComPtr<ID3D11View> view; m_renderTargetView.As(&view); // get the view on the RT m_d3dContext->DiscardView(view.Get()); // release the view

44 Example: Dynamic Geometry

45 Example: Dynamic Geometry
Create vertex buffer Generate geometry data Draw Present DISCARD No Overwrite Vertex buffer

46 Recommendations

47 System Configurations
Development machine [Asus G73 Gaming Laptop] AMD 5870M GPU (DX11) 64-bit OS, Core i7 quad core CPU, 8 GB memory Test machine (Laptop) [HP Elitebook 2740p] DirectX 10 graphics and touch 64-bit OS, 4 GB memory Test machine (Netbook) [HP Mini 5102T] DirectX 9.1 graphics and touch 32-bit OS, Atom processor, 1 GB to 2 GB memory

48 Considerations Touch capabilities are important
4/23/2017 4:23 AM Considerations Touch capabilities are important Minimum screen resolution of 1366 x 768 Test across a diversity of machines

49 4/23/2017 4:23 AM Conclusion © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

50 Conclusion Windows 8 Runs on the broadest graphics hardware diversity ever Designed for graphics hardware acceleration Direct3D 11 is the 3D API to access the power of the GPU You can get Great Graphics Performance leveraging the GPU AND hit the broadest markets

51 Strategy Recap Design for Feature_Level_9
Adjust at runtime for actual Feature Level Use advanced features to differentiate when available Dynamically calibrate for smooth performance Use new Direct3D 11 features to better utilize hardware Minimum precision Tile-based rendering optimizations

52 Further Reading and Documentation
Direct3D 11.1 Features D3D11_FEATURE_DATA_D3D11_OPTIONS structure DXGIAdapter2::GetDesc2 method DXGI 1.2 Improvements Creating a DirectX Game Unlocking the GPU with Direct3D (PDC 2008) Direct3D on Downlevel Hardware (MSDN) 10Level9 ID3D11Device Methods (MSDN) 10Level9 ID3D11DeviceContext Methods (MSDN) Hardware Support for Direct3D 10Level9 Formats (MSDN) Questions? Visit the forums on the Windows Dev Center at

53 4/23/2017 4:23 AM © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "4/23/2017 4:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered."

Similar presentations


Ads by Google