SlideShare a Scribd company logo
Alejandro Piñeiro (apinheiro@igalia.com)g
ARB_gl_spirv: bringing
SPIR-V to Mesa OpenGL
Some news/announcement
first
XDC 2018 dates confirmed
●
Will be held in A Coruña, Spain
●
From September 26th
to September 29th
●
Follow www.twitter.com/xdc2018 for updates
Conformance
●
Intel Mesa driver for Linux is now OpenGL 4.6
conformant
●
Conformant on day one!
●
Thats includes ARB_gl_spirv tests
Topics covered
●
Introduction
●
Development history
●
Technical decisions
●
Testing
●
Current status and future
Introduction
Who is doing this?
●
Started by Nicolai Hähnle
●
Right now:
●
Alejandro Piñeiro
●
Eduardo Lima
●
Neil Roberts
●
Supported by Intel
GLSL
●
OpenGL Shading Language
●
C-Like language used to write shaders.
●
The shading source code is included on your
program, so it is easy to get it back
●
First anounced on 2004
SPIR-V
●
Introduced as SPIR in 2011
●
Standard Portable Intermediate Representation
●
OpenCL
●
Binary format
●
Based on LLVM IR
●
SPIR-V announced in 2015
●
Part of OpenCL 2.1 core and Vulkan core
●
Not based on LLVM IR anymore
OpenGL vs Vulkan
●
Some applications are porting from one to the
other, or want to support both
●
Some interoperatibility are desired
●
But one use GLSL, the other SPIR-V as shading
language
GL_KHR_vulkan_glsl
●
Modifies GLSL to be used for Vulkan (dec-2015)
●
But not as a direct consumer, but after being
compiled down to SPIR-V
●
Not a driver extension, but a frontend extension
GL_ARB_gl_spirv
●
Defines two things:
●
Allows SPIR-V module to be loaded on OpenGL
●
Modifies GLSL to be a source for creating SPIR-V
modules for OpenGL consumption.
●
Driver + frontend extension
GL_ARB_spirv_extensions
●
ARB_gl_spirv is focused on SPIR-V 1.0
●
This extension allows to expose which extra
functionality is supported.
●
Spec implies the possibility of OpenGL specific
SPIR-V extensions.
Khronos tools
●
Glslang
●
Khronos reference front-end for GLSL and ESSL
●
Sample SPIR-V generator
●
SPIRV-tools
●
Set of tools for processing SPIR-V modules
●
Assembler, disassembler, validator, and
optimizer
Base GLSL
●
KHR_vulkan_glsl remove and changes several
old-glsl features, and adds some vulkan-like
features
●
ARB_gl_spirv uses KHR_vulkan_glsl as base
●
But it restores some GLSL features, removes
some vulkan features, add specific ones and
tweak existing ones.
Examples
●
Subroutines: removed on both
●
Atomic counters:
●
Removed on KHR_vulkan_glsl
●
Re-added for ARB_gl_spirv
Perfect strangers
●
ARB_gl_spirv big change is having names as
optional, in a SPIR-V like fashion
●
Example: Frontend could get a GLSL with a ubo,
and ignore the name when creating the SPIR-V
●
That means that everything needs to work
without any name
●
You need to use location, binding, index, etc
Development history
Pre-history
●
“Interest in GL_ARB_gl_spirv” (2016-07-27)
●
Several driver developers added suggestions on
how to implement it
●
“[RFC] ARB_gl_spirv and NIR backend for
radeonsi” (Nicolai Hähnle, 2017-05-21)
●
Starting point with some code, focused on
radeonsi
●
Also starts the discussion for testing
Jumping in
●
Igalia jumped in on ~September 2017
●
Used Nicolai wip code as reference
●
Both mesa and piglit
●
Focused first on integrate it with the mesa driver
and check whats missing to get the (also wip) CTS
tests passing
NIR
●
Intermediate Representation of the shader,
created initially for Intel, used now on other
backends
●
So there is a GLSL→GLSL IR→NIR→Intel IR chain
on Mesa Intel drivers
●
Intel Vulkan driver introduced a SPIR-V to NIR
pass
But
●
Right now there is not linking on NIR
●
Linking is done on Mesa IR
●
NIR receives all the objects already linked
What it is a linker?
●
“Program that take two or more objects
generated by the compiler and links them to
create a executable program”
●
Abstracting *a lot*, the GLSL linker does:
●
Gather info from all the objects
●
Validates that all together makes sense
Reusing IR linker
●
GLSL IR linker is heavily based on the ir-variables
●
Nicolai Hähnle first approach was:
●
Use existing vulkan spir to nir
●
Convert nir variables to ir variable
●
Re-use as much possible IR linker
●
Use nir shader after that
●
Good approach for bootstrap
Coding and technical
decisions
First steps
●
Initial focus was getting the CTS tests working for
the Intel Mesa driver
●
That gave us a better understanding of what was
missing
More spirv to nir
●
Current spirv_to_nir pass was focused on Vulkan
●
Missed support for several features needed by
OpenGL, supported on SPIR-V:
●
Atomic counters
●
Transform feedback/geometry streams
●
Tessellation
●
OpenGL-friendly ubos/ssbos tweaking
Starting to rethink linking
●
IR-variable→nir variable approach was good to
get some support quickly supported
●
Example: atomic counters
●
But seemed somewhat artificial
●
*But* the spec tweaked too much GLSL needs,
specially when linking
Poster boy: ubos
●
GLSL IR linking code for ubos is based on the
name.
●
Explicit binding is optional.
●
Without explicit binding, it is assigned during the
linking
/* This hash table will track all of the uniform blocks that have been
* encountered. Since blocks with the same block-name must be the same,
* the hash is organized by block-name.
*/
Poster boy: ubos (II)
●
Under ARB_gl_spirv names are optional
●
Needs to work without them
●
Explicit binding is mandatory
●
Shared and packed layout are not supported
●
Only st140 possible (all ubos are active)
●
Not too much GLSL IR linker to reuse here
Big decision going
●
We need to rewrite a good bunch of the linker
●
It is really worth to over-complicate an already
existing linker?
●
All the info is already on the nir shader
●
Timothy Arceri was adding some linking-related
nir helpers
NIR based linker
●
Listing all the reasons:
●
What we have right is NIR
●
Linking would be already different on several
aspects
●
People were already adding nir-based linking
utilities
●
Scope defined:
●
It will be initially centered on ARB_gl_spirv
Focusing on passing CTS
●
With a clear dev plan, we focus on getting the
CTS tests passing
●
Clearly they covered most of the spec
●
They weren’t too many (8)
●
Tricky: they were also a WIP at the moment
●
We used some of our time testing, reviewing,
submitting feedback, and even fixes
●
The patchset reached v21!
We got it!
●
We got all the tests passing ~Oct/Nov
●
Next step was cleaning, and start to submit
patches (more on this later)
●
Clean enough for the CTS submission.
●
So we are done yet? Not really ...
Testing
More testing needed
●
Passing CTS is not enough to be considered
production ready
●
There are several aspects, especially execution
tests, that needs more coverage
●
Two main approaches:
●
Improve piglit
●
Work on a GLSL→SPIR-V backend
piglit
●
Piglit is an open-source test suite for OpenGL
implementation
●
Heavily used by piglit developers
●
shader_runner: run .shader_text txt file format:
●
shader source
●
Values for the uniforms, ubos, ssbos, etc
●
Check if linking or rendering was correct.
piglit – gl_spirv support (I)
●
Nicolai added support for ARB_gl_spirv
●
New script that parses .shader_test and call
glslang to create the SPIR-V binaries
●
It includes ad-hoc attempts to “fix” the shader
●
Support on shader_runner to load a SPIR-V binary
or include a SPIR-V text format and use spirv-tools
piglit – gl_spirv support (II)
●
You can easily switch using GLSL or SPIR-V for the
same test
●
You can write tests easily
●
Invaluable tool at this stage
●
We loved it!
●
Thanks
piglit – gl_spirv support(III)
●
We added some features:
●
Feed ubo support without using names
●
To test SPIR-V execution testing without no
names
●
In any case, it is not clear if all this will go
upstream
●
Some doubs on mesa-dev for the approach
●
Some see glslang dependency as a no-go
GLSL to SPIR-V backend (I)
●
Suggested by Jason on “Adding a SPIR-V back-end
to the GLSL compiler” (Jason Ekstrand, 2017-05-
26). Main Advantages:
●
Provide another GLSL to SPIR-V compiler
●
Optimizations
●
ARB_gl_spirv testing
GLSL to SPIR-V backend (II)
●
“The first of the real SPIR-V work” (Ian Romanick,
v1 2017-10-11, v2 2017-11-21)
●
First version of the back-end
●
Some patches reviewed
●
Some features pending (like ubos)
GLSL to SPIR-V backend(III)
●
For ARB_gl_spirv the idea would do this:
●
GLSL→GLSL IR→SPIR-V→NIR
●
Conditionally.
●
Internally it would need to do the “fixing”
●
Would allow to run piglit tests without changes
●
But:
●
Not finished
●
We would still need to modify how to feed data
Current status and future
What’s working
●
A little of everything is partially covered:
●
Uniforms
●
Atomic counters
●
UBOs and SSBOs
●
Tessellation shaders
●
Transform feedback/Geometry streams
●
We have plenty of programs working
●
ARB_spirv_extensions fully complete
What’s missing
●
Poulish all the previous features
●
Arrays of arrays
●
Some support for ubos on the linker
●
Failing on the spirv to nir pass
●
Multisample Image Array
●
Validation
●
More testing
Upstreaming
●
Right now our mesa development branch has
~80 patches
●
Plan is sending them in small batches
●
We already sent a first patchset
●
“Initial gl_spirv and spirv_extensions support in
Mesa and i965” (Eduardo Lima, 2017-11-17)
●
Partly reviewed. V4 sent in January.
Questions?

