GFX Part 2 - Introduction to GPU Programming

570 views
443 views

Published on

GFX Part 2 - Introduction to GPU Programming and APIs

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
570
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
22
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

GFX Part 2 - Introduction to GPU Programming

  1. 1. PROGRAMMING THE GPU
  2. 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. 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. 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. 5. 2014 FUNCTIONS/API CALLS TO BE MODIFIED IN THE FRAMEWORK  Provided in the workshop notes 5 Lab
  6. 6. PROGRAMMING  ClearColor  Clear – clears with color specified earlier  Flush/ Finish   First Lab Exercise
  7. 7. 2014LAB L1 – CLEAR COLOUR, VIEWPORT 7 (Clone Lab) (Edit Render code) (Launch Personal Lab) (Relaunch after Edit) (Launch Lab)

×