<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vulkan on Erik “kusma” Faye-Lund</title>
    <link>https://kusma.xyz/blog/tags/vulkan/</link>
    <description>Recent content in Vulkan on Erik “kusma” Faye-Lund</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>kusmabite@gmail.com (Erik Faye-Lund)</managingEditor>
    <webMaster>kusmabite@gmail.com (Erik Faye-Lund)</webMaster>
    <lastBuildDate>Mon, 14 Jun 2021 20:00:00 +0100</lastBuildDate>
    <atom:link href="https://kusma.xyz/blog/tags/vulkan/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Zink: Summer 2021 Update</title>
      <link>https://kusma.xyz/blog/2021/06/14/zink-summer-2021-update/</link>
      <pubDate>Mon, 14 Jun 2021 20:00:00 +0100</pubDate>
      <author>kusmabite@gmail.com (Erik Faye-Lund)</author>
      <guid>https://kusma.xyz/blog/2021/06/14/zink-summer-2021-update/</guid>
      <description>&lt;p&gt;There&amp;rsquo;s a lot that has happened in the world of Zink since my &lt;a href=&#34;https://kusma.xyz/blog/2019/10/24/zink-fall-update/&#34;&gt;last
update&lt;/a&gt;, so let&amp;rsquo;s see if I can bring you up to date on the most
important stuff.&lt;/p&gt;
&lt;h2 id=&#34;upstream-development&#34;&gt;Upstream development
&lt;a class=&#34;header-link&#34; href=&#34;#upstream-development&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Gosh, when I last blogged about Zink, it hadn&amp;rsquo;t even landed upstream
in Mesa yet! Well, by now it&amp;rsquo;s been upstream for quite a while, and most
development has moved there.&lt;/p&gt;
&lt;p&gt;At the time of writing, we have &lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests?scope=all&amp;amp;utf8=%E2%9C%93&amp;amp;state=merged&amp;amp;label_name%5B%5D=zink&#34;&gt;merged 606 merge-requests&lt;/a&gt;
labeled &amp;ldquo;zink&amp;rdquo;. The current tip of mesa&amp;rsquo;s main branch is totaling 1717
commits touching the &lt;code&gt;src/gallium/drivers/zink/&lt;/code&gt; sub-folder, written by
42 different contributors. That&amp;rsquo;s pretty awesome in my eyes, Zink has
truly become a community project!&lt;/p&gt;
&lt;p&gt;Another noteworthy change is that &lt;a href=&#34;https://www.supergoodcode.com/&#34;&gt;Mike Blumenkrantz&lt;/a&gt; has come
aboard the project, and has churned out an incredible amount of
improvements to Zink! He got hired by &lt;a href=&#34;https://www.valvesoftware.com/en/about&#34;&gt;Valve&lt;/a&gt; to work on Zink (among
other things), and is now the most prolific contributor, with more than
twice the amount of commits than I have written.&lt;/p&gt;
&lt;p&gt;If you want a job in Open Source graphics, Zink has a proven
track-record as a job-creator! 😄&lt;/p&gt;
&lt;p&gt;In addition to Mike, there&amp;rsquo;s some other awesome people who have been
helping out lately.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2021/06/14/zink-summer-2021-update/images/hl2.png&#34; alt=&#34;Half-Life 2 running with Zink.&#34; title=&#34;Half-Life 2 running with Zink.&#34;&gt;
  &lt;figcaption&gt;Half-Life 2 running with Zink.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;opengl-46-support&#34;&gt;OpenGL 4.6 support