More Related Content

What's hot

QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?
Edward Willink
 
Building SciPy kernels with Pythran
Building SciPy kernels with PythranBuilding SciPy kernels with Pythran
Building SciPy kernels with Pythran
Ralf Gommers
 
Active record, standalone migrations, and working with Arel
Active record, standalone migrations, and working with ArelActive record, standalone migrations, and working with Arel
Active record, standalone migrations, and working with Arel
Alex Tironati
 
Decentralized Evolution and Consolidation of RDF Graphs
Decentralized Evolution and Consolidation of RDF GraphsDecentralized Evolution and Consolidation of RDF Graphs
Decentralized Evolution and Consolidation of RDF Graphs
Aksw Group
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
ElasTest Project
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
Puja Pramudya
 
Helpful into to Rx
Helpful into to RxHelpful into to Rx
Helpful into to Rx
Serg Dort
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
Red Hat Developers
 
JerryScript on RIOT
JerryScript on RIOTJerryScript on RIOT
JerryScript on RIOT
Samsung Open Source Group
 
OctConf 2013 - Improve JIT Compiling
OctConf 2013 - Improve JIT CompilingOctConf 2013 - Improve JIT Compiling
OctConf 2013 - Improve JIT CompilingLYH-Kernel
 
At Last an OCL Debugger
At Last an OCL DebuggerAt Last an OCL Debugger
At Last an OCL Debugger
Edward Willink
 
BUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceBUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open Source
Linaro
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
Mukta Aphale
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
account inactive
 
[Public] gerrit concepts and workflows
[Public] gerrit   concepts and workflows[Public] gerrit   concepts and workflows
[Public] gerrit concepts and workflows
Yanbin Kong
 
Lcu14 312-Introduction to the Ecosystem day
Lcu14 312-Introduction to the Ecosystem day Lcu14 312-Introduction to the Ecosystem day
Lcu14 312-Introduction to the Ecosystem day
Linaro
 

What's hot (16)

QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?
 
Building SciPy kernels with Pythran
Building SciPy kernels with PythranBuilding SciPy kernels with Pythran
Building SciPy kernels with Pythran
 
Active record, standalone migrations, and working with Arel
Active record, standalone migrations, and working with ArelActive record, standalone migrations, and working with Arel
Active record, standalone migrations, and working with Arel
 
Decentralized Evolution and Consolidation of RDF Graphs
Decentralized Evolution and Consolidation of RDF GraphsDecentralized Evolution and Consolidation of RDF Graphs
Decentralized Evolution and Consolidation of RDF Graphs
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
 
Helpful into to Rx
Helpful into to RxHelpful into to Rx
Helpful into to Rx
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
 
JerryScript on RIOT
JerryScript on RIOTJerryScript on RIOT
JerryScript on RIOT
 
