SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
i965g - DRAFT


                               Chia-I Wu

                               olv@lunarg.com



                              Feb 14, 2013




Chia-I Wu (olv@lunarg.com)      i965g - DRAFT   Feb 14, 2013   1 / 25
Overview


When is it developed?




   when the baby naps: 30 to 60 minutes a time, two times a day
   to work on something bigger: use the sleeping hours
   the progress is slow




   Chia-I Wu (olv@lunarg.com)        i965g - DRAFT                Feb 14, 2013   2 / 25
Overview


When is it developed?




   Chia-I Wu (olv@lunarg.com)     i965g - DRAFT   Feb 14, 2013   3 / 25
Overview


When is it developed?




   Chia-I Wu (olv@lunarg.com)     i965g - DRAFT   Feb 14, 2013   4 / 25
Overview


How is the quality?




    rely solely on Piglit for testing
    the skeleton is kept solid
    the details are ugly sometimes
          duplicated code
          long functions
          deep nested loops




   Chia-I Wu (olv@lunarg.com)             i965g - DRAFT   Feb 14, 2013   5 / 25
Overview


Current Status




   at OpenGL 2.1
   to have OpenGL 3.0,
          GL EXT transform feedback (almost done)
          MSAA
   OpenGL 3.1 (the latest version supported by Mesa)
          primitive restart
          instanced drawing
          texture buffer objects
          uniform buffer objects
          these are small in terms of changes needed in i965g pipe driver




   Chia-I Wu (olv@lunarg.com)              i965g - DRAFT                    Feb 14, 2013   6 / 25
Linux Graphics


Graphics Drivers on Linux




    DRM driver
          mode setting
          buffer allocation
          command submission
          synchronization
          ...
    a user space library to communicate with the DRM driver
    Xorg video driver
    OpenGL driver



   Chia-I Wu (olv@lunarg.com)           i965g - DRAFT         Feb 14, 2013   7 / 25
Linux Graphics


OpenGL drivers




   GLX
           equivalent to WGL on Windows
           dlopen() DRI drivers
           the trend is to replace it with EGL
   glapi
           provide GL entrypoints that can jump into the DRI driver
           glXGetProcAddress() (or eglGetProcAddress())
   DRI driver




   Chia-I Wu (olv@lunarg.com)                  i965g - DRAFT          Feb 14, 2013   8 / 25
Linux Graphics


DRI drivers




    core mesa
          common code shared by all drivers
          set GL error as required by the spec
          context state bookkeeping
          emulate non-HW features (display list, vertex specificaion, and etc.)
          many more
    GLSL frontend
    HW-specific driver code




   Chia-I Wu (olv@lunarg.com)                i965g - DRAFT                       Feb 14, 2013   9 / 25
Linux Graphics


i965g




   i965g replaces only the HW-specific driver code
          not the DRM driver
          not the Xorg video driver
          not the GLSL frontend nor mesa core in the DRI driver




   Chia-I Wu (olv@lunarg.com)               i965g - DRAFT         Feb 14, 2013   10 / 25
Linux Graphics


i965g: components




   mesa state tracker
          translate OpenGL states/commands/shaders to pipe states, functions, and TGSI
   DRI state tracker
          implement DRI driver model
   i965g pipe driver and winsys




   Chia-I Wu (olv@lunarg.com)               i965g - DRAFT                    Feb 14, 2013   11 / 25
Linux Graphics


i965g: winsys and pipe driver




    winsys is the OS-dependent part
    pipe driver is the OS-independent part
    all window system dependencies are handled in GLX


   Chia-I Wu (olv@lunarg.com)            i965g - DRAFT   Feb 14, 2013   12 / 25
i965g


State Trackers




A state tracker implements an well-defined API using a pipe driver. It tracks the states
defined and manipulated by the API, and translates them to pipe states.
    mesa state tracker implements OpenGL 3.1
    vega state tracker implements OpenVG 1.1
    clover state tracker implements OpenCL 1.1
    xorg state tracker implements Xorg video driver model




    Chia-I Wu (olv@lunarg.com)          i965g - DRAFT                      Feb 14, 2013   13 / 25
i965g


Pipe States
State trackers translate API states to pipe states, which are defined by C structs. For
example, the blend pipe state,




    Chia-I Wu (olv@lunarg.com)          i965g - DRAFT                      Feb 14, 2013   14 / 25
i965g


Pipe States, cont’d




   Chia-I Wu (olv@lunarg.com)   i965g - DRAFT   Feb 14, 2013   15 / 25
i965g


Pipe States, cont’d




Some translations are less trivial
     Each shader is translated into assembly-like TGSI instructions
     For each GL texture unit used in a shader, a pipe sampler state and a
     pipe sampler view are created




    Chia-I Wu (olv@lunarg.com)          i965g - DRAFT                   Feb 14, 2013   16 / 25
