mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
ComputePassDescriptor and it's subtypes in remote-types
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
11602226f1
commit
45ace31cb9
3 files changed
+14
-8
No files matched your search
@@ -92,15 +92,23 @@ pub struct RenderPassDescriptor<'a> {
|
||||
pub timestamp_writes: Option<PassTimestampWrites>,
|
||||
}
|
||||
|
||||
/// Corresponds to [`GPUComputePassDescriptor`](https://gpuweb.github.io/gpuweb/#dictdef-gpucomputepassdescriptor)
|
||||
#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ComputePassDescriptor<'a> {
|
||||
pub label: Label<'a>,
|
||||
/// Defines where and when timestamp values will be written for this pass.
|
||||
pub timestamp_writes: Option<PassTimestampWrites>,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
/// Corresponds to [`GPUCommandEncoder`](https://www.w3.org/TR/webgpu/#gpucommandencoder).
|
||||
pub enum CommandEncoderCommand<'a, CPD> {
|
||||
pub enum CommandEncoderCommand<'a> {
|
||||
BeginRenderPass {
|
||||
desc: RenderPassDescriptor<'a>,
|
||||
render_pass_encoder_id: id::RenderPassEncoderId,
|
||||
},
|
||||
BeginComputePass {
|
||||
desc: CPD, // optional, defaults to {}
|
||||
desc: ComputePassDescriptor<'a>, // optional, defaults to {}
|
||||
compute_pass_encoder_id: id::ComputePassEncoderId,
|
||||
},
|
||||
CopyBufferToBuffer {
|
||||
|
||||
@@ -2,7 +2,6 @@ use wgpu_core::Label;
|
||||
use wgpu_core_remote_types::encoders::{CommandEncoderCommand, DebugCommand};
|
||||
use wgt::{BufferAddress, Extent3d, ImageSubresourceRange};
|
||||
|
||||
use crate::global::compute_pass::ComputePassDescriptor;
|
||||
use crate::global::Global;
|
||||
use crate::hub::Hub;
|
||||
use crate::id::{BufferId, CommandEncoderId, TextureId};
|
||||
@@ -213,7 +212,7 @@ impl Global {
|
||||
pub fn handle_command_encoder_command<'a>(
|
||||
&self,
|
||||
command_encoder_id: CommandEncoderId,
|
||||
command: CommandEncoderCommand<'a, ComputePassDescriptor<'a>>,
|
||||
command: CommandEncoderCommand<'a>,
|
||||
) {
|
||||
match command {
|
||||
CommandEncoderCommand::BeginRenderPass {
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
use alloc::borrow::Cow;
|
||||
|
||||
use wgpu_core::command::PassTimestampWrites;
|
||||
use wgpu_core_remote_types::encoders::{BindingCommand, ComputePassEncoderCommand, DebugCommand};
|
||||
use wgpu_core_remote_types::encoders::{
|
||||
BindingCommand, ComputePassDescriptor, ComputePassEncoderCommand, DebugCommand,
|
||||
};
|
||||
use wgt::{BufferAddress, DynamicOffset};
|
||||
|
||||
use crate::global::Global;
|
||||
use crate::hub::Hub;
|
||||
use crate::id;
|
||||
|
||||
pub type ComputePassDescriptor<'a> =
|
||||
wgpu_core::command::ComputePassDescriptor<'a, PassTimestampWrites<id::QuerySetId>>;
|
||||
|
||||
impl Global {
|
||||
/// Creates a compute pass.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user