Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoqsh committed Jan 20, 2024
1 parent 608d7c8 commit 8832ecf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion dunge/src/el.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ where
},
Event::Suspended => {
log::debug!("suspended");
// TODO: Drop the surface
active = false;
}
Event::Resumed => {
Expand Down
6 changes: 3 additions & 3 deletions dunge/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct SetLayer<'p, V, I> {
}

impl<'p, V, I> SetLayer<'p, V, I> {
#[inline]
pub fn bind<B>(&mut self, bind: &'p B) -> SetBinding<'_, 'p, V, I>
where
B: Binding,
Expand All @@ -38,6 +39,7 @@ impl<'p, V, I> SetLayer<'p, V, I> {
SetBinding::new(self.only_indexed_mesh, self.slots, &mut self.pass)
}

#[inline]
pub fn bind_empty(&mut self) -> SetBinding<'_, 'p, V, I> {
assert!(self.no_bindings, "ths shader has any bindings");
SetBinding::new(self.only_indexed_mesh, self.slots, &mut self.pass)
Expand All @@ -61,6 +63,7 @@ impl<'s, 'p, V, I> SetBinding<'s, 'p, V, I> {
}
}

#[inline]
pub fn instance(&'s mut self, instance: &'p I) -> SetInstance<'s, 'p, V>
where
I: Set,
Expand Down Expand Up @@ -194,9 +197,6 @@ impl From<Format> for Options {
pub struct Layer<V, I> {
shader_id: usize,
no_bindings: bool,

// Is indexed mesh used.
// This is necessary to draw a mesh with any strip mode.
only_indexed_mesh: bool,
slots: Slots,
format: Format,
Expand Down
8 changes: 4 additions & 4 deletions dunge_macros/src/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ pub(crate) fn derive(input: DeriveInput) -> TokenStream {

let projection = if named {
quote::quote! {
struct #projection_name<#(#lts),*> {
pub struct #projection_name<#(#lts),*> {
#(#group_fields),*,
}
}
} else {
quote::quote! {
struct #projection_name<#(#lts),*>(
pub struct #projection_name<#(#lts),*>(
#(#group_fields),*,
);
}
Expand Down Expand Up @@ -166,7 +166,7 @@ mod tests {
}
}

struct MapProjection<'a> {
pub struct MapProjection<'a> {
tex: <BoundTexture<'a> as ::dunge::group::MemberProjection>::Field,
sam: <&'a Sampler as ::dunge::group::MemberProjection>::Field,
}
Expand Down Expand Up @@ -208,7 +208,7 @@ mod tests {
}
}

struct MapProjection<'a>(
pub struct MapProjection<'a>(
<BoundTexture<'a> as ::dunge::group::MemberProjection>::Field,
<&'a Sampler as ::dunge::group::MemberProjection>::Field,
);
Expand Down
8 changes: 4 additions & 4 deletions dunge_macros/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ pub(crate) fn derive(input: DeriveInput) -> TokenStream {

let projection = if named {
quote::quote! {
struct #projection_name {
pub struct #projection_name {
#(#instance_fields),*,
}
}
} else {
quote::quote! {
struct #projection_name(
pub struct #projection_name(
#(#instance_fields),*,
);
}
Expand Down Expand Up @@ -134,7 +134,7 @@ mod tests {
}
}

struct TransformProjection {
pub struct TransformProjection {
pos: <Row<[f32; 2]> as ::dunge::instance::MemberProjection>::Field,
col: <Row<[f32; 3]> as ::dunge::instance::MemberProjection>::Field,
}
Expand Down Expand Up @@ -176,7 +176,7 @@ mod tests {
}
}

struct TransformProjection(
pub struct TransformProjection(
<Row<[f32; 2]> as ::dunge::instance::MemberProjection>::Field,
<Row<[f32; 3]> as ::dunge::instance::MemberProjection>::Field,
);
Expand Down
8 changes: 4 additions & 4 deletions dunge_macros/src/vertex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ pub(crate) fn derive(input: DeriveInput) -> TokenStream {

let projection = if named {
quote::quote! {
struct #projection_name {
pub struct #projection_name {
#(#projection_fields),*,
}
}
} else {
quote::quote! {
struct #projection_name(
pub struct #projection_name(
#(#projection_fields),*,
);
}
Expand Down Expand Up @@ -137,7 +137,7 @@ mod tests {
]);
}

struct VertProjection {
pub struct VertProjection {
pos: <[f32; 2] as ::dunge::vertex::InputProjection>::Field,
col: <[f32; 3] as ::dunge::vertex::InputProjection>::Field,
}
Expand Down Expand Up @@ -173,7 +173,7 @@ mod tests {
]);
}

struct VertProjection(
pub struct VertProjection(
<[f32; 2] as ::dunge::vertex::InputProjection>::Field,
<[f32; 3] as ::dunge::vertex::InputProjection>::Field,
);
Expand Down

0 comments on commit 8832ecf

Please sign in to comment.