SlideShare a Scribd company logo
1 of 24
Download to read offline
Replacing the geometry pipeline
with mesh shaders
Ricardo Garcia
October 4
XDC 2022, Minneapolis
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Main Points
 What are mesh shaders?
 Comparison between classic and mesh shading pipelines
 Problems mesh shaders try to solve
 What a mesh shader looks like
 Problems introduced by mesh shaders
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
What is mesh shading?
 New type of graphics pipeline with simplified stages
 Tries to address shortcoming with classic graphics pipelines on modern HW
 Brings the geometry part of the pipeline closer to the compute model
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Classic Graphics Pipeline
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Mesh Shading Pipeline
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Mesh Shading Pipeline (Full)
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Classic Pipeline Problems
 Vertex inputs are annoying
 No control over how geometry is arranged
 Waste of compute resources
 Waste of memory bandwidth
 Geometry amplification and modification should be simpler and more flexible
 Maybe we can use a model that’s closer to compute shaders
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
How do they look?
#version 450
#extension GL_EXT_mesh_shader : enable
void main ()
{
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
How do they look?
#version 450
#extension GL_EXT_mesh_shader : enable
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations.
void main ()
{
// Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc.
// Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc.
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
How do they look?
#version 450
#extension GL_EXT_mesh_shader : enable
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations.
layout (triangles) out; // May also be points or lines.
void main ()
{
// Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc.
// Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc.
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
How do they look?
#version 450
#extension GL_EXT_mesh_shader : enable
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations.
layout (triangles) out; // May also be points or lines.
layout (max_vertices=V, max_primitives=P) out; // Typical limit: 256 vert/prim.
void main ()
{
// Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc.
// Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc.
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
How do they look?
#version 450
#extension GL_EXT_mesh_shader : enable
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations.
layout (triangles) out; // May also be points or lines.
layout (max_vertices=V, max_primitives=P) out; // Typical limit: 256 vert/prim.
void main ()
{
// Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc.
// Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc.
SetMeshOutputsEXT(ACTUAL_V, ACTUAL_P);
gl_MeshVerticesEXT[FOO].gl_Position = vec4(…);
gl_PrimitiveTriangleIndicesEXT[BAR] = uvec3(…);
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
How do they look?
#version 450
#extension GL_EXT_mesh_shader : enable
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations.
layout (triangles) out; // May also be points or lines.
layout (max_vertices=V, max_primitives=P) out; // Typical limit: 256 vert/prim.
layout (location=0) out vec4 out0[]; // Per-vertex.
layout (location=1) perprimitiveEXT out vec4 out1[]; // Per-primitive.
void main ()
{
// Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc.
// Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc.
SetMeshOutputsEXT(ACTUAL_V, ACTUAL_P);
gl_MeshVerticesEXT[FOO].gl_Position = vec4(…);
gl_PrimitiveTriangleIndicesEXT[BAR] = uvec3(…);
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Some built-in arrays
// write only access
out uint gl_PrimitivePointIndicesEXT[];
out uvec2 gl_PrimitiveLineIndicesEXT[];
out uvec3 gl_PrimitiveTriangleIndicesEXT[];
// write only access
out gl_MeshPerVertexEXT {
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
float gl_CullDistance[];
} gl_MeshVerticesEXT[];
// write only access
perprimitiveEXT out gl_MeshPerPrimitiveEXT {
int gl_PrimitiveID;
int gl_Layer;
int gl_ViewportIndex;
bool gl_CullPrimitiveEXT;
int gl_PrimitiveShadingRateEXT;
} gl_MeshPrimitivesEXT[];
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Meshlets
Image source: https://developer.nvidia.com/blog/introduction-turing-mesh-shaders/
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Dispatching Work Groups
 vkCmdDrawMeshTasksEXT(cmdBuffer, X, Y, Z);
 vkCmdDrawMeshTasksIndirectEXT(cmdBuffer, ...)
 vkCmdDrawMeshTasksIndirectCountEXT(cmdBuffer, …);
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Mesh Shading Pipeline (Full)
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Task (Amplification) Shader
Similar to a two-level compute dispatch
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Task (Amplification) Shader
To uniquely identify the work that needs to be done in each mesh shader work group,
info needs to be passed from the task shader to the mesh shader.
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Payload
#version 450
#extension GL_EXT_mesh_shader : enable
// Typical limit: 128 invocations.
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in;
struct TaskData {
…
};
taskPayloadSharedEXT TaskData td;
void main ()
{
// Prepare payload for children.
td.SOMETHING = SOMETHING_ELSE;
// Example: (2, 1, 1)
EmitMeshTasksEXT(MeshX, MeshY, MeshZ);
}
#version 450
#extension GL_EXT_mesh_shader : enable
layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in;
layout (triangles) out;
layout (max_vertices=V, max_primitives=P);
struct TaskData {
…
};
taskPayloadSharedEXT TaskData td;
void main ()
{
// Use data from td.
SetMeshOutputsEXT(ACTUAL_V, ACTUAL_P);
gl_MeshVerticesEXT[FOO].gl_Position = …;
gl_MeshTriangleIndicesEXT[BAR] = uvec3(…);
}
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Mesh Shading Pros
 Avoids input assembly bottlenecks.
 Can pre-compute data and discard geometry in advance.
 Can save memory bandwidth by not pulling in unneeded data.
 Flexible geometry amplification.
 Non-sequential programming model.
 Can be used to streamline compute pre-passes into pipeline.
 Can be used as a two-level compute pipeline.
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Mesh Shading Cons
 Problematic for tilers.
 Leaving choices to the user increases room for errors.
 Increases coupling of in-memory vertex data with shaders.
 Different vendors recommend different things for performance.
●
Exposed as properties in the extension.
●
Lower number of invocations, loop.
●
Higher number of invocations, access arrays with gl_LocalInvocationIndex.
Replacing the geometry pipeline with mesh shaders
Ricardo Garcia, 2022-10-04
Q&A
Replacing the geometry pipeline with mesh shaders

More Related Content

Similar to Replacing the geometry pipeline with mesh shaders

Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Greg Hogan – To Petascale and Beyond- Apache Flink in the CloudsGreg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Greg Hogan – To Petascale and Beyond- Apache Flink in the CloudsFlink Forward
 
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its author
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its authorKaggle Winning Solution Xgboost algorithm -- Let us learn from its author
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its authorVivian S. Zhang
 
pyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdfpyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdfAsher Sterkin
 
Refactoring - improving the smell of your code
Refactoring - improving the smell of your codeRefactoring - improving the smell of your code
Refactoring - improving the smell of your codevmandrychenko
 
Extend GraphQL with directives
Extend GraphQL with directivesExtend GraphQL with directives
Extend GraphQL with directivesGreg Bergé
 
Introduction to CUDA C: NVIDIA : Notes
Introduction to CUDA C: NVIDIA : NotesIntroduction to CUDA C: NVIDIA : Notes
Introduction to CUDA C: NVIDIA : NotesSubhajit Sahu
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Data Con LA
 
Improving Apache Spark Downscaling
 Improving Apache Spark Downscaling Improving Apache Spark Downscaling
Improving Apache Spark DownscalingDatabricks
 
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...Alessandro Confetti
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBJonathan Weiss
 
Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...
Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...
Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...DataStax
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraJim Hatcher
 
Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5SAP Concur
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010Jonathan Weiss
 
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介Masayuki Matsushita
 
Using Backbone.js with Drupal 7 and 8
Using Backbone.js with Drupal 7 and 8Using Backbone.js with Drupal 7 and 8
Using Backbone.js with Drupal 7 and 8Ovadiah Myrgorod
 
CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010Jonathan Weiss
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksJinTaek Seo
 

Similar to Replacing the geometry pipeline with mesh shaders (20)

Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Greg Hogan – To Petascale and Beyond- Apache Flink in the CloudsGreg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
 
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its author
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its authorKaggle Winning Solution Xgboost algorithm -- Let us learn from its author
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its author
 
Backbone js-slides
Backbone js-slidesBackbone js-slides
Backbone js-slides
 
pyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdfpyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdf
 
Refactoring - improving the smell of your code
Refactoring - improving the smell of your codeRefactoring - improving the smell of your code
Refactoring - improving the smell of your code
 
Extend GraphQL with directives
Extend GraphQL with directivesExtend GraphQL with directives
Extend GraphQL with directives
 
Introduction to CUDA C: NVIDIA : Notes
Introduction to CUDA C: NVIDIA : NotesIntroduction to CUDA C: NVIDIA : Notes
Introduction to CUDA C: NVIDIA : Notes
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
 
Improving Apache Spark Downscaling
 Improving Apache Spark Downscaling Improving Apache Spark Downscaling
Improving Apache Spark Downscaling
 
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDB
 
Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...
Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...
Using Spark to Load Oracle Data into Cassandra (Jim Hatcher, IHS Markit) | C*...
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
 
Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010
 
CouchDB on Rails
CouchDB on RailsCouchDB on Rails
CouchDB on Rails
 
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
 
Using Backbone.js with Drupal 7 and 8
Using Backbone.js with Drupal 7 and 8Using Backbone.js with Drupal 7 and 8
Using Backbone.js with Drupal 7 and 8
 
CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
 

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 WPEIgalia
 
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
 
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 DevicesIgalia
 
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 MaintenanceIgalia
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfIgalia
 
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 JITIgalia
 
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 GStreamerIgalia
 
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 MesaIgalia
 
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 IgaliaIgalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera LinuxIgalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
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 GPUsIgalia
 
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 devicesIgalia
 
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 ChromeOSIgalia
 
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 webIgalia
 
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 RaspberryIgalia
 
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
 
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...
 
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
 
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

Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 

Recently uploaded (20)

Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 

Replacing the geometry pipeline with mesh shaders

  • 1. Replacing the geometry pipeline with mesh shaders Ricardo Garcia October 4 XDC 2022, Minneapolis
  • 2. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Main Points  What are mesh shaders?  Comparison between classic and mesh shading pipelines  Problems mesh shaders try to solve  What a mesh shader looks like  Problems introduced by mesh shaders
  • 3. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 What is mesh shading?  New type of graphics pipeline with simplified stages  Tries to address shortcoming with classic graphics pipelines on modern HW  Brings the geometry part of the pipeline closer to the compute model
  • 4. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Classic Graphics Pipeline
  • 5. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Mesh Shading Pipeline
  • 6. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Mesh Shading Pipeline (Full)
  • 7. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Classic Pipeline Problems  Vertex inputs are annoying  No control over how geometry is arranged  Waste of compute resources  Waste of memory bandwidth  Geometry amplification and modification should be simpler and more flexible  Maybe we can use a model that’s closer to compute shaders
  • 8. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 How do they look? #version 450 #extension GL_EXT_mesh_shader : enable void main () { }
  • 9. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 How do they look? #version 450 #extension GL_EXT_mesh_shader : enable layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations. void main () { // Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc. // Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc. }
  • 10. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 How do they look? #version 450 #extension GL_EXT_mesh_shader : enable layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations. layout (triangles) out; // May also be points or lines. void main () { // Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc. // Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc. }
  • 11. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 How do they look? #version 450 #extension GL_EXT_mesh_shader : enable layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations. layout (triangles) out; // May also be points or lines. layout (max_vertices=V, max_primitives=P) out; // Typical limit: 256 vert/prim. void main () { // Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc. // Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc. }
  • 12. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 How do they look? #version 450 #extension GL_EXT_mesh_shader : enable layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations. layout (triangles) out; // May also be points or lines. layout (max_vertices=V, max_primitives=P) out; // Typical limit: 256 vert/prim. void main () { // Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc. // Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc. SetMeshOutputsEXT(ACTUAL_V, ACTUAL_P); gl_MeshVerticesEXT[FOO].gl_Position = vec4(…); gl_PrimitiveTriangleIndicesEXT[BAR] = uvec3(…); }
  • 13. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 How do they look? #version 450 #extension GL_EXT_mesh_shader : enable layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; // Typical limit: 128 invocations. layout (triangles) out; // May also be points or lines. layout (max_vertices=V, max_primitives=P) out; // Typical limit: 256 vert/prim. layout (location=0) out vec4 out0[]; // Per-vertex. layout (location=1) perprimitiveEXT out vec4 out1[]; // Per-primitive. void main () { // Typical compute built-ins: gl_NumWorkGroups, gl_WorkGroupID, gl_LocalInvocationID, etc. // Typical subgroup functionality: gl_NumSubgroups, gl_SubgroupID, subgroupElect(), etc. SetMeshOutputsEXT(ACTUAL_V, ACTUAL_P); gl_MeshVerticesEXT[FOO].gl_Position = vec4(…); gl_PrimitiveTriangleIndicesEXT[BAR] = uvec3(…); }
  • 14. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Some built-in arrays // write only access out uint gl_PrimitivePointIndicesEXT[]; out uvec2 gl_PrimitiveLineIndicesEXT[]; out uvec3 gl_PrimitiveTriangleIndicesEXT[]; // write only access out gl_MeshPerVertexEXT { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; float gl_CullDistance[]; } gl_MeshVerticesEXT[]; // write only access perprimitiveEXT out gl_MeshPerPrimitiveEXT { int gl_PrimitiveID; int gl_Layer; int gl_ViewportIndex; bool gl_CullPrimitiveEXT; int gl_PrimitiveShadingRateEXT; } gl_MeshPrimitivesEXT[];
  • 15. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Meshlets Image source: https://developer.nvidia.com/blog/introduction-turing-mesh-shaders/
  • 16. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Dispatching Work Groups  vkCmdDrawMeshTasksEXT(cmdBuffer, X, Y, Z);  vkCmdDrawMeshTasksIndirectEXT(cmdBuffer, ...)  vkCmdDrawMeshTasksIndirectCountEXT(cmdBuffer, …);
  • 17. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Mesh Shading Pipeline (Full)
  • 18. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Task (Amplification) Shader Similar to a two-level compute dispatch
  • 19. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Task (Amplification) Shader To uniquely identify the work that needs to be done in each mesh shader work group, info needs to be passed from the task shader to the mesh shader.
  • 20. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Payload #version 450 #extension GL_EXT_mesh_shader : enable // Typical limit: 128 invocations. layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; struct TaskData { … }; taskPayloadSharedEXT TaskData td; void main () { // Prepare payload for children. td.SOMETHING = SOMETHING_ELSE; // Example: (2, 1, 1) EmitMeshTasksEXT(MeshX, MeshY, MeshZ); } #version 450 #extension GL_EXT_mesh_shader : enable layout (local_size_x=X, local_size_y=Y, local_size_z=Z) in; layout (triangles) out; layout (max_vertices=V, max_primitives=P); struct TaskData { … }; taskPayloadSharedEXT TaskData td; void main () { // Use data from td. SetMeshOutputsEXT(ACTUAL_V, ACTUAL_P); gl_MeshVerticesEXT[FOO].gl_Position = …; gl_MeshTriangleIndicesEXT[BAR] = uvec3(…); }
  • 21. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Mesh Shading Pros  Avoids input assembly bottlenecks.  Can pre-compute data and discard geometry in advance.  Can save memory bandwidth by not pulling in unneeded data.  Flexible geometry amplification.  Non-sequential programming model.  Can be used to streamline compute pre-passes into pipeline.  Can be used as a two-level compute pipeline.
  • 22. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Mesh Shading Cons  Problematic for tilers.  Leaving choices to the user increases room for errors.  Increases coupling of in-memory vertex data with shaders.  Different vendors recommend different things for performance. ● Exposed as properties in the extension. ● Lower number of invocations, loop. ● Higher number of invocations, access arrays with gl_LocalInvocationIndex.
  • 23. Replacing the geometry pipeline with mesh shaders Ricardo Garcia, 2022-10-04 Q&A