[remote] RenderBundleEncoderDescriptor

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev authored and Teodor Tanasoaia committed 2026-08-26 12:31:17 +02:00
1 parent 85e96360b7
commit e37062f664
2 files changed
+39 -3

No files matched your search

+27
View File
@@ -8,6 +8,33 @@ pub type TexelCopyTextureInfo = wgt::TexelCopyTextureInfo<id::TextureId>;
pub type RenderBundleDescriptor<'a> = wgt::RenderBundleDescriptor<Label<'a>>;
pub type CommandBufferDescriptor<'a> = wgt::CommandBufferDescriptor<Label<'a>>;
/// Describes a `RenderBundleEncoder`.
///
/// Corresponds to [WebGPU `GPURenderBundleEncoderDescriptor`](https://gpuweb.github.io/gpuweb/#dictdef-gpurenderbundleencoderdescriptor).
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub struct RenderBundleEncoderDescriptor<'a> {
/// Debug label of the render bundle encoder.
///
/// This will show up in graphics debuggers for easy identification.
pub label: Label<'a>,
/// The formats of the color attachments that this render bundle is capable
/// to rendering to.
///
/// This must match the formats of the color attachments in the
/// renderpass this render bundle is executed in.
pub color_formats: Cow<'a, [Option<wgt::TextureFormat>]>,
/// Information about the depth attachment that this render bundle is
/// capable to rendering to.
///
/// The format must match the format of the depth attachments in the
/// renderpass this render bundle is executed in.
pub depth_stencil: Option<wgt::RenderBundleDepthStencil>,
/// Sample count this render bundle is capable of rendering to.
///
/// This must match the pipelines and the renderpasses it is used in.
pub sample_count: u32,
}
/// Operation to perform to the output attachment at the start of a render pass.
///
/// Corresponds to [WebGPU `GPULoadOp`](https://gpuweb.github.io/gpuweb/#enumdef-gpuloadop),
+12 -3
View File
@@ -2,7 +2,7 @@ use alloc::{borrow::Cow, boxed::Box, sync::Arc, vec::Vec};
use core::ops::Deref;
use core::ptr::NonNull;
use wgpu_core_remote_types::{
encoders::RenderBundleDescriptor,
encoders::{RenderBundleDescriptor, RenderBundleEncoderDescriptor},
pipelines::{ComputePipelineDescriptor, RenderPipelineDescriptor},
BufferDescriptor, ExternalTextureDescriptor, PipelineLayoutDescriptor, SamplerDescriptor,
ShaderModuleDescriptor, TextureDescriptor, TextureViewDescriptor,
@@ -678,7 +678,7 @@ impl Global {
pub fn device_create_render_bundle_encoder(
&self,
device_id: DeviceId,
desc: &command::RenderBundleEncoderDescriptor,
desc: &RenderBundleEncoderDescriptor,
id_in: id::RenderBundleEncoderId,
) -> Result<(), MissingFeatures> {
let mut hub = self.hub.borrow_mut();
@@ -689,7 +689,16 @@ impl Global {
} = &mut *hub;
let device = devices.get(device_id);
let render_bundle_encoder = device.create_render_bundle_encoder(desc)?;
let desc = command::RenderBundleEncoderDescriptor {
label: desc.label.as_ref().map(|l| Cow::Borrowed(l.as_ref())),
color_formats: Cow::Borrowed(&desc.color_formats),
depth_stencil: desc.depth_stencil,
sample_count: desc.sample_count,
multiview: None,
};
let render_bundle_encoder = device.create_render_bundle_encoder(&desc)?;
render_bundle_encoders.assign(id_in, *render_bundle_encoder);