SlideShare una empresa de Scribd logo
1 de 20
The next
generation
of
for Game Engines
GPU APIs
Pooya Eimandar
Fanap
March 2018
POOYA EIMANDAR
• Lead developer of Wolf.Engine (an open source 3D game engine)
• Project Manager and lead developer of Project Falcon since 2017
• CEO at BaziPardaz Ltd since 2011
• Founder at WolfSource.io
• Member of Microsoft Partner Network since 2013
• Author at PackT Publications and GameDev.Net
• Lecturer at The University of Applied Science and Technology National Foundation of
Computer Games (2013 – 2015)
• Lecturer at Iran Game Development Institute (2014 – 2015)
• Lead developer of Persian Game Engine (2010 - 2014)
• Member of IGDF jury panel for the best computer games technology. (2014 - 2015)
• https://persianengine.codeplex.com
(codename Black Kitten)
• https://github.com/WolfSource/Wolf.Engine
• The use of motion sensors in medical and
health industry. (Jan 27, 2014 - First
Conference of Game & Medical Health)
• DirectX Graphics Diagnostic. (Oct 11, 2013.
GameDev.Net)
PUBLICATIONS
• In Oct 1958, Physicist William Higinbotham created
first video
• 1970s : Golden age of Arcade Games powered by
Fujitsu’s MB14241, Atari 2600’s Television Interface
Adaptor and etc.
• 1992 : Silicon Graphics Inc., started developing
OpenGL in 1991 and released it in January 1992
• 1995: Microsoft DirectX released as Windows Game
SDK for Windows 95
HISTORY
HLSL PIPELINE
vs_1_1 supports 128 instructions such as: add, vs, log, mov, max, min m4x4
vs_2_0 supports 256 instructions
vs_3_0 supports minimum 512 instructions and up to the number of slots in
D3DCAPS9.MaxPixelShader30InstructionSlots
Vs_4_0 and later versions : No restriction
Memory Resources (Buffer, Texture)
Pixel
Shader
Output
Merger
Input
Assembler
Vertex
Shader
Hull
Shader
Tessellator
Domain
Shader
Geometry
Shader
Rasterizer
Stream Output
Control
Shader
Evaluation
Shader
Fragment
Shader
GLSL PIPELINE
THE EVOLUTION OF GPU APIS
• 1992 OpenGL: Fixed Functions Pipeline
• 1995 DirectX on Microsoft Windows 95, Microsoft stopped supporting OpenGL(till now v.1.1)
• 1996 3dfx’s Glide: Geometry & Texture Mapping
• 1998 DirectX 6: IHV independent + Multi Texturing
• 1999 DirectX 7: Hardware Texturing & Lighting + Cube Maps
• 2000 DirectX 8: Programmable Shaders
• 2002 DirectX 9: Floating point texture mapping, multiple RTs, Multiple-Element Textures, texture lookups
in the vertex shader and stencil buffer techniques
• 2004 OpenGL 2.0: GLSL
• 2006 DirectX 10: Major Update
• 2009 DirectX 11: Compute Shader
• 2010 OpenGL 3.3 + OpenGL 4.0: It was designed to target hardware able to support Direct3D 10/11
• 2012 DirectX 11.1: Direct2D + Direct3D, Integrated with WINRT
• 2013 DirectX 11.2: Dircet2D Geometry Rasterization, swap chain composition
• 2014 DirectX 11.3: Xbox One
• 2014 Apple Metal : released for IOS 8
• 2015 Apple Metal : released for Mac OSX El Cptain
• 2015 DirectX 12: Windows 10
• 2016 Vulkan : The next generation of OpenGL
• 2017 OpenGL 4.6: released at 25th Anniversary of OpenGL
THE NEXT GENERATION
• 2013 : AMD originally developed Mantle in cooperation with DICE
• Mantle was designed as an alternative to Direct3D and OpenGL
• 2015: Mantle's public SDK was suspended, as DirectX 12 and the Mantle-derived
Vulkan (Next Generation of OpenGL) rose in popularity
DirectX 12
Since 2014 on Apple IOS 8
Since 2015 on Mac OSX El Capitan
Xbox One (DX11.X)
Xbox One X
Windows 10
Windows 7/8/8.1/10
Linux
Android
Almost Cross Platform
• Low driver overhead
• Minimize runtime validation
• Multithreaded GPU command buffer recording
from CPU Cores
• Explicit Memory Management, Local Host, Device
Host, Shared Memory between CPU and GPU
• Provide explicit access to multiple GPUs
WHY DO WE NEED TO MIGRATE TO NEW APIS?
Application Application
responsible for
memory
allocation and
thread
management to
record command
buffers
Direct GPU Control
GPU
Next Gen APIs
DirectX 12
Vulkan
Metal
Traditional APIs
DirectX 11
OpenGL
OpenGL ES
Controlling GPU
offered by
traditional
graphics drivers
for managing
memory, context
and etc.
OpenGL
void load_texture_from_memory_rgba(_In_ uint8_t* pRGBAData)
{
glBindTexture(GL_TEXTURE_2D, ”texture_name”);
glTexImage2D(GL_TEXTURE_2D,
0,
GL_SRGBA8,
_width, _height,
0,
GL_UNSIGNED_BYTE,
GL_RGBA,
pRGBAData);
glGenerateMipmap(GL_TEXTURE_2D);
}
SAMPLE CODE
void create_image() {
const VkImageCreateInfo _image_create_info = {
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // Type
nullptr, // Next
0, // Flags
_image_type, // ImageType
_format, // Format
{ _width, _height, _depth },
_mip_map_levels , // MipLevels
_layer_count, // ArrayLayers
VK_SAMPLE_COUNT_1_BIT, // Samples
VK_IMAGE_TILING_OPTIMAL, // Tiling
_usage_flags, // Usage
VK_SHARING_MODE_EXCLUSIVE, // SharingMode
0, // QueueFamilyIndexCount
nullptr, // QueueFamilyIndices
VK_IMAGE_LAYOUT_UNDEFINED // InitialLayout };
vkCreateImage(vk_device, &_image_create_info, nullptr, &_image_view); }
SAMPLE CODE
void load_texture_from_memory_rgba(_In_ uint8_t*
pRGBAData)
{
create_image();
allocate_memory();
//bind to memory
vkBindImageMemory(vk_device, _image_view, _memory, 0)
copy_data_to_texture_2D(pRGBAData);
create_sampler();
create_image_view();
}
Vulkan
DIRECT GPU COMPONENTS
Heap Memory
Image
Image View
Image View
Buffer
Sampler
Frame Buffer Render Pass
Command
Buffer
Pool
Main Command Buffer
Second
Command
Buffer
Graphics Pipeline
Barrier Synchronization
Begin Render Pass
Bind Graphics Pipeline
Set Dynamic States
Bind to Buffers
Update Buffer
Bind Descriptor Sets
Draw
Execute Commands
End Render Pass
Buffer
Descriptor Set
Descriptor
Set
Pool Queue
Device
MEMORY ALLOCATION
Heap Memory
Memory
Chuck
Memory
Chuck
Memory
Chuck
Buffer 1 Buffer 2 Buffer 3
Vertex BufferIndex BufferUniform
MEMORY ALLOCATION
Memory Chuck
Buffer 1 Buffer 2 Buffer 3
Vertex BufferIndex BufferUniform
MEMORY ALLOCATION
Memory Chuck
Buffer
Vertex BufferIndex BufferUniform
THREAD SYNCHRONIZATION
Main Command Buffer
Execute Commands
Four synchronization types:
• Fences, being used to communicate completion of
execution of command buffer submissions to queues
back to the application.
• Semaphores, being generally associated with resources
or groups of resources and can be used to marshal
ownership of shared data. Their status is not visible to
the host. (Queues
• Events, providing a finer-grained synchronization
primitive which can be signaled at command level
granularity by both device and host, and can be waited
upon by either.
• Barriers, providing execution and memory
synchronization between sets of commands.
cmd buffer cmd buffer cmd buffer
cmd buffer cmd bufferFence 1
Fence 2
Barrier Synchronization
GRAPHICS PIPELINE
Main Command Buffer
Graphics Pipeline
Bind Graphics Pipeline
Graphics Pipeline
• Snapshot from all GPU States
• Rasterization state
• Shader Stage
• Vertex Input
• Tessellation state
• Multi Sample State
• Depth & Stencil State
• Color Blend State
DRAW
Main Command Buffer
Draw
Draw methods:
• Direct Draw
• Set Vertex, Index
• Call Draw
• Too Slow, Many Draw Calls
• Instanced Draw
• Setup instance buffer
• Draw all with same instance buffer
• Draw each object with same number of vertices and
indices
• InDirect Draw
• the buffer can be generated and updated offline with no
need to actually update the command buffers that
contain the actual drawing functions
• On indirect call draws all objects with associated vertex
and index buffer
WOLF ENGINE
• http://WolfSource.io
• https://github.com/WolfSource/Wolf.Engine
• The Wolf Engine is the next generation of Persian Game Engine which is a
cross-platform open source game engine. The Wolf is a comprehensive set
of C++ open source libraries for rendering and game developing.
• Script language : LUA
• Binding Languages: PyWolf, a Python binding for Wolf Engine
CONTACT ME
• https://Fanap.ir
• http://WolfSource.io
• http://PooyaEimandar.com
• Twitter.com/Wolf_Engine
• Linkedin.com/in/PooyaEimandar
• Github.com/PooyaEimandar
• T.me/WolfSource.io
THANK YOU!
• We are hiring at FANAP!
• Jobs.fanap.ir

Más contenido relacionado

La actualidad más candente

Kinect seminar 121103v1
Kinect seminar 121103v1Kinect seminar 121103v1
Kinect seminar 121103v1
cs Kang
 
Kinect seminar 121215v1
Kinect seminar 121215v1Kinect seminar 121215v1
Kinect seminar 121215v1
cs Kang
 
Kinect seminar 121110v1
Kinect seminar 121110v1Kinect seminar 121110v1
Kinect seminar 121110v1
cs Kang
 
Kinect seminar 121201v1(동영상x)
Kinect seminar 121201v1(동영상x)Kinect seminar 121201v1(동영상x)
Kinect seminar 121201v1(동영상x)
cs Kang
 
Kinect seminar 121208v1(동영상x)
Kinect seminar 121208v1(동영상x)Kinect seminar 121208v1(동영상x)
Kinect seminar 121208v1(동영상x)
cs Kang
 
Kinect seminar 120919
Kinect seminar 120919Kinect seminar 120919
Kinect seminar 120919
cs Kang
 
Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Endless runner game in unreal engine 4
Endless runner game in unreal engine 4
Vasilis Kamakaris
 

La actualidad más candente (20)

ProjectsSummary
ProjectsSummaryProjectsSummary
ProjectsSummary
 
Kinect seminar 121103v1
Kinect seminar 121103v1Kinect seminar 121103v1
Kinect seminar 121103v1
 
Kinect seminar 121215v1
Kinect seminar 121215v1Kinect seminar 121215v1
Kinect seminar 121215v1
 
【Unite 2017 Tokyo】NVIDIA Gameworks アップデートおよびAnselとVRWorksの紹介
【Unite 2017 Tokyo】NVIDIA Gameworks アップデートおよびAnselとVRWorksの紹介【Unite 2017 Tokyo】NVIDIA Gameworks アップデートおよびAnselとVRWorksの紹介
【Unite 2017 Tokyo】NVIDIA Gameworks アップデートおよびAnselとVRWorksの紹介
 
Kinect seminar 121110v1
Kinect seminar 121110v1Kinect seminar 121110v1
Kinect seminar 121110v1
 
OSVR presentation at Boston VR meetup Jul 15
OSVR presentation at Boston VR meetup Jul 15OSVR presentation at Boston VR meetup Jul 15
OSVR presentation at Boston VR meetup Jul 15
 
Kinect seminar 121201v1(동영상x)
Kinect seminar 121201v1(동영상x)Kinect seminar 121201v1(동영상x)
Kinect seminar 121201v1(동영상x)
 
Kinect seminar 121208v1(동영상x)
Kinect seminar 121208v1(동영상x)Kinect seminar 121208v1(동영상x)
Kinect seminar 121208v1(동영상x)
 
Introduction to OSVR - Apr 2015
Introduction to OSVR - Apr 2015Introduction to OSVR - Apr 2015
Introduction to OSVR - Apr 2015
 
Targeting Android with Qt
Targeting Android with QtTargeting Android with Qt
Targeting Android with Qt
 
Porting a Proprietary Game Engine to Linux
Porting a Proprietary Game Engine to LinuxPorting a Proprietary Game Engine to Linux
Porting a Proprietary Game Engine to Linux
 
Kinect seminar 120919
Kinect seminar 120919Kinect seminar 120919
Kinect seminar 120919
 
Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Endless runner game in unreal engine 4
Endless runner game in unreal engine 4
 
Game Development with Unity3D 5 in Bandung, Indonesia
Game Development with Unity3D 5 in Bandung, IndonesiaGame Development with Unity3D 5 in Bandung, Indonesia
Game Development with Unity3D 5 in Bandung, Indonesia
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
 
Kinect for Windows SDK
Kinect for Windows SDKKinect for Windows SDK
Kinect for Windows SDK
 
Unity 3 d
Unity 3 dUnity 3 d
Unity 3 d
 
Android game development
Android game developmentAndroid game development
Android game development
 
Unreal Engine 4 Introduction
Unreal Engine 4 IntroductionUnreal Engine 4 Introduction
Unreal Engine 4 Introduction
 

Similar a The next generation of GPU APIs for Game Engines

SIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLSIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGL
Mark Kilgard
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
Diksha Bhargava
 
ngGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and TokyongGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and Tokyo
notolab
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
changehee lee
 

Similar a The next generation of GPU APIs for Game Engines (20)

SIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLSIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGL
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)
 
De Re PlayStation Vita
De Re PlayStation VitaDe Re PlayStation Vita
De Re PlayStation Vita
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
ngGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and TokyongGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and Tokyo
 
Scalable AI Solution cross AI platforms
Scalable AI Solution cross AI platformsScalable AI Solution cross AI platforms
Scalable AI Solution cross AI platforms
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
 
Direct X
Direct XDirect X
Direct X
 
Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!
 
Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript Performance
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio [Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
 
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIsDX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
 
Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill)
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
Developing games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalDeveloping games and graphic visualizations in Pascal
Developing games and graphic visualizations in Pascal
 
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

The next generation of GPU APIs for Game Engines

  • 1. The next generation of for Game Engines GPU APIs Pooya Eimandar Fanap March 2018
  • 2. POOYA EIMANDAR • Lead developer of Wolf.Engine (an open source 3D game engine) • Project Manager and lead developer of Project Falcon since 2017 • CEO at BaziPardaz Ltd since 2011 • Founder at WolfSource.io • Member of Microsoft Partner Network since 2013 • Author at PackT Publications and GameDev.Net • Lecturer at The University of Applied Science and Technology National Foundation of Computer Games (2013 – 2015) • Lecturer at Iran Game Development Institute (2014 – 2015) • Lead developer of Persian Game Engine (2010 - 2014) • Member of IGDF jury panel for the best computer games technology. (2014 - 2015)
  • 3. • https://persianengine.codeplex.com (codename Black Kitten) • https://github.com/WolfSource/Wolf.Engine • The use of motion sensors in medical and health industry. (Jan 27, 2014 - First Conference of Game & Medical Health) • DirectX Graphics Diagnostic. (Oct 11, 2013. GameDev.Net) PUBLICATIONS
  • 4. • In Oct 1958, Physicist William Higinbotham created first video • 1970s : Golden age of Arcade Games powered by Fujitsu’s MB14241, Atari 2600’s Television Interface Adaptor and etc. • 1992 : Silicon Graphics Inc., started developing OpenGL in 1991 and released it in January 1992 • 1995: Microsoft DirectX released as Windows Game SDK for Windows 95 HISTORY
  • 5. HLSL PIPELINE vs_1_1 supports 128 instructions such as: add, vs, log, mov, max, min m4x4 vs_2_0 supports 256 instructions vs_3_0 supports minimum 512 instructions and up to the number of slots in D3DCAPS9.MaxPixelShader30InstructionSlots Vs_4_0 and later versions : No restriction Memory Resources (Buffer, Texture) Pixel Shader Output Merger Input Assembler Vertex Shader Hull Shader Tessellator Domain Shader Geometry Shader Rasterizer Stream Output Control Shader Evaluation Shader Fragment Shader GLSL PIPELINE
  • 6. THE EVOLUTION OF GPU APIS • 1992 OpenGL: Fixed Functions Pipeline • 1995 DirectX on Microsoft Windows 95, Microsoft stopped supporting OpenGL(till now v.1.1) • 1996 3dfx’s Glide: Geometry & Texture Mapping • 1998 DirectX 6: IHV independent + Multi Texturing • 1999 DirectX 7: Hardware Texturing & Lighting + Cube Maps • 2000 DirectX 8: Programmable Shaders • 2002 DirectX 9: Floating point texture mapping, multiple RTs, Multiple-Element Textures, texture lookups in the vertex shader and stencil buffer techniques • 2004 OpenGL 2.0: GLSL • 2006 DirectX 10: Major Update • 2009 DirectX 11: Compute Shader • 2010 OpenGL 3.3 + OpenGL 4.0: It was designed to target hardware able to support Direct3D 10/11 • 2012 DirectX 11.1: Direct2D + Direct3D, Integrated with WINRT • 2013 DirectX 11.2: Dircet2D Geometry Rasterization, swap chain composition • 2014 DirectX 11.3: Xbox One • 2014 Apple Metal : released for IOS 8 • 2015 Apple Metal : released for Mac OSX El Cptain • 2015 DirectX 12: Windows 10 • 2016 Vulkan : The next generation of OpenGL • 2017 OpenGL 4.6: released at 25th Anniversary of OpenGL
  • 7. THE NEXT GENERATION • 2013 : AMD originally developed Mantle in cooperation with DICE • Mantle was designed as an alternative to Direct3D and OpenGL • 2015: Mantle's public SDK was suspended, as DirectX 12 and the Mantle-derived Vulkan (Next Generation of OpenGL) rose in popularity DirectX 12 Since 2014 on Apple IOS 8 Since 2015 on Mac OSX El Capitan Xbox One (DX11.X) Xbox One X Windows 10 Windows 7/8/8.1/10 Linux Android Almost Cross Platform
  • 8. • Low driver overhead • Minimize runtime validation • Multithreaded GPU command buffer recording from CPU Cores • Explicit Memory Management, Local Host, Device Host, Shared Memory between CPU and GPU • Provide explicit access to multiple GPUs WHY DO WE NEED TO MIGRATE TO NEW APIS? Application Application responsible for memory allocation and thread management to record command buffers Direct GPU Control GPU Next Gen APIs DirectX 12 Vulkan Metal Traditional APIs DirectX 11 OpenGL OpenGL ES Controlling GPU offered by traditional graphics drivers for managing memory, context and etc.
  • 9. OpenGL void load_texture_from_memory_rgba(_In_ uint8_t* pRGBAData) { glBindTexture(GL_TEXTURE_2D, ”texture_name”); glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGBA8, _width, _height, 0, GL_UNSIGNED_BYTE, GL_RGBA, pRGBAData); glGenerateMipmap(GL_TEXTURE_2D); } SAMPLE CODE
  • 10. void create_image() { const VkImageCreateInfo _image_create_info = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // Type nullptr, // Next 0, // Flags _image_type, // ImageType _format, // Format { _width, _height, _depth }, _mip_map_levels , // MipLevels _layer_count, // ArrayLayers VK_SAMPLE_COUNT_1_BIT, // Samples VK_IMAGE_TILING_OPTIMAL, // Tiling _usage_flags, // Usage VK_SHARING_MODE_EXCLUSIVE, // SharingMode 0, // QueueFamilyIndexCount nullptr, // QueueFamilyIndices VK_IMAGE_LAYOUT_UNDEFINED // InitialLayout }; vkCreateImage(vk_device, &_image_create_info, nullptr, &_image_view); } SAMPLE CODE void load_texture_from_memory_rgba(_In_ uint8_t* pRGBAData) { create_image(); allocate_memory(); //bind to memory vkBindImageMemory(vk_device, _image_view, _memory, 0) copy_data_to_texture_2D(pRGBAData); create_sampler(); create_image_view(); } Vulkan
  • 11. DIRECT GPU COMPONENTS Heap Memory Image Image View Image View Buffer Sampler Frame Buffer Render Pass Command Buffer Pool Main Command Buffer Second Command Buffer Graphics Pipeline Barrier Synchronization Begin Render Pass Bind Graphics Pipeline Set Dynamic States Bind to Buffers Update Buffer Bind Descriptor Sets Draw Execute Commands End Render Pass Buffer Descriptor Set Descriptor Set Pool Queue Device
  • 12. MEMORY ALLOCATION Heap Memory Memory Chuck Memory Chuck Memory Chuck Buffer 1 Buffer 2 Buffer 3 Vertex BufferIndex BufferUniform
  • 13. MEMORY ALLOCATION Memory Chuck Buffer 1 Buffer 2 Buffer 3 Vertex BufferIndex BufferUniform
  • 14. MEMORY ALLOCATION Memory Chuck Buffer Vertex BufferIndex BufferUniform
  • 15. THREAD SYNCHRONIZATION Main Command Buffer Execute Commands Four synchronization types: • Fences, being used to communicate completion of execution of command buffer submissions to queues back to the application. • Semaphores, being generally associated with resources or groups of resources and can be used to marshal ownership of shared data. Their status is not visible to the host. (Queues • Events, providing a finer-grained synchronization primitive which can be signaled at command level granularity by both device and host, and can be waited upon by either. • Barriers, providing execution and memory synchronization between sets of commands. cmd buffer cmd buffer cmd buffer cmd buffer cmd bufferFence 1 Fence 2 Barrier Synchronization
  • 16. GRAPHICS PIPELINE Main Command Buffer Graphics Pipeline Bind Graphics Pipeline Graphics Pipeline • Snapshot from all GPU States • Rasterization state • Shader Stage • Vertex Input • Tessellation state • Multi Sample State • Depth & Stencil State • Color Blend State
  • 17. DRAW Main Command Buffer Draw Draw methods: • Direct Draw • Set Vertex, Index • Call Draw • Too Slow, Many Draw Calls • Instanced Draw • Setup instance buffer • Draw all with same instance buffer • Draw each object with same number of vertices and indices • InDirect Draw • the buffer can be generated and updated offline with no need to actually update the command buffers that contain the actual drawing functions • On indirect call draws all objects with associated vertex and index buffer
  • 18. WOLF ENGINE • http://WolfSource.io • https://github.com/WolfSource/Wolf.Engine • The Wolf Engine is the next generation of Persian Game Engine which is a cross-platform open source game engine. The Wolf is a comprehensive set of C++ open source libraries for rendering and game developing. • Script language : LUA • Binding Languages: PyWolf, a Python binding for Wolf Engine
  • 19. CONTACT ME • https://Fanap.ir • http://WolfSource.io • http://PooyaEimandar.com • Twitter.com/Wolf_Engine • Linkedin.com/in/PooyaEimandar • Github.com/PooyaEimandar • T.me/WolfSource.io
  • 20. THANK YOU! • We are hiring at FANAP! • Jobs.fanap.ir