i965g


Pipe States, cont’d




Pipe states are defined in a way such that they are close to what the GPUs expect
    pipe drivers can handle them easily and efficiently
    pipe drivers do not need to know anything about state trackers and the APIs they
    support




    Chia-I Wu (olv@lunarg.com)        i965g - DRAFT                      Feb 14, 2013   17 / 25
i965g


i965g pipe driver




    resource (texture/buffer) allocation
    sync/query objects
    blitter
    TGSI compiler
    state emission
Most functions are independent. The one that connects all together is how HW states
are emitted.




    Chia-I Wu (olv@lunarg.com)            i965g - DRAFT                 Feb 14, 2013   18 / 25
i965g


State Emission

When a pipe state is changed, remember the new state (simple C struct) and mark it
dirty.




    Chia-I Wu (olv@lunarg.com)        i965g - DRAFT                     Feb 14, 2013   19 / 25
i965g


State Emission, cont’d




Just before drawing anything,
    call i965 finalize states() to resolve non-orthogonal pipe states, potentially
    marking more pipe states dirty
    emit all HW states that are affected by the dirty pipe states




    Chia-I Wu (olv@lunarg.com)         i965g - DRAFT                    Feb 14, 2013   20 / 25
i965g


State Emission, cont’d




i965 3d, the 3D pipeline, knows which pipe states affect which HW states. It checks the
dirty flags and decide which HW states need to be emitted.
For example,




    Chia-I Wu (olv@lunarg.com)        i965g - DRAFT                     Feb 14, 2013   21 / 25
i965g


State Emission, cont’d
i965 gpe, the GPE (Graphics Processing Engine), is in charge of adding the HW state or
command to the command parser.




    Chia-I Wu (olv@lunarg.com)        i965g - DRAFT                     Feb 14, 2013   22 / 25
i965g


State Emission, cont’d
i965 cp, the command parser, will send the commands to GPU for execution when its
buffer is full or when the state trackers ask the pipe driver to flush.




    Chia-I Wu (olv@lunarg.com)       i965g - DRAFT                    Feb 14, 2013   23 / 25
i965g


Future Directions




    GEN7+ support
    OpenCL 1.1 support
    support OpenGL 3.0 and 3.1
    pick an application for performance tuning




   Chia-I Wu (olv@lunarg.com)         i965g - DRAFT   Feb 14, 2013   24 / 25
i965g


Links




For i965g,
 https://github.com/olvaffe/mesa/tree/i965g-next

For information about the kernel driver,
 http://blog.ffwll.ch/2012/10/i915gem-crashcourse.html

For information about the 2D driver,
 http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/




   Chia-I Wu (olv@lunarg.com)   i965g - DRAFT                Feb 14, 2013   25 / 25

Contenu connexe

Tendances

OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
Skia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsSkia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsKyungmin Lee
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineMark Kilgard
 
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDTThesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDTTuononenP
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
OpenGL Based Testing Tool Architecture for Exascale Computing
OpenGL Based Testing Tool Architecture for Exascale ComputingOpenGL Based Testing Tool Architecture for Exascale Computing
OpenGL Based Testing Tool Architecture for Exascale ComputingCSCJournals
 
D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...Mark Kilgard
 
TSC BoF: OSS Toolchain Discussion - SFO17-409
TSC BoF: OSS Toolchain Discussion - SFO17-409TSC BoF: OSS Toolchain Discussion - SFO17-409
TSC BoF: OSS Toolchain Discussion - SFO17-409Linaro
 
A Follow-up Cg Runtime Tutorial for Readers of The Cg Tutorial
A Follow-up Cg Runtime Tutorial for Readers of The Cg TutorialA Follow-up Cg Runtime Tutorial for Readers of The Cg Tutorial
A Follow-up Cg Runtime Tutorial for Readers of The Cg TutorialMark Kilgard
 
Porting the Source Engine to Linux: Valve's Lessons Learned
Porting the Source Engine to Linux: Valve's Lessons LearnedPorting the Source Engine to Linux: Valve's Lessons Learned
Porting the Source Engine to Linux: Valve's Lessons Learnedbasisspace
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMark Kilgard
 
Ostech war story using mainline linux for an android tv bsp
Ostech  war story  using mainline linux  for an android tv bspOstech  war story  using mainline linux  for an android tv bsp
Ostech war story using mainline linux for an android tv bspNeil Armstrong
 
OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1Luca Garulli
 

Tendances (20)

OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
Open gl
Open glOpen gl
Open gl
 
Skia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsSkia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics Essentials
 
Qt Programming on TI Processors
Qt Programming on TI ProcessorsQt Programming on TI Processors
Qt Programming on TI Processors
 
