From e68da7b984d7af81a9065a059a377c0471ab1072 Mon Sep 17 00:00:00 2001 From: chyyran Date: Thu, 12 Sep 2024 00:30:00 -0400 Subject: [PATCH] rt(gl): draw final pass to output targets --- .../src/filter_chain/filter_impl.rs | 15 ++++++++++++++- librashader-runtime-gl/src/util.rs | 7 +------ librashader-runtime-gl/tests/triangle.rs | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/librashader-runtime-gl/src/filter_chain/filter_impl.rs b/librashader-runtime-gl/src/filter_chain/filter_impl.rs index aea776f..668c01e 100644 --- a/librashader-runtime-gl/src/filter_chain/filter_impl.rs +++ b/librashader-runtime-gl/src/filter_chain/filter_impl.rs @@ -361,12 +361,25 @@ impl FilterChainImpl { // try to hint the optimizer assert_eq!(last.len(), 1); if let Some(pass) = last.iter_mut().next() { + let index = passes_len - 1; source.filter = pass.config.filter; source.mip_filter = pass.config.filter; source.wrap_mode = pass.config.wrap_mode; + let target = &self.output_framebuffers[index]; pass.draw( - passes_len - 1, + index, + &self.common, + pass.config.get_frame_count(frame_count), + options, + viewport, + &original, + &source, + RenderTarget::viewport_with_output(target, viewport), + ); + + pass.draw( + index, &self.common, pass.config.get_frame_count(frame_count), options, diff --git a/librashader-runtime-gl/src/util.rs b/librashader-runtime-gl/src/util.rs index 4fcaad3..bfd3fe4 100644 --- a/librashader-runtime-gl/src/util.rs +++ b/librashader-runtime-gl/src/util.rs @@ -8,12 +8,7 @@ pub unsafe fn gl_compile_shader(stage: GLenum, source: &str) -> error::Result