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

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 

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