OpenGL basics
OpenGL basicsOpenGL basics
OpenGL basics
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
 
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDTThesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
OpenGL Based Testing Tool Architecture for Exascale Computing
OpenGL Based Testing Tool Architecture for Exascale ComputingOpenGL Based Testing Tool Architecture for Exascale Computing
OpenGL Based Testing Tool Architecture for Exascale Computing
 
D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...
 
Cg in Two Pages
Cg in Two PagesCg in Two Pages
Cg in Two Pages
 
Opengl (1)
Opengl (1)Opengl (1)
Opengl (1)
 
Programming with OpenGL
Programming with OpenGLProgramming with OpenGL
Programming with OpenGL
 
TSC BoF: OSS Toolchain Discussion - SFO17-409
TSC BoF: OSS Toolchain Discussion - SFO17-409TSC BoF: OSS Toolchain Discussion - SFO17-409
TSC BoF: OSS Toolchain Discussion - SFO17-409
 
A Follow-up Cg Runtime Tutorial for Readers of The Cg Tutorial
A Follow-up Cg Runtime Tutorial for Readers of The Cg TutorialA Follow-up Cg Runtime Tutorial for Readers of The Cg Tutorial
A Follow-up Cg Runtime Tutorial for Readers of The Cg Tutorial
 
Porting the Source Engine to Linux: Valve's Lessons Learned
Porting the Source Engine to Linux: Valve's Lessons LearnedPorting the Source Engine to Linux: Valve's Lessons Learned
Porting the Source Engine to Linux: Valve's Lessons Learned
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
Open gl introduction
Open gl introduction Open gl introduction
Open gl introduction
 
Ostech war story using mainline linux for an android tv bsp
Ostech  war story  using mainline linux  for an android tv bspOstech  war story  using mainline linux  for an android tv bsp
Ostech war story using mainline linux for an android tv bsp
 
OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1
 

En vedette

Kernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernelKernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernelAnne Nicolas
 
GLX, DRI, and i965
GLX, DRI, and i965GLX, DRI, and i965
GLX, DRI, and i965Chia-I Wu
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverAnne Nicolas
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewMoriyoshi Koizumi
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningAnne Nicolas
 
De-mystifying DRM
De-mystifying DRMDe-mystifying DRM
De-mystifying DRMcastLabs
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLinaro
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateLinaro
 
X Window System
X Window SystemX Window System
X Window SystemRon Bandes
 

En vedette (9)

Kernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernelKernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernel
 
GLX, DRI, and i965
GLX, DRI, and i965GLX, DRI, and i965
GLX, DRI, and i965
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driver
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
 
De-mystifying DRM
De-mystifying DRMDe-mystifying DRM
De-mystifying DRM
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
 
X Window System
X Window SystemX Window System
X Window System
 

Similaire à I965g

13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGLJungsoo Nam
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochKernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochAnne Nicolas
 
FPGA, GPU and ALU
FPGA, GPU and ALUFPGA, GPU and ALU
FPGA, GPU and ALUITVoyagers
 
GPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf AtlantaGPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf AtlantaJanie Clayton
 
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)Igalia
 
mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018정대 천
 
WT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon WoodsWT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon WoodsAMD Developer Central
 
Dynamic sorting algorithm vizualizer.pdf
Dynamic sorting algorithm vizualizer.pdfDynamic sorting algorithm vizualizer.pdf
Dynamic sorting algorithm vizualizer.pdfAgneshShetty
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2Linaro
 
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...AMD Developer Central
 
Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0Leszek Godlewski
 
3D on the Web in 2011
3D on the Web in 20113D on the Web in 2011
3D on the Web in 2011Chad Austin
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGLMegha V
 
GPU Programming 360iDev
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDevJanie Clayton
 

Similaire à I965g (20)

OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
Regal
RegalRegal
Regal
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochKernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
 
FPGA, GPU and ALU
FPGA, GPU and ALUFPGA, GPU and ALU
FPGA, GPU and ALU
 
GPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf AtlantaGPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf Atlanta
 
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)
 
mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018
 
WT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon WoodsWT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
 
Realizing OpenGL
Realizing OpenGLRealizing OpenGL
Realizing OpenGL
 
Dynamic sorting algorithm vizualizer.pdf
Dynamic sorting algorithm vizualizer.pdfDynamic sorting algorithm vizualizer.pdf
Dynamic sorting algorithm vizualizer.pdf
 
SNAP MACHINE LEARNING
SNAP MACHINE LEARNINGSNAP MACHINE LEARNING
SNAP MACHINE LEARNING
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2
 
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
 
Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0
 
3D on the Web in 2011
3D on the Web in 20113D on the Web in 2011
3D on the Web in 2011
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGL
 
GPU Programming 360iDev
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDev
 

