SlideShare a Scribd company logo
PROGRAMMING
THE GPU
2014THE C,F,F (CLEAR, FLUSH, FINISH) APIS
 Clear
 Clears the current target view area (entire screen – FBO or Fb)
 Is that it ?
 Sequence 1
 Draw something <frame1>
 Draw something <frame2>
 Sequence 2
 Draw something <frame1>
 Clear
 Draw something <frame2>
 The role of the GPU internal cache / fast memory
 Engine by default reads back from fb
 By specifying “Clear” – the engine can eliminate reads
 Further extensions allow discard as well
 Viewport determines the draw area
2014FLUSH, AND FINISH
 Several types of rendering methods adopted by GPUs
 Immediate rendering
 Deferred rendering
 Immediate rendering – everyone is happy
 Except the memory bus!
 Deferred – the GPU applies its “intelligence” to do/not do certain draw calls/ portions of draw calls
 Used most commonly in embedded GPUs
 No concept of “bit exactness” in Graphics rendering
 Hence, some API calls may not finish intended operations
 Flush() – The call ensures pending operations are kicked off, returns
 Finish() – The call ensures pending operations are kicked off, “waits for completion”, returns
2014A NOTE ON WEBGL – VS NATIVE CODE
 In native code, need to handle creation of a Display, Surface, Context
 For example, refer to this native code (sgxperf)
 eglGetDisplay
 eglInitialize – for this display
 eglBindAPI – bind to GLES/ VG context
 eglChooseConfig – configure surface type, GLES1/2/VG, Depth/Stencil buffer size
 eglCreateWindowSurface / eglCreatePixmapSurface
 eglCreateContext
 eglMakeCurrent
 eglSwapBuffers
 But Platform initialisation in WebGL is handled by browser
 Only configurations are – stencil, depth, AA, Alpha, preserve
 No EGL calls in JS application code
 No multi-threading issues (not yet, but “workers” are coming)
 The hands on labs will focus on GL (rendering), not EGL (platform) Lab framework
2014
FUNCTIONS/API CALLS TO BE MODIFIED IN
THE FRAMEWORK
 Provided in the workshop notes
5
Lab
PROGRAMMING
 ClearColor
 Clear – clears with color specified
earlier
 Flush/ Finish
  First Lab Exercise
2014LAB L1 – CLEAR COLOUR, VIEWPORT
7
(Clone Lab)
(Edit Render code)
(Launch Personal Lab)
(Relaunch after Edit) (Launch Lab)

More Related Content

PPTX
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
PDF
VMworld 2013: On the Way to GPU Virtualization – 3D Acceleration in Virtual M...
PPTX
GFX part 8 - Three.js introduction and usage
PPTX
GFX Part 5 - Introduction to Object Transformations in OpenGL ES
PDF
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
PPTX
AGDK tutorial step by step
PPT
NVIDIA CUDA
PDF
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
VMworld 2013: On the Way to GPU Virtualization – 3D Acceleration in Virtual M...
GFX part 8 - Three.js introduction and usage
GFX Part 5 - Introduction to Object Transformations in OpenGL ES
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
AGDK tutorial step by step
NVIDIA CUDA
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...

What's hot (20)

PDF
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
PPTX
Siggraph 2016 - Vulkan and nvidia : the essentials
PPT
Your Game Needs Direct3D 11, So Get Started Now!
PPTX
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
PPTX
Discover the technology behind "The Heretic" – Unite Copenhagen 2019
PDF
MM-4085, Designing a game audio engine for HSA, by Laurent Betbeder
PPTX
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
PPTX
Universal Render Pipeline and the features used to create the Boat Attack dem...
PDF
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
PDF
Unite 2013 optimizing unity games for mobile platforms
PDF
Choosing an Application framework for Mobile Linux Device
PDF
Away3D update
PDF
Introduce coco2dx with cookingstar
PPSX
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
PDF
IS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
PPT
Data Driven Game development
PDF
The Red One
PDF
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
PDF
Checkerboard Rendering in Dark Souls: Remastered by QLOC
PDF
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Siggraph 2016 - Vulkan and nvidia : the essentials
Your Game Needs Direct3D 11, So Get Started Now!
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Discover the technology behind "The Heretic" – Unite Copenhagen 2019
MM-4085, Designing a game audio engine for HSA, by Laurent Betbeder
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
Universal Render Pipeline and the features used to create the Boat Attack dem...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Unite 2013 optimizing unity games for mobile platforms
Choosing an Application framework for Mobile Linux Device
Away3D update
Introduce coco2dx with cookingstar
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
IS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
Data Driven Game development
The Red One
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
Checkerboard Rendering in Dark Souls: Remastered by QLOC
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
Ad

Similar to GFX Part 2 - Introduction to GPU Programming (20)