&lt;a class=&#34;header-link&#34; href=&#34;#opengl-46-support&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Thanks to a lot of hard work by Mike assisted by &lt;a href=&#34;https://airlied.blogspot.com/&#34;&gt;Dave Airlie&lt;/a&gt;
and &lt;a href=&#34;https://ajaxnwnk.blogspot.com/&#34;&gt;Adam Jackson&lt;/a&gt;, both of &lt;a href=&#34;https://www.redhat.com/&#34;&gt;RedHat&lt;/a&gt;, Zink is now able to expose
the OpenGL 4.6 (Core Profile) feature set, given
&lt;a href=&#34;https://docs.mesa3d.org/drivers/zink.html#features&#34;&gt;enough Vulkan features&lt;/a&gt;! 🎉&lt;/p&gt;
&lt;p&gt;Please note that this doesn&amp;rsquo;t mean that Zink is yet a &lt;em&gt;conformant&lt;/em&gt;
implementation, there&amp;rsquo;s some details left to be ironed out before we can
claim that. In particular, we need to pass the conformance tests, and
submit a conformance report to Khronos. We&amp;rsquo;re not there yet.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also happy to see that Zink is currently at the top of &lt;a href=&#34;https://mesamatrix.net/&#34;&gt;MesaMatrix&lt;/a&gt;
(together with LLVMpipe, i965 and RadeonSI), reporting a total of 160
OpenGL extensions at the time of writing!&lt;/p&gt;
&lt;p&gt;In theory, that means you can run any OpenGL application you can think of
on top of Zink. Mike is hard at work testing the entire Steam game
library, and things are working pretty well.&lt;/p&gt;
&lt;p&gt;Is this the end of the line for Zink? Are we done now? Not at all!
😆&lt;/p&gt;
&lt;h3 id=&#34;opengl-compabibility-profile&#34;&gt;OpenGL compabibility profile
&lt;a class=&#34;header-link&#34; href=&#34;#opengl-compabibility-profile&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;We&amp;rsquo;re still stuck at OpenGL 3.0 for compatibility contexts, mainly due to
lack of testing. There&amp;rsquo;s a lot of features that need to work together in
relatively complicated ways for this to work for us.&lt;/p&gt;
&lt;p&gt;Note that this only matters for applications that rely on legacy OpenGL
features. Modern OpenGL programs gets OpenGL 4.6 support, as mentioned
previously.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t &lt;em&gt;think&lt;/em&gt; this is going to be a big deal to enable, but I haven&amp;rsquo;t
spent time on it.&lt;/p&gt;
&lt;h2 id=&#34;opengl-es-31-support&#34;&gt;OpenGL ES 3.1 support
&lt;a class=&#34;header-link&#34; href=&#34;#opengl-es-31-support&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Similar to the OpenGL 4.6 support, we&amp;rsquo;re now able to expose the OpenGL ES
3.1 feature set. This is again thanks to a lot of hard work by Mike and
the gang.&lt;/p&gt;
&lt;p&gt;Why not OpenGL ES 3.2? This comes down to the
&lt;a href=&#34;https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_blend_equation_advanced.txt&#34;&gt;&lt;code&gt;GL_KHR_blend_equation_advanced&lt;/code&gt;&lt;/a&gt; feature. Mike
&lt;a href=&#34;https://www.supergoodcode.com/notES/&#34;&gt;blogged about the issue&lt;/a&gt; a while ago.&lt;/p&gt;
&lt;h2 id=&#34;lavapipe-and-continuous-integration&#34;&gt;Lavapipe and continuous integration
&lt;a class=&#34;header-link&#34; href=&#34;#lavapipe-and-continuous-integration&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;To prevent regressions, we&amp;rsquo;ve started testing Zink on the &lt;a href=&#34;https://docs.mesa3d.org/ci/index.html&#34;&gt;Mesa CI&lt;/a&gt;
system for every change. This is made possible thanks to Lavapipe, a Vulkan
software implementation in Mesa that reuse the rasterizer from LLVMpipe.&lt;/p&gt;
&lt;p&gt;This means we can run tests on virtual cloud machines without having to
depend on unreliable hardware. 🤖&lt;/p&gt;
&lt;p&gt;At the time of writing, we&amp;rsquo;re only exposing OpenGL 4.1 on top of Lavapipe,
due to some lacking features. But we have patches in the works to bring
this up to OpenGL 4.5, and OpenGL 4.6 probably won&amp;rsquo;t be far off when that
lands.&lt;/p&gt;
&lt;h2 id=&#34;windows-support&#34;&gt;Windows support
&lt;a class=&#34;header-link&#34; href=&#34;#windows-support&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Basic support for &lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7432&#34;&gt;Zink on Microsoft Windows&lt;/a&gt; has landed.
This isn&amp;rsquo;t particularly useful at the moment, because we need better
window-system integration to get anywhere near reasonable performance.
But it&amp;rsquo;s there.&lt;/p&gt;
&lt;h2 id=&#34;macos-support&#34;&gt;macOS support
&lt;a class=&#34;header-link&#34; href=&#34;#macos-support&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Thanks to work by &lt;a href=&#34;https://twitter.com/aasimon3d&#34;&gt;Duncan Hopkins&lt;/a&gt; of &lt;a href=&#34;https://www.foundry.com/&#34;&gt;The Foundry&lt;/a&gt;, there&amp;rsquo;s also
some support for macOS. This uses &lt;a href=&#34;https://github.com/KhronosGroup/MoltenVK&#34;&gt;MoltenVK&lt;/a&gt; as the Vulkan implementation,
meaning that we also support the &lt;a href=&#34;https://www.khronos.org/blog/fighting-fragmentation-vulkan-portability-extension-released-implementations-shipping&#34;&gt;Vulkan Portability Extension&lt;/a&gt; to some
degree.&lt;/p&gt;
&lt;p&gt;This support isn&amp;rsquo;t quite as drop-in as on other platforms, because it&amp;rsquo;s
completely lacking window-system integration. But it seems to work for
the use-cases they have at The Foundry, so it&amp;rsquo;s worth mentioning as well.&lt;/p&gt;
&lt;h2 id=&#34;driver-support&#34;&gt;Driver support
&lt;a class=&#34;header-link&#34; href=&#34;#driver-support&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Beyond this, &lt;a href=&#34;https://www.igalia.com/&#34;&gt;Igalia&lt;/a&gt; has brought up &lt;a href=&#34;https://blogs.igalia.com/itoral/2020/11/05/v3dv-zink/&#34;&gt;Zink on the V3DV&lt;/a&gt; driver, and
I&amp;rsquo;ve heard some whispers that there&amp;rsquo;s some people running Zink on top of
&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/freedreno/vulkan&#34;&gt;Turnip&lt;/a&gt;, an open-source Vulkan driver for recent Qualcomm Adreno GPUs.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve heard some people have some success getting things running on NVIDIA,
but there&amp;rsquo;s a few obvious problems in the way there due to the lack of
proper DRI support&amp;hellip; Which brings us to:&lt;/p&gt;
&lt;h2 id=&#34;window-system-integration&#34;&gt;Window System Integration
&lt;a class=&#34;header-link&#34; href=&#34;#window-system-integration&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Another awesome new development is that Adam is working on &lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7661&#34;&gt;Penny&lt;/a&gt;. So,
what&amp;rsquo;s Penny?&lt;/p&gt;
&lt;p&gt;Penny is another way of bringing up Zink, on systems without DRI support.
It works as a dedicated GLX integration that uses the
&lt;a href=&#34;https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_swapchain.html&#34;&gt;&lt;code&gt;VK_KHR_swapchain&lt;/code&gt;&lt;/a&gt; extension to integrate properly with
the native Vulkan driver&amp;rsquo;s window-system integration instead of Mesa baking
its own.&lt;/p&gt;
&lt;p&gt;This solves a lot of small, nasty issues in the DRI code-path. I&amp;rsquo;ll say
the magic &amp;ldquo;implicit synchronization&amp;rdquo; word, and hope that scares away
anyone wondering what it&amp;rsquo;s about.&lt;/p&gt;
&lt;h2 id=&#34;performance&#34;&gt;Performance
&lt;a class=&#34;header-link&#34; href=&#34;#performance&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;A lot more has happened on the performance front as well, again all thanks
to Mike. However, much of this is still out-of-tree, and waiting in Mike&amp;rsquo;s
&lt;a href=&#34;https://gitlab.freedesktop.org/zmike/mesa/-/tree/zink-wip&#34;&gt;zink-wip&lt;/a&gt; branch.&lt;/p&gt;
&lt;p&gt;So instead, I suggest you check out &lt;a href=&#34;https://www.supergoodcode.com/&#34;&gt;Mike&amp;rsquo;s blog&lt;/a&gt; for the latest
performance information (and much more up-to-date info on Zink). There&amp;rsquo;s
been a lot going on, and I&amp;rsquo;m sure there&amp;rsquo;s even more to come!&lt;/p&gt;
&lt;h2 id=&#34;closing-words&#34;&gt;Closing words
&lt;a class=&#34;header-link&#34; href=&#34;#closing-words&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I think this should cover the most interesting bits of development.&lt;/p&gt;
&lt;p&gt;On a personal note, I recently became a dad for the first time, and as a
result I&amp;rsquo;ll be away for a while on paternity leave, starting early this
fall. Luckily, Zink is in good hands with Mike and the rest of the
upstream community taking care of things.&lt;/p&gt;
&lt;p&gt;I would like to again plug &lt;a href=&#34;https://www.supergoodcode.com/&#34;&gt;Mike&amp;rsquo;s blog&lt;/a&gt; as a great source of
Zink-related news, if you&amp;rsquo;re not already following it. He posts a lot
more frequent than I do, and he&amp;rsquo;s also an epic meme master, so it&amp;rsquo;s all
great fun!&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Zink: Fall Update</title>
      <link>https://kusma.xyz/blog/2019/10/24/zink-fall-update/</link>
      <pubDate>Thu, 24 Oct 2019 15:22:00 +0100</pubDate>
      <author>kusmabite@gmail.com (Erik Faye-Lund)</author>
      <guid>https://kusma.xyz/blog/2019/10/24/zink-fall-update/</guid>
      <description>&lt;p&gt;I recently went to &lt;a href=&#34;https://xdc2019.x.org/&#34;&gt;XDC 2019&lt;/a&gt;, where I gave &lt;a href=&#34;https://xdc2019.x.org/event/5/contributions/329/&#34;&gt;yet another talk&lt;/a&gt;
