1 \documentclass[usenames,dvipsnames]{beamer}
2 \usepackage[font=small,skip=-1pt]{caption}
4 \usepackage{color, colortbl}
11 \usepackage{tgpagella}
12 \usepackage[utf8]{inputenc}
14 \usepackage{tabularx, array, booktabs}
18 \usepackage{adjustbox}
20 \newcommand\topalign[1]{%
22 \raisebox{\dimexpr-\ht0+\dp0\relax}{\usebox0}}
24 \definecolor{blond}{rgb}{0.98, 0.94, 0.75}
25 \definecolor{beige}{rgb}{0.96, 0.96, 0.86}
26 \definecolor{mGreen}{rgb}{0,0.6,0}
27 \definecolor{mGray}{rgb}{0.5,0.5,0.5}
28 \definecolor{mPurple}{rgb}{0.58,0,0.82}
29 \definecolor{bgcolor}{rgb}{0.8,0.8,0.8}
30 \definecolor{afblue}{rgb}{0.46, 0.64, 0.76}
31 \definecolor{coolblack}{rgb}{0.0, 0.18, 0.39}
32 \definecolor{paleaqua}{rgb}{0.74, 0.83, 0.9}
33 \definecolor{platinum}{rgb}{0.9, 0.89, 0.89}
34 \definecolor{whitesmoke}{rgb}{0.96, 0.96, 0.96}
35 \definecolor{carolinablue}{rgb}{0.6, 0.73, 0.89}
36 \definecolor{amber}{rgb}{1.0, 0.75, 0.0}
37 \definecolor{deepjunglegreen}{rgb}{0.0, 0.29, 0.29}
38 \definecolor{mediumred-violet}{rgb}{0.73, 0.2, 0.52}
39 \definecolor{babypink}{rgb}{0.96, 0.76, 0.76}
40 \definecolor{beaublue}{rgb}{0.74, 0.83, 0.9}
41 \definecolor{bananayellow}{rgb}{1.0, 0.88, 0.21}
42 \definecolor{bananamania}{rgb}{0.98, 0.91, 0.81}
43 \definecolor{crimsonglory}{rgb}{0.75, 0.0, 0.2}
45 \lstdefinestyle{CStyle}{
46 language=C++, % choose the language of the code
47 % basicstyle=\footnotesize, % the size of the fonts that are used for the code
48 basicstyle=\tt\color{afblue},
49 breakatwhitespace=false,
51 backgroundcolor=\color{bgcolor}, % choose the background color. You must add \usepackage{color}
52 showspaces=false, % show spaces adding particular underscores
53 showstringspaces=false, % underline spaces within strings
54 showtabs=false, % show tabs within strings adding particular underscores
55 frame=single, % adds a frame around the code
56 tabsize=2, % sets default tabsize to 2 spaces
57 captionpos=b, % sets the caption-position to bottom
58 breaklines=true, % sets automatic line breaking
59 breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
60 commentstyle=\color{mGreen},
61 keywordstyle=\color{magenta},
62 stringstyle=\color{mPurple},
63 rulesepcolor=\color{gray},
64 rulecolor=\color{black},
67 \setmainfont{Noto Sans} % substitute with any font that exists on your system
68 \setsansfont{Noto Sans} % substitute with any font that exists on your system
69 \setmonofont{Noto Sans Mono Medium} % substitute with any font that exists on your system
72 \useoutertheme{infolines}
75 \captionsetup[figure]{labelformat=empty}
77 \addtobeamertemplate{headline}{}{\vskip2pt}
78 \addtobeamertemplate{headline}{}{%
79 \begin{textblock*}{5mm}(.9\textwidth,-0.6cm)
80 \includegraphics[height=0.67cm]{data/igalia-logo.png}
83 \definecolor{links}{rgb}{0.1, 0.3, 0.6}
84 \hypersetup{colorlinks,linkcolor=,urlcolor=links}
86 \pgfdeclareimage[height=\paperheight]{igaliabglight}{data/igalia_bg_light.eps}
87 \pgfdeclareimage[height=\paperheight]{igaliabg}{data/igaliabg.eps}
89 %\setbeamertemplate{title page}{
90 % \begin{picture}(-90, 180)
92 % \pgfuseimage{igaliabg}
96 % \begin{minipage}[b][36mm][t]{240mm}
97 % \usebeamerfont{title}{\inserttitle\par}
98 % \usebeamerfont{author}{\insertauthor\par}
99 % \usebeamerfont{title}{\insertinstitute\par}
105 \setbeamertemplate{navigation symbols}{}
106 \setbeamertemplate{title page}{
109 \pgfuseimage{igaliabg}
113 \begin{minipage}[b][38mm][t]{220mm}
114 \usebeamerfont{title}{\inserttitle\par}
115 \usebeamerfont{author}{\insertauthor\par}
120 \usebeamerfont{date}{\huge{{\insertdate}}\par}
125 \setbeamertemplate{itemize items}[triangle]
126 \setbeamertemplate{itemize subitem}[circle]
127 \setbeamerfont{frametitle}{size=\small}
129 \setbeamertemplate{blocks}[default]
130 \setbeamercolor{block title}{fg=amber,bg=black}
132 \title{\textbf{Sharing texture data between drivers}}
133 \author[Eleni Maria Stea <estea@igalia.com>]{\small{Eleni Maria Stea
134 <estea@igalia.com>}\\\\\includegraphics{data/igalia.eps}}
135 \date{\tiny{WebKit Codecamp}}
141 \tableofcontents[currentsection]
145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161 \begin{frame}[fragile,c]
168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
169 \section[Introduction]{Introduction: Using ANGLE in WebGL2}
170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
172 \begin{frame}[fragile,c]
173 \frametitle{A few words about ANGLE}
174 \center{\textbf{\color{coolblack}{ANGLE is an EGL/GLESv2 implementation}}}
176 \setbeamertemplate{itemize/enumerate body begin}{\footnotesize}
177 \setbeamertemplate{itemize/enumerate subbody begin}{\tiny}
178 \setbeamertemplate{itemize/enumerate subsubbody begin}{\tiny}
179 \setbeamertemplate{itemize items}[triangle]
180 \setbeamertemplate{blocks}[rounded][shadow]
182 \begin{block}{\color{afblue}{\footnotesize\textbf{EGL/GLESv2}:}}
184 \item GLESv2 is used to render graphics using the GPU (graphics
186 \item EGL is used to create a GLESv2 context.
191 \begin{block}{\color{afblue}{\footnotesize\textbf{ANGLE EGL/GLESv2}:}}
193 \item GLESv2 is implemented on top of other APIs (OpenGL,
194 Vulkan, GLESv2). EGL too (EGL, GLX, gbm, headless display).
195 \item Users can select the most convenient backend using some
196 \textit{ANGLE EGL extensions} (\texttt{eglext\_angle.h}) that
197 provide extra attributes to some standard EGL API stucts.
198 \item Primary purpose of ANGLE is to provide EGL/GLESv2 to systems
206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 \begin{frame}[fragile,c]
209 \frametitle{Using ANGLE in WebKit}
211 \center{\textbf{\color{coolblack}{Using ANGLE (EGL/GLESv2 backend) in WebGL2 }}}
214 \setbeamertemplate{itemize/enumerate body begin}{\footnotesize}
215 \setbeamertemplate{itemize/enumerate subbody begin}{\tiny}
216 \setbeamertemplate{itemize/enumerate subsubbody begin}{\tiny}
217 \setbeamertemplate{itemize items}[triangle]
218 \setbeamertemplate{blocks}[rounded][shadow]
221 \begin{block}{\color{afblue}{\footnotesize\textbf{Reasons}:}}
223 \item better performance (Žan Doberšek)
224 \item it'll be mostly a wrapper around the native driver (Linux mesa
225 drivers implement GLESv2, Linux desktop provides libGLES*)
228 \begin{block}{\color{afblue}{\footnotesize\textbf{Problem}:}}
230 \item ANGLE renders on a GLESv2 texture created by ANGLE context
231 \item WebKit graphics pipeline components use OpenGL textures that
232 are composited by the WebKit compositor
233 \item We are currently \textbf{\textit{copying}} the ANGLE texture data to
234 an OpenGL texture to assemble the final image and this is
235 \textbf{\textit{slow}}!
239 \center{\textbf{\color{coolblack}{We need to replace this copy with
245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247 \begin{frame}[fragile,c]
248 \frametitle{Experiments on Linux}
254 \item {\color{coolblack}\textbf{Use ANGLE and EGL in the same program:
255 create 2 X11 windows, and draw 2 images from 2 different contexts
256 by 2 different drivers.}
258 \tiny{{(In several cases ANGLE behaves
259 different from EGL: e.g. when \texttt{eglMakeCurrent} doesn't
260 call \texttt{eglMakeCurrent}!!).}}
262 \item {\color{coolblack}\textbf{Fix the problem with shared
263 context and shared textures.}
266 modifications in ANGLE OpenGL driver, writing an ANGLE extension, forcing the
267 EGL/OpenGL backend, and it wouldn't work with multiple
270 \item {\color{coolblack}\textbf{Fix the problem by sharing a Linux kernel
271 dma-buf buffer across drivers.}
273 \tiny{{(drivers must support some EGL/GL extensions, but both mesa and
274 ANGLE support them)}}
276 \item {\color{coolblack}\textbf{Solve the multiple processes case.}
278 \tiny{{(we need some sort of IPC to exchange the dma-buf FD)}}
284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288 \section[Experiment 1]{Experiment 1: Using ANGLE and the native system driver in the same
290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
292 \begin{frame}[fragile,c]
293 \frametitle{Step 1: Setting up to debug ANGLE with GDB}
298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
300 \begin{frame}[fragile,c]
301 \frametitle{Step 2: Contexts from two drivers in the same
307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
309 \section[Experiment 2]{Experiment 2: Sharing a texture across drivers using shared context}
310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
313 \section[Experiment 3]{Experiment 3: Sharing texture data across drivers using kernel DMA buffers}
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 \section[Multiple Processes]{Multiple Processes}
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320 \begin{frame}[fragile,c]
321 \frametitle{What if WebGL and Graphics pipeline were separate processes?}
322 \setbeamertemplate{blocks}[rounded]
326 \textbf{\small{There is a plan to split the main graphics pipeline and the WebGL2
327 pipeline in two processes. (Žan Doberšek)}}}
330 \begin{block}{Can we still use shared DMA buffers?}
335 \item {\color{coolblack} \textbf{YES!} DMA buffers can be shared across
337 \item {\color{coolblack} But we need some sort of \textit{interprocess
338 communication} to exchange the file descriptor.}
339 \item {\color{coolblack} This is a client-server example that uses unix
340 sockets to pass the dma-buf FD from one process to the other:
341 \url{https://gitlab.com/blaztinn/dma-buf-texture-sharing}. It could
342 be adapted to our needs when we switch to multiple processes.}
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
352 \section[WebKit Integration]{WebKit Integration}
353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355 \begin{frame}[fragile,c]
356 \frametitle{WIP WebKit:}
357 \setbeamertemplate{blocks}[rounded]
359 \normalsize{\textbf{\color{coolblack}{Ongoing work on WebKit}}}
364 \small{\color{deepjunglegreen}{Building WebKit with ANGLE on Linux was problematic.\\
365 Before starting the task some other fixes were necessary:}}
369 \begin{block}{DONE/WIP/TODO}
372 \item{Use the right CMake options (one can't simply enable
373 \texttt{USE\_ANGLE\_WEBGL} ☺):
374 \color{coolblack}{\textbf{FIXED }}}
375 \item{Compile errors when ANGLE is used:
376 \color{coolblack}{\textbf{FIXED}}}
377 \item{Link errors when ANGLE is used:
378 \color{coolblack}{\textbf{WIP/Partially FIXED}}}
379 \item{Copy replacement: \color{coolblack}{\textbf{TODO}}}
385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386 \section[References]{References}
387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388 %\setbeamertemplate{bibliography entry title}{}
389 %\setbeamertemplate{bibliography entry location}{}
390 %\setbeamertemplate{bibliography entry note}{}
391 \setbeamerfont{bibliography item}{size=\footnotesize}
392 \setbeamerfont{bibliography entry author}{size=\footnotesize}
393 \setbeamerfont{bibliography entry title}{size=\footnotesize}
394 \setbeamerfont{bibliography entry year}{size=\footnotesize}
395 \setbeamerfont{bibliography entry note}{size=\footnotesize}
397 \begin{frame}[allowframebreaks]
399 \bibliographystyle{unsrt}
400 \bibliography{bib/references.bib}
404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%