PPT
Advanced Graphics Workshop - GFX2011
PPTX
PDF
Open CL For Haifa Linux Club
PPTX
WebGL: The Next Generation
PPT
WebGL: GPU acceleration for the open web
PPTX
OpenGL ES EGL Spec&APIs
PPTX
Sig13 ce future_gfx
PDF
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by Mikael ...
PDF
High performance graphics and computation - OpenGL ES and RenderScript
PDF
Introducao ao Curso Anselmo Cardoso de Paiva Ufma
PPTX
Penn graphics
PDF
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
PPTX
GPU Computing: A brief overview
PDF
Introduction to Computing on GPU
PDF
Compute API –Past & Future
PPTX
HTML5DevConf 2013 (October): WebGL is a game changer!
PDF
OpenGL Spec 4.4 Core
PDF
WebGPU Compute - High Performance Compute Power - The Whats and Whys
PPTX
Cgp lecture2 graphics_standard, opengl
PDF
High Performance Graphics - Introduction to WebGPU - Next Generation of High ...
Advanced Graphics Workshop - GFX2011
Open CL For Haifa Linux Club
WebGL: The Next Generation
WebGL: GPU acceleration for the open web
OpenGL ES EGL Spec&APIs
Sig13 ce future_gfx
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by Mikael ...
High performance graphics and computation - OpenGL ES and RenderScript
Introducao ao Curso Anselmo Cardoso de Paiva Ufma
Penn graphics
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
GPU Computing: A brief overview
Introduction to Computing on GPU
Compute API –Past & Future
HTML5DevConf 2013 (October): WebGL is a game changer!
OpenGL Spec 4.4 Core
WebGPU Compute - High Performance Compute Power - The Whats and Whys
Cgp lecture2 graphics_standard, opengl
High Performance Graphics - Introduction to WebGPU - Next Generation of High ...
Ad

More from Prabindh Sundareson (20)

PDF
Synthetic Data and Graphics Techniques in Robotics
PDF
Work and Life
PPTX
GPU Algorithms and trends 2018
PPTX
Machine learning in the Indian Context - IEEE talk at SRM Institute
PDF
Students Hackathon - 2017
PPTX
ICCE Asia 2017 - Program Outline
PDF
Call for Papers - ICCE Asia 2017
PDF
Technology, Innovation - A Perspective
PDF
Open Shading Language (OSL)
PDF
IEEE - Consumer Electronics Trends Opportunities (2015)
PPTX
GFX Part 6 - Introduction to Vertex and Fragment Shaders in OpenGL ES
PPTX
GFX Part 4 - Introduction to Texturing in OpenGL ES
PPTX
GFX Part 3 - Vertices and interactions in OpenGL
PPTX
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
PPTX
John Carmack talk at SMU, April 2014 - Virtual Reality
PPTX
GFX2014 OpenGL ES Quiz
PPTX
Gfx2014 Graphics Workshop - Lab manual
PPTX
Render to Texture with Three.js
PPTX
ANGLE on Windows for OpenGLES2.0
PPTX
Yocto usage for Graphics SDK on AM335x
Synthetic Data and Graphics Techniques in Robotics
Work and Life
GPU Algorithms and trends 2018
Machine learning in the Indian Context - IEEE talk at SRM Institute
Students Hackathon - 2017
ICCE Asia 2017 - Program Outline
Call for Papers - ICCE Asia 2017
Technology, Innovation - A Perspective
Open Shading Language (OSL)
IEEE - Consumer Electronics Trends Opportunities (2015)
GFX Part 6 - Introduction to Vertex and Fragment Shaders in OpenGL ES
GFX Part 4 - Introduction to Texturing in OpenGL ES
GFX Part 3 - Vertices and interactions in OpenGL
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
John Carmack talk at SMU, April 2014 - Virtual Reality
GFX2014 OpenGL ES Quiz
Gfx2014 Graphics Workshop - Lab manual
Render to Texture with Three.js
ANGLE on Windows for OpenGLES2.0
Yocto usage for Graphics SDK on AM335x

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Electronic commerce courselecture one. Pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectroscopy.pptx food analysis technology
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Mobile App Security Testing_ A Comprehensive Guide.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

GFX Part 2 - Introduction to GPU Programming

  • 2. 2014THE C,F,F (CLEAR, FLUSH, FINISH) APIS  Clear  Clears the current target view area (entire screen – FBO or Fb)  Is that it ?  Sequence 1  Draw something <frame1>  Draw something <frame2>  Sequence 2  Draw something <frame1>  Clear  Draw something <frame2>  The role of the GPU internal cache / fast memory  Engine by default reads back from fb  By specifying “Clear” – the engine can eliminate reads  Further extensions allow discard as well  Viewport determines the draw area
  • 3. 2014FLUSH, AND FINISH  Several types of rendering methods adopted by GPUs  Immediate rendering  Deferred rendering  Immediate rendering – everyone is happy  Except the memory bus!  Deferred – the GPU applies its “intelligence” to do/not do certain draw calls/ portions of draw calls  Used most commonly in embedded GPUs  No concept of “bit exactness” in Graphics rendering  Hence, some API calls may not finish intended operations  Flush() – The call ensures pending operations are kicked off, returns  Finish() – The call ensures pending operations are kicked off, “waits for completion”, returns
  • 4. 2014A NOTE ON WEBGL – VS NATIVE CODE  In native code, need to handle creation of a Display, Surface, Context  For example, refer to this native code (sgxperf)  eglGetDisplay  eglInitialize – for this display  eglBindAPI – bind to GLES/ VG context  eglChooseConfig – configure surface type, GLES1/2/VG, Depth/Stencil buffer size  eglCreateWindowSurface / eglCreatePixmapSurface  eglCreateContext  eglMakeCurrent  eglSwapBuffers  But Platform initialisation in WebGL is handled by browser  Only configurations are – stencil, depth, AA, Alpha, preserve  No EGL calls in JS application code  No multi-threading issues (not yet, but “workers” are coming)  The hands on labs will focus on GL (rendering), not EGL (platform) Lab framework
  • 5. 2014 FUNCTIONS/API CALLS TO BE MODIFIED IN THE FRAMEWORK  Provided in the workshop notes 5 Lab
  • 6. PROGRAMMING  ClearColor  Clear – clears with color specified earlier  Flush/ Finish   First Lab Exercise
  • 7. 2014LAB L1 – CLEAR COLOUR, VIEWPORT 7 (Clone Lab) (Edit Render code) (Launch Personal Lab) (Relaunch after Edit) (Launch Lab)