about Zink. I kinda forgot to write a blog-post about it, so here&amp;rsquo;s me trying
to make up for it&amp;hellip; or something like that. I&amp;rsquo;ll also go into some more
recent developments as well.&lt;/p&gt;
&lt;p&gt;My presentation was somewhat similar to the &lt;a href=&#34;https://kusma.xyz/blog/2019/07/25/summer-and-siggraph/&#34;&gt;talk I did&lt;/a&gt; at
&lt;a href=&#34;https://s2019.siggraph.org/&#34;&gt;SIGGRAPH&lt;/a&gt; this year, but with a bit more emphasis on the technical
aspect, as the XDC audience is more familiar with &lt;a href=&#34;https://www.mesa3d.org/&#34;&gt;Mesa&lt;/a&gt; internals.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re interested, you can find the slides for the talk &lt;a href=&#34;https://xdc2019.x.org/event/5/contributions/329/attachments/433/687/XDC2019-Zink-slide-deck.pdf&#34;&gt;here&lt;/a&gt;.
The talk goes through the motivation and basic approach. I don&amp;rsquo;t think I need
to go through this again, as I&amp;rsquo;ve &lt;a href=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/#why-implement-opengl-on-top-of-vulkan&#34;&gt;already covered that&lt;/a&gt; before.&lt;/p&gt;
&lt;p&gt;As for the status, Zink currently supports OpenGL 2.1 and OpenGL ES 2.0. And
there&amp;rsquo;s no immediate plans on working on OpenGL 3.0 and OpenGL ES 3.0 until
Zink is upstream.&lt;/p&gt;
&lt;p&gt;Which gets us to the more interesting bit; that I started working on
upstreaming Zink. So let&amp;rsquo;s talk about that for a bit.&lt;/p&gt;
&lt;h2 id=&#34;upstreaming-zink&#34;&gt;Upstreaming Zink
&lt;a class=&#34;header-link&#34; href=&#34;#upstreaming-zink&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;So, my current goal is to get Zink upstream in &lt;a href=&#34;https://www.mesa3d.org/&#34;&gt;Mesa&lt;/a&gt;. The plan outline
in my XDC talk is slightly outdated by now, so here I&amp;rsquo;ll instead say what&amp;rsquo;s
actually happened so far, and what I hope will follow.&lt;/p&gt;
&lt;p&gt;Before I could add the driver itself, I decided to send all changes outside of
the driver as a set of merge-requests:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2188&#34;&gt;glBitmap R8 textures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2189&#34;&gt;loader/dri3: do not blit outside old/new buffers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2190&#34;&gt;gallium/u_blitter: set a more sane viewport-state&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2195&#34;&gt;nir: initialize uses_discard to false&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2213&#34;&gt;lowering passes from Zink&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The last one is probably the most interesting one, as it moves a lot of
fixed-function operations into the state-tracker, so individual drivers won&amp;rsquo;t
have to deal with them. Unless they choose to, of course.&lt;/p&gt;
&lt;p&gt;But all of these has already been merged, and there&amp;rsquo;s just one final
merge-request left:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2363&#34;&gt;Introduce Zink: OpenGL on Vulkan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This merge-request adds the driver in its current state. It consists of 163
commits at the time of writing, so it&amp;rsquo;s not a thing of beauty. But new drivers
usually aren&amp;rsquo;t, so I&amp;rsquo;m not too worried.&lt;/p&gt;
&lt;p&gt;When this is merged, Zink will finally be a &amp;ldquo;normal&amp;rdquo; part of Mesa&amp;hellip; Well,
sort of anyway. I don&amp;rsquo;t think we&amp;rsquo;ll enable Zink to be built by default for a
while. But that&amp;rsquo;ll just be a matter of adding &lt;code&gt;zink&lt;/code&gt; to the
&lt;code&gt;-Dgallium-drivers&lt;/code&gt; meson-option.&lt;/p&gt;
&lt;h3 id=&#34;testing-on-ci&#34;&gt;Testing on CI
&lt;a class=&#34;header-link&#34; href=&#34;#testing-on-ci&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The current branch only adds building of Zink to the CI. There&amp;rsquo;s no testing
being done yet. The reasons for this is two-fold:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We need to get a running environment on CI. Rather of bringing up some
hardware-enabled test-runner, I intend to try to set up
&lt;a href=&#34;https://swiftshader.googlesource.com/SwiftShader&#34;&gt;SwiftShader&lt;/a&gt; as a software rasterizer instead, as that
supports Vulkan 1.1 these days.&lt;/li&gt;
&lt;li&gt;We need some tests to run. Zink currently only supports OpenGL 2.1, and
sadly &lt;a href=&#34;https://github.com/KhronosGroup/VK-GL-CTS&#34;&gt;the conformance test suite&lt;/a&gt; doesn&amp;rsquo;t have &lt;em&gt;any&lt;/em&gt; tests for OpenGL
versions older than 3.0. &lt;a href=&#34;https://piglit.freedesktop.org/&#34;&gt;Piglit&lt;/a&gt; has some, but a full piglit-run
takes significantly more time, which makes it tricky for CI. So right now,
it seems the OpenGL ES 2.0 conformance tests are our best bet. We&amp;rsquo;ll of
course add more test-suites as we add more features.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So, there&amp;rsquo;s some work to be done here, but it seems like we should be able to
get something working without &lt;em&gt;too much&lt;/em&gt; hassle.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps
&lt;a class=&#34;header-link&#34; href=&#34;#next-steps&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;After Zink is upstream, it will be maintained similarly to other Mesa drivers.
Practically speaking, this means that patches are sent to the upstream repo
rather than my fork. It shouldn&amp;rsquo;t make a huge difference for most users.&lt;/p&gt;
&lt;p&gt;The good thing is that if I go away on vacation, or are for some other reason
unavailable, other people can still merge patches, so we&amp;rsquo;d slightly reduce the
&lt;em&gt;technical&lt;/em&gt; bus-factor.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not stopping developing Zink at all, but I have other things going on in
my life that means I might be busy with other things at times. As is the case
for everyone! 😉&lt;/p&gt;
&lt;p&gt;In fact, I&amp;rsquo;m very excited to start working on OpenGL 3.x and 4.x level
features; we still have a few patches for some 3.x features in some older
branches.&lt;/p&gt;
&lt;p&gt;The future is bright! ☀️&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Zink: Summer Update and SIGGRAPH 2019</title>
      <link>https://kusma.xyz/blog/2019/07/25/summer-and-siggraph/</link>
      <pubDate>Thu, 25 Jul 2019 21:38:36 +0200</pubDate>
      <author>kusmabite@gmail.com (Erik Faye-Lund)</author>
      <guid>https://kusma.xyz/blog/2019/07/25/summer-and-siggraph/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s an overview of the recent changes in Zink since &lt;a href=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/&#34;&gt;the previous post&lt;/a&gt;,
