-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 背景に対応した気がする * とりあえずの実装。透過の効いた書き込みができていない * 色々わからなくなってきたからいったんここでコミット * fix document * fix clippy * rename pipeline name * swap method position * fix example * 背景画像の変更。細かい挙動に謎はあるが一旦これで完成。
- Loading branch information
Showing
15 changed files
with
570 additions
and
62 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use crate::screen_texture::BackgroundImageTexture; | ||
|
||
/// BackgroundImage用の BindGroup。 | ||
pub struct BackgroundImageBindGroup { | ||
pub(crate) layout: wgpu::BindGroupLayout, | ||
} | ||
|
||
impl BackgroundImageBindGroup { | ||
pub(crate) fn new(device: &wgpu::Device) -> Self { | ||
let layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { | ||
entries: &[ | ||
wgpu::BindGroupLayoutEntry { | ||
binding: 0, | ||
visibility: wgpu::ShaderStages::FRAGMENT, | ||
ty: wgpu::BindingType::Texture { | ||
multisampled: false, | ||
view_dimension: wgpu::TextureViewDimension::D2, | ||
sample_type: wgpu::TextureSampleType::Float { filterable: true }, | ||
}, | ||
count: None, | ||
}, | ||
wgpu::BindGroupLayoutEntry { | ||
binding: 1, | ||
visibility: wgpu::ShaderStages::FRAGMENT, | ||
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), | ||
count: None, | ||
}, | ||
], | ||
label: Some("Background Image Bind Group Layout"), | ||
}); | ||
Self { layout } | ||
} | ||
|
||
pub fn to_bind_group( | ||
&self, | ||
device: &wgpu::Device, | ||
background_image_texture: &BackgroundImageTexture, | ||
) -> wgpu::BindGroup { | ||
device.create_bind_group(&wgpu::BindGroupDescriptor { | ||
layout: &self.layout, | ||
entries: &[ | ||
wgpu::BindGroupEntry { | ||
binding: 0, | ||
resource: wgpu::BindingResource::TextureView(&background_image_texture.view), | ||
}, | ||
wgpu::BindGroupEntry { | ||
binding: 1, | ||
resource: wgpu::BindingResource::Sampler(&background_image_texture.sampler), | ||
}, | ||
], | ||
label: Some("Background Image Bind Group"), | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod background_bind_group; | ||
pub mod char_width_calcurator; | ||
pub mod color_theme; | ||
pub mod context; | ||
|
Oops, something went wrong.