GFX Part 2 - Introduction to GPU Programming

  • 163 views
Uploaded on

GFX Part 2 - Introduction to GPU Programming and APIs

GFX Part 2 - Introduction to GPU Programming and APIs

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
163
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
14
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. PROGRAMMING THE GPU
  • 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)