as well as an exciting announcement!&lt;/p&gt;
&lt;h2 id=&#34;whats-new-in-the-world-of-zink&#34;&gt;What&amp;rsquo;s new in the world of Zink?
&lt;a class=&#34;header-link&#34; href=&#34;#whats-new-in-the-world-of-zink&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;OK, so I haven&amp;rsquo;t been as good at making frequent updates on as I was
hoping, but let&amp;rsquo;s try to make up for it:&lt;/p&gt;
&lt;p&gt;Since last time, there&amp;rsquo;s quite a lot of things that has been resolved:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We now do proper control-flow. This means things like if-statements,
for-loops etc. There might be some control-flow primitives missing
still, but that&amp;rsquo;s because I haven&amp;rsquo;t encountered any use yet.&lt;/li&gt;
&lt;li&gt;Alpha testing has been implemented.&lt;/li&gt;
&lt;li&gt;Client-defined clip-planes has been implemented.&lt;/li&gt;
&lt;li&gt;Support for &lt;code&gt;gl_FrontFacing&lt;/code&gt; has been implemented.&lt;/li&gt;
&lt;li&gt;Lowering of &lt;code&gt;glPointSize()&lt;/code&gt; to &lt;code&gt;gl_PointSize&lt;/code&gt; has been implemented.
This means you can use &lt;code&gt;glPointSize()&lt;/code&gt; to specify sizes instead of
having to write the &lt;code&gt;gl_PointSize&lt;/code&gt;-output from the vertex shader.&lt;/li&gt;
&lt;li&gt;Support for &lt;code&gt;gl_FragDepth&lt;/code&gt; has been implemented.&lt;/li&gt;
&lt;li&gt;Two-sided lighting has been implemented.&lt;/li&gt;
&lt;li&gt;Shadow-samplers has been implemented.&lt;/li&gt;
&lt;li&gt;Support for 8-bit primitive indices has been implemented.&lt;/li&gt;
&lt;li&gt;Occlusion queries has been implemented correctly across command
buffers. This includes the ability to pause / restore queries.&lt;/li&gt;
&lt;li&gt;The compiler has been ported to C.&lt;/li&gt;
&lt;li&gt;The compiler no longer lowers IO, but instead process derefs
directly.&lt;/li&gt;
&lt;li&gt;The compiler now handles booleans properly. It&amp;rsquo;s no longer lowering
them to floats.&lt;/li&gt;
&lt;li&gt;David Airlie has contributed lowering of &lt;code&gt;glShadeModel(GL_FLAT)&lt;/code&gt; to
&lt;code&gt;flat&lt;/code&gt; &lt;a href=&#34;https://www.khronos.org/opengl/wiki/Type_Qualifier_(GLSL)#Interpolation_qualifiers&#34;&gt;interpolation qualifiers&lt;/a&gt;. This still doesn&amp;rsquo;t give us the
right result, because Vulkan &lt;a href=&#34;https://vulkan.lunarg.com/doc/view/1.0.26.0/linux/vkspec.chunked/ch23s01.html&#34;&gt;only supports the first vertex&lt;/a&gt; as
the provoking vertex, and OpenGL &lt;a href=&#34;https://www.khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf#section.13.4&#34;&gt;defaults to the last one&lt;/a&gt;. To
resolve this in a reasonable way, we need to inject a geometry shader
that reorders the vertices, but this hasn&amp;rsquo;t been implemented yet. You
can read more about this in &lt;a href=&#34;https://gitlab.freedesktop.org/kusma/mesa/issues/15&#34;&gt;this ticket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;hellip; and a boat-load of smaller fixes. There&amp;rsquo;s just too many to
mention, really.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to this, there&amp;rsquo;s been a pretty significant rewrite, changing
the overall design of Zink. The reason for this, was that I made some
early design-mistakes, and after having piled a bit too many features on
top of this, I decided that it would be better to get the fundamentals
right first.&lt;/p&gt;
&lt;p&gt;Sadly, not all features have been brought forward since the rewrite, so
we&amp;rsquo;re currently back to OpenGL 2.1 support. Fixing this is on my list of
things I want to do, but I suspect that cleaning things up and upstreaming
will take presedence over OpenGL 3.0 support.&lt;/p&gt;
&lt;p&gt;And just to give you something neat to look at, here&amp;rsquo;s &lt;a href=&#34;https://www.blender.org/&#34;&gt;Blender&lt;/a&gt; running
using Zink:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2019/07/25/summer-and-siggraph/images/blender.png&#34; alt=&#34;Blender on Zink&#34; title=&#34;Blender on Zink&#34;&gt;
  &lt;figcaption&gt;Blender on Zink&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;khronos-vulkan-bof-at-siggraph-2019&#34;&gt;Khronos Vulkan BoF at SIGGRAPH 2019