OctConf 2013 - Improve JIT Compiling
OctConf 2013 - Improve JIT CompilingOctConf 2013 - Improve JIT Compiling
OctConf 2013 - Improve JIT Compiling
 
At Last an OCL Debugger
At Last an OCL DebuggerAt Last an OCL Debugger
At Last an OCL Debugger
 
BUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceBUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open Source
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
 
[Public] gerrit concepts and workflows
[Public] gerrit   concepts and workflows[Public] gerrit   concepts and workflows
[Public] gerrit concepts and workflows
 
Lcu14 312-Introduction to the Ecosystem day
Lcu14 312-Introduction to the Ecosystem day Lcu14 312-Introduction to the Ecosystem day
Lcu14 312-Introduction to the Ecosystem day
 

Similar to ARB_gl_spirv: bringing SPIR-V to Mesa OpenGL (FOSDEM 2018)

ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
Igalia
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
 
kpatch.kgraft
kpatch.kgraftkpatch.kgraft
kpatch.kgraft
Udo Seidel
 
Nova Updates - Kilo Edition
Nova Updates - Kilo EditionNova Updates - Kilo Edition
Nova Updates - Kilo Edition
OpenStack Foundation
 
OpenStack Compute - Juno Updates
OpenStack Compute - Juno UpdatesOpenStack Compute - Juno Updates
OpenStack Compute - Juno Updates
OpenStack Foundation
 
LCU14 303- Toolchain Collaboration
LCU14 303- Toolchain CollaborationLCU14 303- Toolchain Collaboration
LCU14 303- Toolchain Collaboration
Linaro
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2
Linaro
 
Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10
Alexander Knowles
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
Sumit Maheshwari
 
apacheairflow-160827123852.pdf
apacheairflow-160827123852.pdfapacheairflow-160827123852.pdf
apacheairflow-160827123852.pdf
vijayapraba1
 
BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr
Linaro
 
Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)
NerdWalletHQ
 
ceph openstack dream team
ceph openstack dream teamceph openstack dream team
ceph openstack dream team
Udo Seidel
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
Linaro
 
SFO15-110: Toolchain Collaboration
SFO15-110: Toolchain CollaborationSFO15-110: Toolchain Collaboration
SFO15-110: Toolchain Collaboration
Linaro
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present futurelolopetit
 
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
Linaro
 
Ostd.ksplice.talk
Ostd.ksplice.talkOstd.ksplice.talk
Ostd.ksplice.talk
Udo Seidel
 
Angular CLI : HelloWorld
Angular CLI : HelloWorldAngular CLI : HelloWorld
Angular CLI : HelloWorld
nikspatel007
 
Summer Internship Project - Remote Render
Summer Internship Project - Remote RenderSummer Internship Project - Remote Render
Summer Internship Project - Remote Render
Yen-Kuan Wu
 

