rt: doc FilterPassMeta
This commit is contained in:
parent
d6e1f2ca16
commit
d9a97de131
|
@ -82,7 +82,7 @@ impl BindSemantics for FilterPass {
|
|||
}
|
||||
|
||||
impl FilterPassMeta for FilterPass {
|
||||
fn source_format(&self) -> ImageFormat {
|
||||
fn framebuffer_format(&self) -> ImageFormat {
|
||||
self.source.format
|
||||
}
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ mod tests {
|
|||
// "../test/slang-shaders/presets/crt-geom-ntsc-upscale-sharp.slangp",
|
||||
// const FILTER_PATH: &str = "../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp";
|
||||
// "../test/null.slangp",
|
||||
// const FILTER_PATH: &str = "../test/slang-shaders/scalefx/scalefx-9x.slangp";
|
||||
const FILTER_PATH: &str = "../test/slang-shaders/scalefx/scalefx-9x.slangp";
|
||||
|
||||
const FILTER_PATH: &str = "../test/slang-shaders/crt/crt-royale.slangp";
|
||||
// const FILTER_PATH: &str = "../test/slang-shaders/crt/crt-royale.slangp";
|
||||
const IMAGE_PATH: &str = "../test/finalfightlong.png";
|
||||
// #[test]
|
||||
// fn triangle_d3d11_args() {
|
||||
|
|
|
@ -76,7 +76,7 @@ impl BindSemantics<NoUniformBinder, Option<()>, RawD3D12Buffer, RawD3D12Buffer>
|
|||
}
|
||||
|
||||
impl FilterPassMeta for FilterPass {
|
||||
fn source_format(&self) -> ImageFormat {
|
||||
fn framebuffer_format(&self) -> ImageFormat {
|
||||
self.source.format
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ impl<T: GLInterface> FilterPass<T> {
|
|||
}
|
||||
|
||||
impl<T: GLInterface> FilterPassMeta for FilterPass<T> {
|
||||
fn source_format(&self) -> ImageFormat {
|
||||
fn framebuffer_format(&self) -> ImageFormat {
|
||||
self.source.format
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ impl BindSemantics<NoUniformBinder, Option<()>, RawVulkanBuffer> for FilterPass
|
|||
}
|
||||
|
||||
impl FilterPassMeta for FilterPass {
|
||||
fn source_format(&self) -> ImageFormat {
|
||||
fn framebuffer_format(&self) -> ImageFormat {
|
||||
self.source.format
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
use librashader_common::ImageFormat;
|
||||
use librashader_presets::ShaderPassConfig;
|
||||
|
||||
/// Trait for metadata about a filter pass.
|
||||
pub trait FilterPassMeta {
|
||||
fn source_format(&self) -> ImageFormat;
|
||||
/// Gets the format of the framebuffer for the pass.
|
||||
fn framebuffer_format(&self) -> ImageFormat;
|
||||
|
||||
/// Gets a reference to the filter pass config.
|
||||
fn config(&self) -> &ShaderPassConfig;
|
||||
|
||||
/// Gets the format of the filter pass framebuffer.
|
||||
#[inline(always)]
|
||||
fn get_format(&self) -> ImageFormat {
|
||||
let fb_format = self.source_format();
|
||||
let fb_format = self.framebuffer_format();
|
||||
if let Some(format) = self.config().get_format_override() {
|
||||
format
|
||||
} else if fb_format == ImageFormat::Unknown {
|
||||
|
|
Loading…
Reference in a new issue