&lt;a class=&#34;header-link&#34; href=&#34;#khronos-vulkan-bof-at-siggraph-2019&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://www.khronos.org/&#34;&gt;Khronos&lt;/a&gt; has been nice enough to give me a slot in their Vulkan Sessions
at the &lt;a href=&#34;https://www.khronos.org/events/2019-siggraph&#34;&gt;Khronos BoFs&lt;/a&gt; during &lt;a href=&#34;https://s2019.siggraph.org/&#34;&gt;SIGGRAPH 2019&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;The talk will be a slightly less tech-heavy introduction to Zink, what it
does and what the future holds. It will focus more on the motivation and
use cases than the underlying technical difficulties compared to my previous
talks.&lt;/p&gt;
&lt;p&gt;So, if you&amp;rsquo;re in the area please drop by! A conference pass is not required
to attend the BoF, as it&amp;rsquo;s not part of the official SIGGRAPH program.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Introducing Zink: OpenGL on Vulkan</title>
      <link>https://kusma.xyz/blog/2018/10/31/introducing-zink/</link>
      <pubDate>Wed, 31 Oct 2018 17:52:21 +0100</pubDate>
      <author>kusmabite@gmail.com (Erik Faye-Lund)</author>
      <guid>https://kusma.xyz/blog/2018/10/31/introducing-zink/</guid>
      <description>&lt;p&gt;For the last month or so, I&amp;rsquo;ve been playing with &lt;a href=&#34;https://gitlab.freedesktop.org/kusma/mesa/tree/zink&#34;&gt;a new project&lt;/a&gt;
during my work at &lt;a href=&#34;https://www.collabora.com/&#34;&gt;Collabora&lt;/a&gt;, and as I&amp;rsquo;ve
&lt;a href=&#34;https://www.youtube.com/watch?v=ukrB-Lbl_Jg&#34;&gt;already briefly talked about&lt;/a&gt; at
&lt;a href=&#34;https://xdc2018.x.org/&#34;&gt;XDC 2018&lt;/a&gt;, it&amp;rsquo;s about time to talk about it to a
wider audience.&lt;/p&gt;
&lt;h2 id=&#34;what-is-zink&#34;&gt;What is Zink?
&lt;a class=&#34;header-link&#34; href=&#34;#what-is-zink&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Zink is an &lt;a href=&#34;https://www.opengl.org/&#34;&gt;OpenGL&lt;/a&gt; implementation on top of
&lt;a href=&#34;https://www.khronos.org/vulkan/&#34;&gt;Vulkan&lt;/a&gt;. Or to be a bit more specific, Zink
is a &lt;a href=&#34;https://www.mesa3d.org/&#34;&gt;Mesa&lt;/a&gt; Gallium driver that leverage the existing
OpenGL implementation in Mesa to provide hardware accelerated OpenGL when only
a Vulkan driver is available.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/images/gears.png&#34; alt=&#34;glxgears on Zink&#34; title=&#34;glxgears on Zink&#34;&gt;
  &lt;figcaption&gt;glxgears on Zink&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Here&amp;rsquo;s an overview of how this fits into the Mesa architecture, for those unfamiliar with it:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/images/diagram.svg&#34; alt=&#34;Architectural overview&#34; title=&#34;Architectural overview&#34;&gt;
  &lt;figcaption&gt;Architectural overview&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;why-implement-opengl-on-top-of-vulkan&#34;&gt;Why implement OpenGL on top of Vulkan?