Similar to ARB_gl_spirv: bringing SPIR-V to Mesa OpenGL (FOSDEM 2018) (20)

ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
kpatch.kgraft
kpatch.kgraftkpatch.kgraft
kpatch.kgraft
 
Nova Updates - Kilo Edition
Nova Updates - Kilo EditionNova Updates - Kilo Edition
Nova Updates - Kilo Edition
 
OpenStack Compute - Juno Updates
OpenStack Compute - Juno UpdatesOpenStack Compute - Juno Updates
OpenStack Compute - Juno Updates
 
LCU14 303- Toolchain Collaboration
LCU14 303- Toolchain CollaborationLCU14 303- Toolchain Collaboration
LCU14 303- Toolchain Collaboration
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2
 
Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 
apacheairflow-160827123852.pdf
apacheairflow-160827123852.pdfapacheairflow-160827123852.pdf
apacheairflow-160827123852.pdf
 
BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr
 
Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)
 
ceph openstack dream team
ceph openstack dream teamceph openstack dream team
ceph openstack dream team
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
SFO15-110: Toolchain Collaboration
SFO15-110: Toolchain CollaborationSFO15-110: Toolchain Collaboration
SFO15-110: Toolchain Collaboration
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
 
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
 
Ostd.ksplice.talk
Ostd.ksplice.talkOstd.ksplice.talk
Ostd.ksplice.talk
 
Angular CLI : HelloWorld
Angular CLI : HelloWorldAngular CLI : HelloWorld
Angular CLI : HelloWorld
 
Summer Internship Project - Remote Render
Summer Internship Project - Remote RenderSummer Internship Project - Remote Render
Summer Internship Project - Remote Render
 

More from Igalia

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
Igalia
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
Igalia
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
Igalia
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
Igalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
Igalia
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Igalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
Igalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
Igalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
Igalia
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
Igalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
Igalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Igalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
Igalia
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
Igalia
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
Igalia
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
Igalia
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Igalia
 

