\documentclass[usenames,dvipsnames]{beamer}
\usepackage[font=small,skip=-1pt]{caption}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{comment}
\usepackage{textpos}
\usepackage{tgpagella}
\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\usepackage{tabularx}
\usepackage{cite}

\definecolor{mGreen}{rgb}{0,0.6,0}
\definecolor{mGray}{rgb}{0.5,0.5,0.5}
\definecolor{mPurple}{rgb}{0.58,0,0.82}
\definecolor{bgcolor}{rgb}{0.8,0.8,0.8}
\definecolor{afblue}{rgb}{0.26, 0.44, 0.56}
\definecolor{coolblack}{rgb}{0.0, 0.18, 0.39}

\lstdefinestyle{CStyle}{
	language=C++,                % choose the language of the code
%	basicstyle=\footnotesize,       % the size of the fonts that are used for the code
	basicstyle=\tt\color{afblue},
    breakatwhitespace=false,         
    breaklines=true,                 
	backgroundcolor=\color{bgcolor},  % choose the background color. You must add \usepackage{color}
	showspaces=false,               % show spaces adding particular underscores
	showstringspaces=false,         % underline spaces within strings
	showtabs=false,                 % show tabs within strings adding particular underscores
	frame=single,           % adds a frame around the code
	tabsize=2,          % sets default tabsize to 2 spaces
	captionpos=b,           % sets the caption-position to bottom
	breaklines=true,        % sets automatic line breaking
	breakatwhitespace=false,    % sets if automatic breaks should only happen at whitespace
    commentstyle=\color{mGreen},
    keywordstyle=\color{magenta},
    stringstyle=\color{mPurple},
	rulesepcolor=\color{gray},
    rulecolor=\color{black},
}

\setmainfont{Noto Sans} % substitute with any font that exists on your system
\setsansfont{Noto Sans} % substitute with any font that exists on your system
\setmonofont{Noto Sans Mono Medium} % substitute with any font that exists on your system

\usetheme{Warsaw}
\useoutertheme{infolines}
\usecolortheme{crane}

\captionsetup[figure]{labelformat=empty}

\addtobeamertemplate{headline}{}{\vskip2pt}
\addtobeamertemplate{headline}{}{%
	\begin{textblock*}{5mm}(.9\textwidth,-0.6cm)
	\includegraphics[height=0.67cm]{data/igalia-logo.png}
\end{textblock*}}

\definecolor{links}{rgb}{0, 0.6, 0}
\hypersetup{colorlinks,linkcolor=,urlcolor=links}

%\pgfdeclareimage[height=\paperheight]{igaliabg}{data/igalia_bg_light.eps}
\pgfdeclareimage[height=\paperheight]{igaliabg}{data/igaliabg.eps}

%\setbeamertemplate{title page}{
%        \begin{picture}(-90, 180)
%			\put(-200, -74){%
%                \pgfuseimage{igaliabg}
%            }
%
%            \put(55,19){%
%				\begin{minipage}[b][36mm][t]{240mm}
%                    \usebeamerfont{title}{\inserttitle\par}
%                    \usebeamerfont{author}{\insertauthor\par}
%                    \usebeamerfont{title}{\insertinstitute\par}
%                \end{minipage}
%            }
%		\end{picture}
%}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{title page}{
        \begin{picture}(0,0)
            \put(-30,-164){%
                \pgfuseimage{igaliabg}
            }

            \put(0,-110.7){%
                \begin{minipage}[b][38mm][t]{220mm}
                    \usebeamerfont{title}{\inserttitle\par}
                    \usebeamerfont{author}{\insertauthor\par}
                \end{minipage}
            }
		\end{picture}
}

\setbeamertemplate{itemize items}[triangle]
\setbeamertemplate{itemize subitem}[circle]
\setbeamerfont{frametitle}{size=\small}

\setbeamertemplate{blocks}[default]
\setbeamercolor{block title}{fg=lightgray,bg=black}
\title{\textbf{OpenGL and Vulkan Interoperability}}
\author[Eleni Maria Stea <estea@igalia.com>]{\small{Eleni Maria Stea
<estea@igalia.com>}\\\\\includegraphics{data/igalia.eps}}
\date{}

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Outline}
	\tableofcontents[currentsection]
  \end{frame}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[plain]
\titlepage
\end{frame}