&lt;a class=&#34;header-link&#34; href=&#34;#why-implement-opengl-on-top-of-vulkan&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;There&amp;rsquo;s several motivation behind this project, but let&amp;rsquo;s list a few:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Simplify the graphics stack&lt;/li&gt;
&lt;li&gt;Lessen the work-load for future GPU drivers&lt;/li&gt;
&lt;li&gt;Enable more integration&lt;/li&gt;
&lt;li&gt;Support application porting to Vulkan&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;rsquo;ll go through each of these points in more detail below.&lt;/p&gt;
&lt;p&gt;But there&amp;rsquo;s another, less concrete reason; &lt;strong&gt;someone&lt;/strong&gt; had to do this. I was
waiting for someone else to do it before me, but nobody seemed to actually go
ahead. At least as long as you don&amp;rsquo;t count solutions who only implement some
variation of OpenGL ES (which in my opinion doesn&amp;rsquo;t solve the problem; we need
&lt;strong&gt;full&lt;/strong&gt; OpenGL for this to be &lt;em&gt;really&lt;/em&gt; valuable).&lt;/p&gt;
&lt;h3 id=&#34;1-simplifying-the-graphics-stack&#34;&gt;1. Simplifying the graphics stack
&lt;a class=&#34;header-link&#34; href=&#34;#1-simplifying-the-graphics-stack&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;One problem is that OpenGL is a &lt;strong&gt;big&lt;/strong&gt; API with a &lt;strong&gt;lot&lt;/strong&gt; of legacy stuff
that has accumulated since its initial release in 1992. OpenGL is
well-established as a requirement for applications and desktop compositors.&lt;/p&gt;
&lt;p&gt;But since the very successful release of Vulkan, we now have two main-stream
APIs for essentially the same hardware functionality.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not looking like neither OpenGL nor Vulkan is going away, and the
software-world is now hard at work implementing Vulkan support everywhere,
which is &lt;strong&gt;great&lt;/strong&gt;. But &lt;em&gt;this leads to complexity&lt;/em&gt;. So my hope is that we can
simplify things here, by only require things like desktop compositors to
support &lt;em&gt;one&lt;/em&gt; API down the road. We&amp;rsquo;re not there yet, though; not all hardware
has a Vulkan-driver, and some older hardware can&amp;rsquo;t even support it. But at
some point in the not too far future, we&amp;rsquo;ll probably get there.&lt;/p&gt;
&lt;p&gt;This means there might be a future where OpenGL&amp;rsquo;s role &lt;em&gt;could&lt;/em&gt; purely be one
of legacy application compatibility. Perhaps Zink can help making that future
a bit closer?&lt;/p&gt;
&lt;h3 id=&#34;2-lessen-the-work-load-for-future-gpu-drivers&#34;&gt;2. Lessen the work-load for future GPU drivers
&lt;a class=&#34;header-link&#34; href=&#34;#2-lessen-the-work-load-for-future-gpu-drivers&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The amount of drivers to maintain is only growing, and we want the amount of
code to maintain for legacy hardware to be as little as possible. And since
Vulkan is a requirement already, maybe we can get &lt;em&gt;good enough&lt;/em&gt; performance
through emulation?&lt;/p&gt;
&lt;p&gt;Besides, in the Open Source world, there&amp;rsquo;s even new drivers being written for
old hardware, and if the hardware is capable of supporting Vulkan, it &lt;em&gt;could&lt;/em&gt;
make sense to only support Vulkan &amp;ldquo;natively&amp;rdquo;, and do OpenGL through Zink.&lt;/p&gt;
&lt;p&gt;It all comes down to the economics here. There aren&amp;rsquo;t infinite programmers
out there that can maintain every GPU driver forever. But if we can make it
easier and cheaper, maybe we can get better driver-support in the long run?&lt;/p&gt;
&lt;h3 id=&#34;3-enable-more-integration&#34;&gt;3. Enable more integration
&lt;a class=&#34;header-link&#34; href=&#34;#3-enable-more-integration&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Because Zink is implemented as a Gallium driver in Mesa, there&amp;rsquo;s some
interesting side-benefits that comes &amp;ldquo;for free&amp;rdquo;. For instance, projects like
Gallium Nine or Clover could &lt;em&gt;in theory&lt;/em&gt; work on top of the i965 Vulkan driver
through Zink. Please note that this hasn&amp;rsquo;t really been tested, though.&lt;/p&gt;
&lt;p&gt;It should also be possible to run Zink on top of a closed-source Vulkan driver,
and still get proper window system integration. Not that I promote the idea of
using a closed-source Vulkan driver.&lt;/p&gt;
&lt;h3 id=&#34;4-support-application-porting-to-vulkan&#34;&gt;4. Support application porting to Vulkan
&lt;a class=&#34;header-link&#34; href=&#34;#4-support-application-porting-to-vulkan&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;This might sound a bit strange, but it might be possible to extend Zink in
ways where it can act as a cooperation-layer between OpenGL and Vulkan code in
the same application.&lt;/p&gt;
&lt;p&gt;The thing is, big CAD applications etc won&amp;rsquo;t realistically rewrite all of
their rendering-code to Vulkan in a wave of a hand. So if they can for instance
prototype some Vulkan-code inside an OpenGL application, it might be easier to
figure out if Vulkan is worth it or not for them.&lt;/p&gt;
&lt;h2 id=&#34;what-does-zink-require&#34;&gt;What does Zink require?
&lt;a class=&#34;header-link&#34; href=&#34;#what-does-zink-require&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Zink currently requires a Vulkan 1.0 implementation, with the following
extensions (there&amp;rsquo;s a few more, due to extensions requiring other extensions,
but I&amp;rsquo;ve decided to omit those for simplicity):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;VK_KHR_maintenance1&lt;/code&gt;: This is required for the viewport flipping. It&amp;rsquo;s also
possible to do without this extension, and we have some experimental
patches for that. I would certainly love to require as few extensions as
possible.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;VK_KHR_external_memory_fd&lt;/code&gt;: This is required as a way of getting the
rendered result on screen. This isn&amp;rsquo;t &lt;em&gt;technically&lt;/em&gt; a hard requirement, as
we also have a copy-based approach, but that&amp;rsquo;s almost unusably slow. And
I&amp;rsquo;m not sure if we&amp;rsquo;ll bother keeping it around.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Zink has to my knowledge &lt;em&gt;only&lt;/em&gt; been tested on Linux. I don&amp;rsquo;t think there&amp;rsquo;s
any major reasons why it wouldn&amp;rsquo;t run on any other operating system supporting
Vulkan, apart from the fact that some window-system integration code might
have to be written.&lt;/p&gt;
&lt;h2 id=&#34;what-does-zink-support&#34;&gt;What does Zink support?
&lt;a class=&#34;header-link&#34; href=&#34;#what-does-zink-support&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Right now, it&amp;rsquo;s not super-impressive: we implement &lt;strong&gt;OpenGL 2.1&lt;/strong&gt;, and &lt;strong&gt;OpenGL
ES 1.1 and 2.0&lt;/strong&gt; plus some extensions. Please note that the list of extensions
might depend on the Vulkan implementation backing this, as we forward
capabilities from that.&lt;/p&gt;
&lt;p&gt;The list of extensions is too long to include here in a sane way, but &lt;a href=&#34;https://gitlab.freedesktop.org/kusma/mesa/snippets/518/raw&#34;&gt;here&amp;rsquo;s
a link&lt;/a&gt; to the
output of glxinfo as of today on top of i965.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s some screenshots of applications and games we&amp;rsquo;ve tested that renders
more or less correctly:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/images/openarena.png&#34; alt=&#34;OpenArena on Zink&#34; title=&#34;OpenArena on Zink&#34;&gt;
  &lt;figcaption&gt;OpenArena on Zink&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/images/weston.png&#34; alt=&#34;Weston on Zink&#34; title=&#34;Weston on Zink&#34;&gt;
  &lt;figcaption&gt;Weston on Zink&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/images/quake3.png&#34; alt=&#34;Quake 3 on Zink&#34; title=&#34;Quake 3 on Zink&#34;&gt;
  &lt;figcaption&gt;Quake 3 on Zink&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;img src=&#34;https://kusma.xyz/blog/2018/10/31/introducing-zink/images/etr.png&#34; alt=&#34;Extreme Tux Racer on Zink&#34; title=&#34;Extreme Tux Racer on Zink&#34;&gt;
  &lt;figcaption&gt;Extreme Tux Racer on Zink&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;what-doesnt-work&#34;&gt;What doesn&amp;rsquo;t work?
