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
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraJim Hatcher
 
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
 
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
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
 
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*...
 
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

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 

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