\begin{frame}
	\frametitle{Outline}
	\tableofcontents
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section[Introduction]{OpenGL and Vulkan interoperability extensions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\frametitle{OpenGL and Vulkan Interoperability}

	\center{\textbf{\color{coolblack}{INTEROPERABILITY}}}
	\vspace{0.5cm}

	The idea is to avoid unnecessary allocations and conversions when we
	exchange texture and buffer data across APIs.\\
	\vspace{0.3cm}
	Interoperability extensions allow us to:\\
	\vspace{0.5cm}

	{\fontsize{10}{10}\selectfont
		\begin{itemize}\setlength\itemsep{0.5cm}
				\item {\color{afblue} \textbf{Allocate} the resources (textures,
					buffers) \textbf{once} from Vulkan.}
				\item {\color{afblue} \textbf{Reuse} them \textbf{several
					times} from both APIs.}
				\item {\color{afblue} \textbf{Synchronize} the APIs access to the
					resources.}
		\end{itemize}
	}
\end{frame}

\begin{frame}
	\frametitle{OpenGL extensions for interoperability}
	
	\center{\textbf{\color{coolblack}{OpenGL EXTENSIONS}}}
	\vspace{0.5cm}

	{\fontsize{10}{10}\selectfont
\begin{itemize}\setlength\itemsep{0.5cm}
		\item {\color{afblue}\textbf{EXT\_external\_object} extension:}
			\begin{itemize}
				\item provides the functions to create GL objects, textures and buffers
					from Vulkan memory.
				\item provides the functions to create GL semaphores that
					correspond to Vulkan ones.
				\item provides the functions for synchronization.
			\end{itemize}
		\item {\color{afblue}\textbf{EXT\_external\_objects\_fd}
			extension:}
			{\fontsize{7}{6}\selectfont
			\begin{itemize}
				\item provides a function to import a file descriptor to the Vulkan
					memory.
				\item provides a function to import a file descriptor to the Vulkan semaphores. 
			\end{itemize}
			}
\end{itemize}
}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section[Interoperability on Mesa]{Additions to Mesa and Piglit}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\frametitle{Additions to Mesa}

	\center{
		\normalsize{\textbf{\color{coolblack}{Igalia's contributions to Mesa
	drivers}}}
	}

	\tiny{
		\begin{table}
			\begin{tabularx}{\textwidth}{|l|X|l|}
				\hline 
				Driver & Igalia's Contributions & Status \\
				\hline 
				iris & implemented EXT\_external\_objects, EXT\_external\_objects\_fd & under review \\
				freedreno & implemented EXT\_external\_objects,
				EXT\_external\_objects\_fd & upstream \\
				radeonsi & fixes to the already implemented feature & under
				review \\
				i965 & helped with the review & under review\\
				\hline 
			\end{tabularx}
		\end{table}
	}

	\center{
		\normalsize{\textbf{\color{coolblack}{Thanks and Credits}}}
	}

	\tiny{
		\begin{table}
			\begin{tabularx}{\textwidth}{|l|X|X|}
				\hline 
				Driver & Patches & Reviews, Comments, Advice\\
				\hline 
				iris & Juan A. Juarez Romero, Eleni Maria Stea, Tapani Palli,
				Eduardo Lima Mitev, zzzoon & collab, tapani, jason klp \\
				freedreno & foo & bar\\
				radeonsi & foo & bar\\
				i965 & foo & bar\\
				\hline 
			\end{tabularx}
		\end{table}
	}
\end{frame}

\begin{frame}
	\frametitle{Piglit tests cases}

	As there were no CTS for these extensions and we needed to test
	mesa, we've written some Piglit tests with simple use cases of the
	extension.

	\vspace{0.5cm}
	WIP igalia intel logos
\end{frame}

\begin{frame}[fragile]
	\frametitle{vk-image-overwrite}
	\begin{block}{vk-image-overwrite}
		\lstinline[language=C++, style=CStyle]{glCreateMemoryObjectsEXT(1, gl_mem_obj); }
	\end{block}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\frametitle{test}
	foobar
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section[References]{References}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\setbeamertemplate{bibliography entry title}{}
%\setbeamertemplate{bibliography entry location}{}
%\setbeamertemplate{bibliography entry note}{}
\begin{frame}[allowframebreaks]
	\frametitle{References}
	\bibliographystyle{plain}
	\bibliography{bib/references.bib}
	\tiny{
		\nocite{*}
	}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section[Q \& A]{Questions and Answers}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\frametitle{Questions?}
	WIP
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
