rt(gl): make FilterChain::load_from argument order consistent with other runtimes

This commit is contained in:
chyyran 2024-09-24 00:49:10 -04:00
parent feaebc5f44
commit 97ad0d64bf
3 changed files with 7 additions and 7 deletions

View file

@ -131,8 +131,8 @@ extern_fn! {
let context = glow::Context::from_loader_function_cstr(
|proc_name| loader(proc_name.as_ptr()));
let chain = FilterChain::load_from_preset(Arc::new(context),
*preset, options.as_ref())?;
let chain = FilterChain::load_from_preset(*preset,
Arc::new(context), options.as_ref())?;
out.write(MaybeUninit::new(NonNull::new(Box::into_raw(Box::new(
chain,

View file

@ -24,8 +24,8 @@ pub struct FilterChainGL {
impl FilterChainGL {
/// Load a filter chain from a pre-parsed `ShaderPreset`.
pub unsafe fn load_from_preset(
ctx: Arc<glow::Context>,
preset: ShaderPreset,
ctx: Arc<glow::Context>,
options: Option<&FilterChainOptionsGL>,
) -> Result<Self> {
let result = catch_unwind(|| {
@ -47,13 +47,13 @@ impl FilterChainGL {
/// Load the shader preset at the given path into a filter chain.
pub unsafe fn load_from_path(
ctx: Arc<glow::Context>,
path: impl AsRef<Path>,
ctx: Arc<glow::Context>,
options: Option<&FilterChainOptionsGL>,
) -> Result<Self> {
// load passes from preset
let preset = ShaderPreset::try_parse_with_driver_context(path, VideoDriver::GlCore)?;
unsafe { Self::load_from_preset(ctx, preset, options) }
unsafe { Self::load_from_preset(preset, ctx, options) }
}
/// Process a frame with the input image.

View file

@ -10,9 +10,9 @@ fn triangle_gl() {
unsafe {
let mut filter = FilterChainGL::load_from_path(
Arc::clone(&context),
// "../test/basic.slangp",
"../test/shaders_slang/test/feedback.slangp",
Arc::clone(&context),
Some(&FilterChainOptionsGL {
glsl_version: 0,
use_dsa: false,
@ -31,12 +31,12 @@ fn triangle_gl46() {
let (glfw, window, events, shader, vao, context) = hello_triangle::gl46::setup();
unsafe {
let mut filter = FilterChainGL::load_from_path(
Arc::clone(&context),
// "../test/slang-shaders/vhs/VHSPro.slangp",
// "../test/slang-shaders/test/history.slangp",
// "../test/basic.slangp",
// "../test/shaders_slang/crt/crt-royale.slangp",
"../test/shaders_slang/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
Arc::clone(&context),
Some(&FilterChainOptionsGL {
glsl_version: 330,
use_dsa: true,