&lt;a class=&#34;header-link&#34; href=&#34;#what-doesnt-work&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Yeah, so when I say OpenGL 2.1, I&amp;rsquo;m ignoring some features that we simply do
not support yet:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;glPointSize()&lt;/code&gt; is currently not supported. Writing to &lt;code&gt;gl_PointSize&lt;/code&gt; from
the vertex shader &lt;em&gt;does&lt;/em&gt; work. We need to write some code to plumb this
through the vertex shader to make it work.&lt;/li&gt;
&lt;li&gt;Texture borders are currently always black. This will also need some
emulation code, due to Vulkan&amp;rsquo;s lack of arbitrary border-color support.
Since a lot of hardware actually support this, perhaps we can introduce some
extension to add it back to the API?&lt;/li&gt;
&lt;li&gt;No control-flow is supported in the shaders at the moment. This is just
because of lacking implementation for those opcodes. It&amp;rsquo;s coming.&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;GL_ALPHA_TEST&lt;/code&gt; support yet. There&amp;rsquo;s some support code in NIR for this,
we just need to start using it. This will depend on control-flow, though.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;glShadeModel(GL_FLAT)&lt;/code&gt; isn&amp;rsquo;t supported yet. This isn&amp;rsquo;t particularly hard or
anything, but we currently emit the SPIR-V before knowing the drawing-state.
We should probably change this. Another alternative is to patch in a
flat-decoration on the fly.&lt;/li&gt;
&lt;li&gt;Different settings for &lt;code&gt;glPolygonMode(GL_FRONT, ...)&lt;/code&gt; and
&lt;code&gt;glPolygonMode(GL_BACK, ...)&lt;/code&gt;. This one is &lt;em&gt;tricky&lt;/em&gt; to do correct, at least
if we want to support newer shader-stages like geometry and tessellation at
the same time. It&amp;rsquo;s also &lt;em&gt;hard&lt;/em&gt; to do performant, even without these
shader-stages, as we need to draw these primitives in the same order as they
were specified but with different primitive types. Luckily, Vulkan can do
pretty fast geometry submission, so there might be some hope for some
compromise-solution, at least. It might also be possible to combine
stream-out and a geometry-shader or something here if we really end up
caring about this use-case.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And most importantly, we are &lt;em&gt;not&lt;/em&gt; a conformant OpenGL implementation. I&amp;rsquo;m not
saying we will never be, but as it currently stands, we do not do conformance
testing, and as such we neither submit conformance results to Khronos.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s also worth noting that at this point, we tend to care more about
applications than theoretical use-cases and synthetic tests. That of course
doesn&amp;rsquo;t mean we do not care about correctness at all, it just means that we
have plenty of work ahead of us, and the work that gets us most real-world
benefit tends to take precedence. If you think otherwise, please send some
patches! 😉&lt;/p&gt;
&lt;h2 id=&#34;whats-the-performance-hit-compared-to-a-native-opengl-driver&#34;&gt;What&amp;rsquo;s the performance-hit compared to a &amp;ldquo;native&amp;rdquo; OpenGL driver?
&lt;a class=&#34;header-link&#34; href=&#34;#whats-the-performance-hit-compared-to-a-native-opengl-driver&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;One thing should be very clear; a &amp;ldquo;native&amp;rdquo; OpenGL driver will always have a
better performance-potential, simply because anything clever we do, they can
do as well. So I don&amp;rsquo;t expect to beat any serious OpenGL drivers on
performance any time soon.&lt;/p&gt;
&lt;p&gt;But the performance loss is already kinda less than I feared, especially since
we haven&amp;rsquo;t done anything particularly fancy with performance yet.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t yet have any systematic benchmark-numbers, and we currently have some
kinda stupid bottlenecks that should be very possible to solve. So I&amp;rsquo;m
reluctant to spend much time on benchmarking until those are fixed. Let&amp;rsquo;s just
say that I can play Quake 3 at tolerable frame rates right now ;)&lt;/p&gt;
&lt;p&gt;But OK, I will say this: I currently get around 475 FPS on glxgears on top of
Zink on my system. The i965 driver gives me around 1750 FPS. &lt;em&gt;Don&amp;rsquo;t read too
much into those results, though&lt;/em&gt;; glxgears isn&amp;rsquo;t a good benchmark. But for
that particular workload, we&amp;rsquo;re about a quarter of the performance. As I said,
I don&amp;rsquo;t think glxgears is a very good benchmark, but it&amp;rsquo;s the only thing
&lt;em&gt;somewhat&lt;/em&gt; reproducible that I&amp;rsquo;ve run so far, so it&amp;rsquo;s the only numbers I have.
I&amp;rsquo;ll certainly be doing some proper benchmarking in the future.&lt;/p&gt;
&lt;p&gt;In the end, I suspect that the pipeline-caching is going to be the big hot-spot.
There&amp;rsquo;s a lot of state to hash, and finally compare once a hit has been found.
We have some decent ideas on how to speed it up, but there&amp;rsquo;s probably going
to be some point where we simply can&amp;rsquo;t get it any better.&lt;/p&gt;
&lt;p&gt;But even then, perhaps we could introduce some OpenGL extension that allows an
application to &amp;ldquo;freeze&amp;rdquo; the render-state into some objects, similar to &lt;a href=&#34;https://www.khronos.org/opengl/wiki/Vertex_Specification#Vertex_Array_Object&#34;&gt;Vertex
Array Objects&lt;/a&gt;,
and that way completely bypass this problem for applications willing to do a
bit of support-code? The future will tell&amp;hellip;&lt;/p&gt;
&lt;p&gt;All in all, I&amp;rsquo;m not too worried about this yet. We&amp;rsquo;re still early in the
project, and I don&amp;rsquo;t see any major, impenetrable walls.&lt;/p&gt;
&lt;h2 id=&#34;how-to-use-zink&#34;&gt;How to use Zink
&lt;a class=&#34;header-link&#34; href=&#34;#how-to-use-zink&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Zink is only available as source code at the moment. No distro-packages exits
yet.&lt;/p&gt;
&lt;h3 id=&#34;requirements&#34;&gt;Requirements
&lt;a class=&#34;header-link&#34; href=&#34;#requirements&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;In order to build Zink, you need the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Build dependencies to compile Mesa&lt;/li&gt;
&lt;li&gt;Vulkan headers and libraries&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://mesonbuild.com/&#34;&gt;Meson&lt;/a&gt; and &lt;a href=&#34;https://ninja-build.org/&#34;&gt;Ninja&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;building&#34;&gt;Building
&lt;a class=&#34;header-link&#34; href=&#34;#building&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The code currently lives in &lt;a href=&#34;https://gitlab.freedesktop.org/kusma/mesa/tree/zink&#34;&gt;the zink-branch&lt;/a&gt;
in my &lt;a href=&#34;https://gitlab.freedesktop.org/kusma/mesa&#34;&gt;Mesa fork&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first thing you have to do, is to clone the repository and build the
&lt;code&gt;zink&lt;/code&gt;-branch. Even though Mesa has an autotools build-system, Zink only
supports the Meson build-system. Remember to enable the &lt;code&gt;zink&lt;/code&gt; gallium-driver
(&lt;code&gt;-Dgallium-drivers=zink&lt;/code&gt;) when configuring the build.&lt;/p&gt;
&lt;p&gt;Install the driver somewhere appropriate, and use the &lt;code&gt;$MESA_LOADER_DRIVER_OVERRIDE&lt;/code&gt;
environment variable to force the &lt;code&gt;zink&lt;/code&gt;-driver. From here you should be able
to run many OpenGL applications using Zink.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a rough recipe:&lt;/p&gt;

