Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the ext_mesh_shader extension #2433

Merged
merged 9 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions vulkano-shaders/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@
//! of the following:
//!
//! - `vertex`
//! - `fragment`
//! - `geometry`
//! - `tess_ctrl`
//! - `tess_eval`
//! - `geometry`
//! - `task`
//! - `mesh`
//! - `fragment`
//! - `compute`
//! - `raygen`
//! - `anyhit`
Expand Down Expand Up @@ -421,10 +423,12 @@ impl Parse for MacroInput {

output.0 = Some(match lit.value().as_str() {
"vertex" => ShaderKind::Vertex,
"fragment" => ShaderKind::Fragment,
"geometry" => ShaderKind::Geometry,
"tess_ctrl" => ShaderKind::TessControl,
"tess_eval" => ShaderKind::TessEvaluation,
"geometry" => ShaderKind::Geometry,
"task" => ShaderKind::Task,
"mesh" => ShaderKind::Mesh,
"fragment" => ShaderKind::Fragment,
"compute" => ShaderKind::Compute,
"raygen" => ShaderKind::RayGeneration,
"anyhit" => ShaderKind::AnyHit,
Expand All @@ -434,9 +438,9 @@ impl Parse for MacroInput {
"callable" => ShaderKind::Callable,
ty => bail!(
lit,
"expected `vertex`, `fragment`, `geometry`, `tess_ctrl`, `tess_eval`, \
`compute`, `raygen`, `anyhit`, `closesthit`, `miss`, `intersection` or \
`callable`, found `{ty}`",
"expected `vertex`, `tess_ctrl`, `tess_eval`, `geometry`, `task`, \
`mesh`, `fragment` `compute`, `raygen`, `anyhit`, `closesthit`, \
`miss`, `intersection` or `callable`, found `{ty}`",
),
});
}
Expand Down
1,581 changes: 1,242 additions & 339 deletions vulkano/src/command_buffer/commands/pipeline.rs

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions vulkano/src/command_buffer/commands/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,22 @@ impl RawRecordingCommandBuffer {
}));
}
}
QueryType::MeshPrimitivesGenerated => {
if !queue_family_properties
.queue_flags
.intersects(QueueFlags::GRAPHICS)
{
return Err(Box::new(ValidationError {
problem: "`query_pool.query_type()` is \
`QueryType::MeshPrimitivesGenerated`, but \
the queue family of the command buffer does not support \
graphics operations"
.into(),
vuids: &["VUID-vkCmdBeginQuery-queryType-07070"],
..Default::default()
}));
}
}
QueryType::Timestamp
| QueryType::AccelerationStructureCompactedSize
| QueryType::AccelerationStructureSerializationSize
Expand Down
25 changes: 25 additions & 0 deletions vulkano/src/command_buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,31 @@ pub struct DrawIndirectCommand {
pub first_instance: u32,
}

/// Used as buffer contents to provide input for the
/// [`RecordingCommandBuffer::draw_mesh_tasks_indirect`] command.
///
/// # Safety
///
/// - If the graphics pipeline **does not** include a task shader, then the
/// `group_count_x`, `group_count_y` and `group_count_z` values must not be greater than the
/// respective elements of the
/// [`max_mesh_work_group_count`](Properties::max_mesh_work_group_count) device limit,
/// and the product of these three values must not be greater than the
/// [`max_mesh_work_group_total_count`](Properties::max_mesh_work_group_total_count) device limit.
/// - If the graphics pipeline **does** include a task shader, then the
/// `group_count_x`, `group_count_y` and `group_count_z` values must not be greater than the
/// respective elements of the
/// [`max_task_work_group_count`](Properties::max_task_work_group_count) device limit,
/// and the product of these three values must not be greater than the
/// [`max_task_work_group_total_count`](Properties::max_task_work_group_total_count) device limit.
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, Zeroable, Pod, PartialEq, Eq)]
pub struct DrawMeshTasksIndirectCommand {
pub group_count_x: u32,
pub group_count_y: u32,
pub group_count_z: u32,
}

/// Used as buffer contents to provide input for the
/// [`RecordingCommandBuffer::draw_indexed_indirect`] command.
///
Expand Down
Loading