use super::*;
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct GPURenderPassDescriptor {
inner: Any,
}
impl FromVal for GPURenderPassDescriptor {
fn from_val(v: &Any) -> Self {
GPURenderPassDescriptor { inner: v.clone() }
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for GPURenderPassDescriptor {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for GPURenderPassDescriptor {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for GPURenderPassDescriptor {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for GPURenderPassDescriptor {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<GPURenderPassDescriptor> for Any {
fn from(s: GPURenderPassDescriptor) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&GPURenderPassDescriptor> for Any {
fn from(s: &GPURenderPassDescriptor) -> Any {
s.inner.clone()
}
}
impl GPURenderPassDescriptor {
pub fn color_attachments(&self) -> TypedArray<GPURenderPassColorAttachment> {
self.inner
.get("colorAttachments")
.as_::<TypedArray<GPURenderPassColorAttachment>>()
}
pub fn set_color_attachments(&mut self, value: &TypedArray<GPURenderPassColorAttachment>) {
self.inner.set("colorAttachments", value);
}
}
impl GPURenderPassDescriptor {
pub fn depth_stencil_attachment(&self) -> GPURenderPassDepthStencilAttachment {
self.inner
.get("depthStencilAttachment")
.as_::<GPURenderPassDepthStencilAttachment>()
}
pub fn set_depth_stencil_attachment(&mut self, value: &GPURenderPassDepthStencilAttachment) {
self.inner.set("depthStencilAttachment", value);
}
}
impl GPURenderPassDescriptor {
pub fn occlusion_query_set(&self) -> GPUQuerySet {
self.inner.get("occlusionQuerySet").as_::<GPUQuerySet>()
}
pub fn set_occlusion_query_set(&mut self, value: &GPUQuerySet) {
self.inner.set("occlusionQuerySet", value);
}
}
impl GPURenderPassDescriptor {
pub fn timestamp_writes(&self) -> GPURenderPassTimestampWrites {
self.inner
.get("timestampWrites")
.as_::<GPURenderPassTimestampWrites>()
}
pub fn set_timestamp_writes(&mut self, value: &GPURenderPassTimestampWrites) {
self.inner.set("timestampWrites", value);
}
}
impl GPURenderPassDescriptor {
pub fn max_draw_count(&self) -> Any {
self.inner.get("maxDrawCount").as_::<Any>()
}
pub fn set_max_draw_count(&mut self, value: &Any) {
self.inner.set("maxDrawCount", value);
}
}