&lt;pre style=&#34;border-radius: 3px; background-color: #111; color: #999; padding: 0.25rem; overflow-x: auto;&#34;&gt;
$ &lt;span style=&#34;color: #fff;&#34;&gt;git clone https://gitlab.freedesktop.org/kusma/mesa.git mesa-zink&lt;/span&gt;
Cloning into &#39;mesa-zink&#39;...
&lt;span style=&#34;color: #555;&#34;&gt;...&lt;/span&gt;
Checking out files: 100% (5982/5982), done.
$ &lt;span style=&#34;color: #fff;&#34;&gt;cd mesa-zink&lt;/span&gt;
$ &lt;span style=&#34;color: #fff;&#34;&gt;git checkout zink&lt;/span&gt;
Branch &#39;zink&#39; set up to track remote branch &#39;zink&#39; from &#39;origin&#39;.
Switched to a new branch &#39;zink&#39;
$ &lt;span style=&#34;color: #fff;&#34;&gt;meson --prefix=/tmp/zink -Dgallium-drivers=zink build-zink&lt;/span&gt;
The Meson build system
&lt;span style=&#34;color: #555;&#34;&gt;...&lt;/span&gt;
Found ninja-X.Y.Z at /usr/bin/ninja
$ &lt;span style=&#34;color: #fff;&#34;&gt;ninja -C build-zink install&lt;/span&gt;
ninja: Entering directory &amp;#x60;build-zink&#39;
&lt;span style=&#34;color: #555;&#34;&gt;...&lt;/span&gt;
installing /home/kusma/temp/mesa-zink/build-zink/src/gallium/targets/dri/libgallium_dri.so to /tmp/zink/lib64/dri/zink_dri.so
$ &lt;span style=&#34;color: #fff;&#34;&gt;LIBGL_DRIVERS_PATH=/tmp/zink/lib64/dri/ MESA_LOADER_DRIVER_OVERRIDE=zink glxgears -info&lt;/span&gt;
GL_RENDERER   = zink (Intel(R) UHD Graphics 620 (Kabylake GT2))
GL_VERSION    = 2.1 Mesa 18.3.0-devel (git-395b12c2d7)
GL_VENDOR     = Collabora Ltd
GL_EXTENSIONS = GL_ARB_multisample GL_EXT_abgr &lt;span style=&#34;color: #555;&#34;&gt;...&lt;/span&gt;
&lt;/pre&gt;


&lt;h3 id=&#34;submitting-patches&#34;&gt;Submitting patches
&lt;a class=&#34;header-link&#34; href=&#34;#submitting-patches&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Currently, the development happens on &lt;code&gt;#dri-devel&lt;/code&gt; on &lt;a href=&#34;https://freenode.net/&#34;&gt;Freenode&lt;/a&gt;.
Ping me (my handle is &lt;code&gt;kusma&lt;/code&gt;) with a link your branch, and I&amp;rsquo;ll take a look.&lt;/p&gt;
&lt;h2 id=&#34;where-do-we-go-from-here&#34;&gt;Where do we go from here?
&lt;a class=&#34;header-link&#34; href=&#34;#where-do-we-go-from-here&#34;&gt;&lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Well, I think &amp;ldquo;forwards&amp;rdquo; is the only way to move 😉. I&amp;rsquo;m currently working
1-2 days per week on this at Collabora, so things will keep moving forward on
my end. In addition, Dave Airlie seems to have a high momentum at the moment
also. He has a work-in-progress branch that hints at GL 3.3 being around the
corner!&lt;/p&gt;
&lt;p&gt;I also don&amp;rsquo;t think there&amp;rsquo;s any fundamental reason why we shouldn&amp;rsquo;t be able to
get to full OpenGL 4.6 eventually.&lt;/p&gt;
&lt;p&gt;Besides the features, I also want to try to get this upstream in Mesa in some
not-too-distant future. I think we&amp;rsquo;re already beyond the point where Zink is
useful.&lt;/p&gt;
&lt;p&gt;I also would like to point out that &lt;a href=&#34;https://airlied.blogspot.com/&#34;&gt;David Airlie&lt;/a&gt;
of &lt;a href=&#34;https://www.redhat.com/&#34;&gt;RedHat&lt;/a&gt; has contributed a &lt;em&gt;lot&lt;/em&gt; of great patches,
greatly advancing Zink from what it was before his help! At this point, he has
implemented at least as many features as I have. So this is very much his
accomplishment as well.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