I965g

  • 1. i965g - DRAFT Chia-I Wu olv@lunarg.com Feb 14, 2013 Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 1 / 25
  • 2. Overview When is it developed? when the baby naps: 30 to 60 minutes a time, two times a day to work on something bigger: use the sleeping hours the progress is slow Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 2 / 25
  • 3. Overview When is it developed? Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 3 / 25
  • 4. Overview When is it developed? Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 4 / 25
  • 5. Overview How is the quality? rely solely on Piglit for testing the skeleton is kept solid the details are ugly sometimes duplicated code long functions deep nested loops Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 5 / 25
  • 6. Overview Current Status at OpenGL 2.1 to have OpenGL 3.0, GL EXT transform feedback (almost done) MSAA OpenGL 3.1 (the latest version supported by Mesa) primitive restart instanced drawing texture buffer objects uniform buffer objects these are small in terms of changes needed in i965g pipe driver Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 6 / 25
  • 7. Linux Graphics Graphics Drivers on Linux DRM driver mode setting buffer allocation command submission synchronization ... a user space library to communicate with the DRM driver Xorg video driver OpenGL driver Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 7 / 25
  • 8. Linux Graphics OpenGL drivers GLX equivalent to WGL on Windows dlopen() DRI drivers the trend is to replace it with EGL glapi provide GL entrypoints that can jump into the DRI driver glXGetProcAddress() (or eglGetProcAddress()) DRI driver Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 8 / 25
  • 9. Linux Graphics DRI drivers core mesa common code shared by all drivers set GL error as required by the spec context state bookkeeping emulate non-HW features (display list, vertex specificaion, and etc.) many more GLSL frontend HW-specific driver code Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 9 / 25
  • 10. Linux Graphics i965g i965g replaces only the HW-specific driver code not the DRM driver not the Xorg video driver not the GLSL frontend nor mesa core in the DRI driver Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 10 / 25
  • 11. Linux Graphics i965g: components mesa state tracker translate OpenGL states/commands/shaders to pipe states, functions, and TGSI DRI state tracker implement DRI driver model i965g pipe driver and winsys Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 11 / 25
  • 12. Linux Graphics i965g: winsys and pipe driver winsys is the OS-dependent part pipe driver is the OS-independent part all window system dependencies are handled in GLX Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 12 / 25
  • 13. i965g State Trackers A state tracker implements an well-defined API using a pipe driver. It tracks the states defined and manipulated by the API, and translates them to pipe states. mesa state tracker implements OpenGL 3.1 vega state tracker implements OpenVG 1.1 clover state tracker implements OpenCL 1.1 xorg state tracker implements Xorg video driver model Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 13 / 25
  • 14. i965g Pipe States State trackers translate API states to pipe states, which are defined by C structs. For example, the blend pipe state, Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 14 / 25
  • 15. i965g Pipe States, cont’d Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 15 / 25
  • 16. i965g Pipe States, cont’d Some translations are less trivial Each shader is translated into assembly-like TGSI instructions For each GL texture unit used in a shader, a pipe sampler state and a pipe sampler view are created Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 16 / 25
  • 17. i965g Pipe States, cont’d Pipe states are defined in a way such that they are close to what the GPUs expect pipe drivers can handle them easily and efficiently pipe drivers do not need to know anything about state trackers and the APIs they support Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 17 / 25
  • 18. i965g i965g pipe driver resource (texture/buffer) allocation sync/query objects blitter TGSI compiler state emission Most functions are independent. The one that connects all together is how HW states are emitted. Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 18 / 25
  • 19. i965g State Emission When a pipe state is changed, remember the new state (simple C struct) and mark it dirty. Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 19 / 25
  • 20. i965g State Emission, cont’d Just before drawing anything, call i965 finalize states() to resolve non-orthogonal pipe states, potentially marking more pipe states dirty emit all HW states that are affected by the dirty pipe states Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 20 / 25
  • 21. i965g State Emission, cont’d i965 3d, the 3D pipeline, knows which pipe states affect which HW states. It checks the dirty flags and decide which HW states need to be emitted. For example, Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 21 / 25
  • 22. i965g State Emission, cont’d i965 gpe, the GPE (Graphics Processing Engine), is in charge of adding the HW state or command to the command parser. Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 22 / 25
  • 23. i965g State Emission, cont’d i965 cp, the command parser, will send the commands to GPU for execution when its buffer is full or when the state trackers ask the pipe driver to flush. Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 23 / 25
  • 24. i965g Future Directions GEN7+ support OpenCL 1.1 support support OpenGL 3.0 and 3.1 pick an application for performance tuning Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 24 / 25
  • 25. i965g Links For i965g, https://github.com/olvaffe/mesa/tree/i965g-next For information about the kernel driver, http://blog.ffwll.ch/2012/10/i915gem-crashcourse.html For information about the 2D driver, http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/ Chia-I Wu (olv@lunarg.com) i965g - DRAFT Feb 14, 2013 25 / 25