mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
Add labels to pipelines
This commit is contained in:
1 parent
6e3e88dd10
commit
d8341c5996
5 files changed
+22
-13
No files matched your search
Generated
+1
-1
@@ -1594,7 +1594,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-subscriber"
|
||||
version = "0.5.0"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parking_lot",
|
||||
"thread-id",
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ features = ["replay", "raw-window-handle"]
|
||||
|
||||
[dependencies.wgpu-subscriber]
|
||||
path = "../wgpu-subscriber"
|
||||
version = "0.5"
|
||||
version = "0.1"
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies]
|
||||
gfx-backend-vulkan = { version = "0.5", features = ["x11"] }
|
||||
|
||||
@@ -2878,7 +2878,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
parent,
|
||||
};
|
||||
// TODO: cache
|
||||
let pipeline = unsafe {
|
||||
let raw = unsafe {
|
||||
device
|
||||
.raw
|
||||
.create_graphics_pipeline(&pipeline_desc, None)
|
||||
@@ -2887,9 +2887,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
_ => panic!("failed to create graphics pipeline: {}", err),
|
||||
})?
|
||||
};
|
||||
if let Some(_) = desc.label {
|
||||
//TODO-0.6: device.set_graphics_pipeline_name(&mut raw, label)
|
||||
}
|
||||
|
||||
(
|
||||
pipeline,
|
||||
raw,
|
||||
pipeline_layout_id,
|
||||
layout.life_guard.add_ref(),
|
||||
derived_bind_group_count,
|
||||
@@ -3130,20 +3133,24 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
parent,
|
||||
};
|
||||
|
||||
match unsafe { device.raw.create_compute_pipeline(&pipeline_desc, None) } {
|
||||
Ok(pipeline) => (
|
||||
pipeline,
|
||||
pipeline_layout_id,
|
||||
layout.life_guard.add_ref(),
|
||||
derived_bind_group_count,
|
||||
),
|
||||
let raw = match unsafe { device.raw.create_compute_pipeline(&pipeline_desc, None) } {
|
||||
Ok(pipeline) => pipeline,
|
||||
Err(hal::pso::CreationError::OutOfMemory(_)) => {
|
||||
return Err(pipeline::CreateComputePipelineError::Device(
|
||||
DeviceError::OutOfMemory,
|
||||
))
|
||||
}
|
||||
other => panic!("Compute pipeline creation error: {:?}", other),
|
||||
};
|
||||
if let Some(_) = desc.label {
|
||||
//TODO-0.6: device.raw.set_compute_pipeline_name(&mut raw, label);
|
||||
}
|
||||
(
|
||||
raw,
|
||||
pipeline_layout_id,
|
||||
layout.life_guard.add_ref(),
|
||||
derived_bind_group_count,
|
||||
)
|
||||
};
|
||||
|
||||
let pipeline = pipeline::ComputePipeline {
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
device::{DeviceError, RenderPassContext},
|
||||
id::{DeviceId, PipelineLayoutId, ShaderModuleId},
|
||||
validation::StageError,
|
||||
LifeGuard, RefCount, Stored,
|
||||
Label, LifeGuard, RefCount, Stored,
|
||||
};
|
||||
use std::borrow::{Borrow, Cow};
|
||||
use thiserror::Error;
|
||||
@@ -68,6 +68,7 @@ pub enum ImplicitLayoutError {
|
||||
#[cfg_attr(feature = "trace", derive(serde::Serialize))]
|
||||
#[cfg_attr(feature = "replay", derive(serde::Deserialize))]
|
||||
pub struct ComputePipelineDescriptor<'a> {
|
||||
pub label: Label<'a>,
|
||||
/// The layout of bind groups for this pipeline.
|
||||
pub layout: Option<PipelineLayoutId>,
|
||||
/// The compiled compute stage and its entry point.
|
||||
@@ -129,6 +130,7 @@ pub struct VertexStateDescriptor<'a> {
|
||||
#[cfg_attr(feature = "trace", derive(serde::Serialize))]
|
||||
#[cfg_attr(feature = "replay", derive(serde::Deserialize))]
|
||||
pub struct RenderPipelineDescriptor<'a> {
|
||||
pub label: Label<'a>,
|
||||
/// The layout of bind groups for this pipeline.
|
||||
pub layout: Option<PipelineLayoutId>,
|
||||
/// The compiled vertex stage and its entry point.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wgpu-subscriber"
|
||||
version = "0.5.0"
|
||||
version = "0.1.0"
|
||||
authors = ["wgpu developers"]
|
||||
edition = "2018"
|
||||
description = "WebGPU tracing subscriber"
|
||||
|
||||
Reference in new issue
Block a user