More from Igalia (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...
 

Recently uploaded

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

ARB_gl_spirv: bringing SPIR-V to Mesa OpenGL (FOSDEM 2018)

  • 3. XDC 2018 dates confirmed ● Will be held in A Coruña, Spain ● From September 26th to September 29th ● Follow www.twitter.com/xdc2018 for updates
  • 4. Conformance ● Intel Mesa driver for Linux is now OpenGL 4.6 conformant ● Conformant on day one! ● Thats includes ARB_gl_spirv tests
  • 5. Topics covered ● Introduction ● Development history ● Technical decisions ● Testing ● Current status and future
  • 7. Who is doing this? ● Started by Nicolai Hähnle ● Right now: ● Alejandro Piñeiro ● Eduardo Lima ● Neil Roberts ● Supported by Intel
  • 8. GLSL ● OpenGL Shading Language ● C-Like language used to write shaders. ● The shading source code is included on your program, so it is easy to get it back ● First anounced on 2004
  • 9. SPIR-V ● Introduced as SPIR in 2011 ● Standard Portable Intermediate Representation ● OpenCL ● Binary format ● Based on LLVM IR ● SPIR-V announced in 2015 ● Part of OpenCL 2.1 core and Vulkan core ● Not based on LLVM IR anymore
  • 10. OpenGL vs Vulkan ● Some applications are porting from one to the other, or want to support both ● Some interoperatibility are desired ● But one use GLSL, the other SPIR-V as shading language
  • 11. GL_KHR_vulkan_glsl ● Modifies GLSL to be used for Vulkan (dec-2015) ● But not as a direct consumer, but after being compiled down to SPIR-V ● Not a driver extension, but a frontend extension
  • 12. GL_ARB_gl_spirv ● Defines two things: ● Allows SPIR-V module to be loaded on OpenGL ● Modifies GLSL to be a source for creating SPIR-V modules for OpenGL consumption. ● Driver + frontend extension
  • 13. GL_ARB_spirv_extensions ● ARB_gl_spirv is focused on SPIR-V 1.0 ● This extension allows to expose which extra functionality is supported. ● Spec implies the possibility of OpenGL specific SPIR-V extensions.
  • 14. Khronos tools ● Glslang ● Khronos reference front-end for GLSL and ESSL ● Sample SPIR-V generator ● SPIRV-tools ● Set of tools for processing SPIR-V modules ● Assembler, disassembler, validator, and optimizer
  • 15. Base GLSL ● KHR_vulkan_glsl remove and changes several old-glsl features, and adds some vulkan-like features ● ARB_gl_spirv uses KHR_vulkan_glsl as base ● But it restores some GLSL features, removes some vulkan features, add specific ones and tweak existing ones.
  • 16. Examples ● Subroutines: removed on both ● Atomic counters: ● Removed on KHR_vulkan_glsl ● Re-added for ARB_gl_spirv
  • 17. Perfect strangers ● ARB_gl_spirv big change is having names as optional, in a SPIR-V like fashion ● Example: Frontend could get a GLSL with a ubo, and ignore the name when creating the SPIR-V ● That means that everything needs to work without any name ● You need to use location, binding, index, etc
  • 19. Pre-history ● “Interest in GL_ARB_gl_spirv” (2016-07-27) ● Several driver developers added suggestions on how to implement it ● “[RFC] ARB_gl_spirv and NIR backend for radeonsi” (Nicolai Hähnle, 2017-05-21) ● Starting point with some code, focused on radeonsi ● Also starts the discussion for testing
  • 20. Jumping in ● Igalia jumped in on ~September 2017 ● Used Nicolai wip code as reference ● Both mesa and piglit ● Focused first on integrate it with the mesa driver and check whats missing to get the (also wip) CTS tests passing
  • 21. NIR ● Intermediate Representation of the shader, created initially for Intel, used now on other backends ● So there is a GLSL→GLSL IR→NIR→Intel IR chain on Mesa Intel drivers ● Intel Vulkan driver introduced a SPIR-V to NIR pass
  • 22. But ● Right now there is not linking on NIR ● Linking is done on Mesa IR ● NIR receives all the objects already linked
  • 23. What it is a linker? ● “Program that take two or more objects generated by the compiler and links them to create a executable program” ● Abstracting *a lot*, the GLSL linker does: ● Gather info from all the objects ● Validates that all together makes sense
  • 24. Reusing IR linker ● GLSL IR linker is heavily based on the ir-variables ● Nicolai Hähnle first approach was: ● Use existing vulkan spir to nir ● Convert nir variables to ir variable ● Re-use as much possible IR linker ● Use nir shader after that ● Good approach for bootstrap
  • 26. First steps ● Initial focus was getting the CTS tests working for the Intel Mesa driver ● That gave us a better understanding of what was missing
  • 27. More spirv to nir ● Current spirv_to_nir pass was focused on Vulkan ● Missed support for several features needed by OpenGL, supported on SPIR-V: ● Atomic counters ● Transform feedback/geometry streams ● Tessellation ● OpenGL-friendly ubos/ssbos tweaking
  • 28. Starting to rethink linking ● IR-variable→nir variable approach was good to get some support quickly supported ● Example: atomic counters ● But seemed somewhat artificial ● *But* the spec tweaked too much GLSL needs, specially when linking
  • 29. Poster boy: ubos ● GLSL IR linking code for ubos is based on the name. ● Explicit binding is optional. ● Without explicit binding, it is assigned during the linking /* This hash table will track all of the uniform blocks that have been * encountered. Since blocks with the same block-name must be the same, * the hash is organized by block-name. */
  • 30. Poster boy: ubos (II) ● Under ARB_gl_spirv names are optional ● Needs to work without them ● Explicit binding is mandatory ● Shared and packed layout are not supported ● Only st140 possible (all ubos are active) ● Not too much GLSL IR linker to reuse here
  • 31. Big decision going ● We need to rewrite a good bunch of the linker ● It is really worth to over-complicate an already existing linker? ● All the info is already on the nir shader ● Timothy Arceri was adding some linking-related nir helpers
  • 32. NIR based linker ● Listing all the reasons: ● What we have right is NIR ● Linking would be already different on several aspects ● People were already adding nir-based linking utilities ● Scope defined: ● It will be initially centered on ARB_gl_spirv
  • 33. Focusing on passing CTS ● With a clear dev plan, we focus on getting the CTS tests passing ● Clearly they covered most of the spec ● They weren’t too many (8) ● Tricky: they were also a WIP at the moment ● We used some of our time testing, reviewing, submitting feedback, and even fixes ● The patchset reached v21!
  • 34. We got it! ● We got all the tests passing ~Oct/Nov ● Next step was cleaning, and start to submit patches (more on this later) ● Clean enough for the CTS submission. ● So we are done yet? Not really ...
  • 36. More testing needed ● Passing CTS is not enough to be considered production ready ● There are several aspects, especially execution tests, that needs more coverage ● Two main approaches: ● Improve piglit ● Work on a GLSL→SPIR-V backend
  • 37. piglit ● Piglit is an open-source test suite for OpenGL implementation ● Heavily used by piglit developers ● shader_runner: run .shader_text txt file format: ● shader source ● Values for the uniforms, ubos, ssbos, etc ● Check if linking or rendering was correct.
  • 38. piglit – gl_spirv support (I) ● Nicolai added support for ARB_gl_spirv ● New script that parses .shader_test and call glslang to create the SPIR-V binaries ● It includes ad-hoc attempts to “fix” the shader ● Support on shader_runner to load a SPIR-V binary or include a SPIR-V text format and use spirv-tools
  • 39. piglit – gl_spirv support (II) ● You can easily switch using GLSL or SPIR-V for the same test ● You can write tests easily ● Invaluable tool at this stage ● We loved it! ● Thanks
  • 40. piglit – gl_spirv support(III) ● We added some features: ● Feed ubo support without using names ● To test SPIR-V execution testing without no names ● In any case, it is not clear if all this will go upstream ● Some doubs on mesa-dev for the approach ● Some see glslang dependency as a no-go
  • 41. GLSL to SPIR-V backend (I) ● Suggested by Jason on “Adding a SPIR-V back-end to the GLSL compiler” (Jason Ekstrand, 2017-05- 26). Main Advantages: ● Provide another GLSL to SPIR-V compiler ● Optimizations ● ARB_gl_spirv testing
  • 42. GLSL to SPIR-V backend (II) ● “The first of the real SPIR-V work” (Ian Romanick, v1 2017-10-11, v2 2017-11-21) ● First version of the back-end ● Some patches reviewed ● Some features pending (like ubos)
  • 43. GLSL to SPIR-V backend(III) ● For ARB_gl_spirv the idea would do this: ● GLSL→GLSL IR→SPIR-V→NIR ● Conditionally. ● Internally it would need to do the “fixing” ● Would allow to run piglit tests without changes ● But: ● Not finished ● We would still need to modify how to feed data
  • 45. What’s working ● A little of everything is partially covered: ● Uniforms ● Atomic counters ● UBOs and SSBOs ● Tessellation shaders ● Transform feedback/Geometry streams ● We have plenty of programs working ● ARB_spirv_extensions fully complete
  • 46. What’s missing ● Poulish all the previous features ● Arrays of arrays ● Some support for ubos on the linker ● Failing on the spirv to nir pass ● Multisample Image Array ● Validation ● More testing
  • 47. Upstreaming ● Right now our mesa development branch has ~80 patches ● Plan is sending them in small batches ● We already sent a first patchset ● “Initial gl_spirv and spirv_extensions support in Mesa and i965” (Eduardo Lima, 2017-11-17) ● Partly reviewed. V4 sent in January.