mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Merge #504
504: Update wgpu with pipeline labels r=trivial a=kvark Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
@@ -26,14 +26,14 @@ vulkan-portability = ["wgc/gfx-backend-vulkan"]
|
||||
package = "wgpu-core"
|
||||
version = "0.5"
|
||||
git = "https://github.com/gfx-rs/wgpu"
|
||||
rev = "6e3e88dd1058fdd0c9906ba672bbbba811422c56"
|
||||
rev = "92aaa2bba6f2125a93525aabb404ec2952421696"
|
||||
features = ["raw-window-handle"]
|
||||
|
||||
[dependencies.wgt]
|
||||
package = "wgpu-types"
|
||||
version = "0.5"
|
||||
git = "https://github.com/gfx-rs/wgpu"
|
||||
rev = "6e3e88dd1058fdd0c9906ba672bbbba811422c56"
|
||||
rev = "92aaa2bba6f2125a93525aabb404ec2952421696"
|
||||
|
||||
[dependencies]
|
||||
arrayvec = "0.5"
|
||||
@@ -62,9 +62,9 @@ ddsfile = "0.4.0"
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.subscriber]
|
||||
package = "wgpu-subscriber"
|
||||
version = "0.5" #TODO: change to 0.1
|
||||
version = "0.1"
|
||||
git = "https://github.com/gfx-rs/wgpu"
|
||||
rev = "6e3e88dd1058fdd0c9906ba672bbbba811422c56"
|
||||
rev = "92aaa2bba6f2125a93525aabb404ec2952421696"
|
||||
|
||||
[[example]]
|
||||
name="hello-compute"
|
||||
@@ -74,7 +74,7 @@ test = true
|
||||
[patch."https://github.com/gfx-rs/wgpu"]
|
||||
#wgpu-types = { version = "0.5", path = "../wgpu/wgpu-types" }
|
||||
#wgpu-core = { version = "0.5", path = "../wgpu/wgpu-core" }
|
||||
#wgpu-subscriber = { version = "0.5", path = "../wgpu/wgpu-subscriber" }
|
||||
#wgpu-subscriber = { version = "0.1", path = "../wgpu/wgpu-subscriber" }
|
||||
|
||||
[patch."https://github.com/gfx-rs/naga"]
|
||||
#naga = { path = "../naga" }
|
||||
|
||||
@@ -110,6 +110,7 @@ impl framework::Example for Example {
|
||||
});
|
||||
|
||||
let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&render_pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
@@ -150,6 +151,7 @@ impl framework::Example for Example {
|
||||
// create compute pipeline
|
||||
|
||||
let compute_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&compute_pipeline_layout),
|
||||
compute_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &boids_module,
|
||||
|
||||
@@ -249,6 +249,7 @@ impl framework::Example for Example {
|
||||
let fs_module = device.create_shader_module(wgpu::include_spirv!("shader.frag.spv"));
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
|
||||
@@ -91,6 +91,7 @@ async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
|
||||
});
|
||||
|
||||
let compute_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&pipeline_layout),
|
||||
compute_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &cs_module,
|
||||
|
||||
@@ -41,6 +41,7 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu::
|
||||
});
|
||||
|
||||
let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
|
||||
@@ -113,6 +113,7 @@ impl Example {
|
||||
let fs_module = device.create_shader_module(wgpu::include_spirv!("blit.frag.spv"));
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: Some("blit"),
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
@@ -345,6 +346,7 @@ impl framework::Example for Example {
|
||||
let fs_module = device.create_shader_module(wgpu::include_spirv!("draw.frag.spv"));
|
||||
|
||||
let draw_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: Some("draw"),
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
|
||||
@@ -51,6 +51,7 @@ impl Example {
|
||||
) -> wgpu::RenderBundle {
|
||||
log::info!("sample_count: {}", sample_count);
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: vs_module,
|
||||
|
||||
@@ -484,6 +484,7 @@ impl framework::Example for Example {
|
||||
let fs_module = device.create_shader_module(wgpu::include_spirv!("bake.frag.spv"));
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: Some("shadow"),
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
@@ -617,6 +618,7 @@ impl framework::Example for Example {
|
||||
let fs_module = device.create_shader_module(wgpu::include_spirv!("forward.frag.spv"));
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: Some("main"),
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
|
||||
@@ -99,6 +99,7 @@ impl framework::Example for Skybox {
|
||||
|
||||
// Create the render pipeline
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
|
||||
@@ -257,6 +257,7 @@ impl framework::Example for Example {
|
||||
});
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: None,
|
||||
layout: Some(&pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &vs_module,
|
||||
|
||||
@@ -497,6 +497,7 @@ impl framework::Example for Example {
|
||||
// Create the render pipelines. These describe how the data will flow through the GPU, and what
|
||||
// constraints and modifiers it will have.
|
||||
let water_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: Some("water"),
|
||||
// The "layout" is what uniforms will be needed.
|
||||
layout: Some(&water_pipeline_layout),
|
||||
// Vertex & Fragment shaders
|
||||
@@ -570,6 +571,7 @@ impl framework::Example for Example {
|
||||
|
||||
// Same idea as the water pipeline.
|
||||
let terrain_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
label: Some("terrain"),
|
||||
layout: Some(&terrain_pipeline_layout),
|
||||
vertex_stage: wgpu::ProgrammableStageDescriptor {
|
||||
module: &terrain_vs_module,
|
||||
|
||||
@@ -739,6 +739,7 @@ impl crate::Context for Context {
|
||||
wgc::gfx_select!(*device => global.device_create_render_pipeline(
|
||||
*device,
|
||||
&pipe::RenderPipelineDescriptor {
|
||||
label: desc.label.map(Borrowed),
|
||||
layout: desc.layout.map(|l| l.id),
|
||||
vertex_stage,
|
||||
fragment_stage,
|
||||
@@ -769,6 +770,7 @@ impl crate::Context for Context {
|
||||
wgc::gfx_select!(*device => global.device_create_compute_pipeline(
|
||||
*device,
|
||||
&pipe::ComputePipelineDescriptor {
|
||||
label: desc.label.map(Borrowed),
|
||||
layout: desc.layout.map(|l| l.id),
|
||||
compute_stage: pipe::ProgrammableStageDescriptor {
|
||||
module: desc.compute_stage.module.id,
|
||||
|
||||
@@ -1107,6 +1107,8 @@ pub struct RenderPassDescriptor<'a, 'b> {
|
||||
/// Describes a render (graphics) pipeline.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RenderPipelineDescriptor<'a> {
|
||||
/// Debug label of the pipeline. This will show up in graphics debuggers for easy identification.
|
||||
pub label: Option<&'a str>,
|
||||
/// The layout of bind groups for this pipeline.
|
||||
pub layout: Option<&'a PipelineLayout>,
|
||||
/// The compiled vertex stage and its entry point.
|
||||
@@ -1141,6 +1143,8 @@ pub struct RenderPipelineDescriptor<'a> {
|
||||
/// Describes a compute pipeline.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ComputePipelineDescriptor<'a> {
|
||||
/// Debug label of the pipeline. This will show up in graphics debuggers for easy identification.
|
||||
pub label: Option<&'a str>,
|
||||
/// The layout of bind groups for this pipeline.
|
||||
pub layout: Option<&'a PipelineLayout>,
|
||||
/// The compiled compute stage and its entry point.
|
||||
|
||||
Reference in New Issue
Block a user