gl: kind of fix mipmap handlingneeds to check next frame
This commit is contained in:
parent
8047bf80c8
commit
23458917f3
|
@ -98,6 +98,7 @@ impl OwnedFramebuffer {
|
|||
| D3D11_FORMAT_SUPPORT_RENDER_TARGET.0,
|
||||
);
|
||||
|
||||
// todo: fix mipmap handling
|
||||
let desc = default_desc(size, format, 1);
|
||||
unsafe {
|
||||
let mut texture = self.device.CreateTexture2D(&desc, None)?;
|
||||
|
|
|
@ -489,12 +489,14 @@ impl<T: GLInterface> FilterChainImpl<T> {
|
|||
|
||||
// rescale render buffers to ensure all bindings are valid.
|
||||
for (index, pass) in passes.iter_mut().enumerate() {
|
||||
// todo: properly check **next** pass for mipmap.
|
||||
self.output_framebuffers[index].scale::<T::FramebufferInterface>(
|
||||
pass.config.scaling.clone(),
|
||||
pass.get_format(),
|
||||
viewport,
|
||||
&original,
|
||||
&source,
|
||||
pass.config.mipmap_input
|
||||
)?;
|
||||
|
||||
self.feedback_framebuffers[index].scale::<T::FramebufferInterface>(
|
||||
|
@ -503,6 +505,7 @@ impl<T: GLInterface> FilterChainImpl<T> {
|
|||
viewport,
|
||||
&original,
|
||||
&source,
|
||||
pass.config.mipmap_input
|
||||
)?;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,9 @@ impl Framebuffer {
|
|||
viewport: &Viewport,
|
||||
original: &Texture,
|
||||
source: &Texture,
|
||||
mipmap: bool
|
||||
) -> Result<Size<u32>> {
|
||||
T::scale(self, scaling, format, viewport, original, source)
|
||||
T::scale(self, scaling, format, viewport, original, source, mipmap)
|
||||
}
|
||||
|
||||
pub fn copy_from<T: FramebufferInterface>(&mut self, image: &GLImage) -> Result<()> {
|
||||
|
|
|
@ -59,6 +59,7 @@ impl FramebufferInterface for Gl3Framebuffer {
|
|||
viewport: &Viewport,
|
||||
_original: &Texture,
|
||||
source: &Texture,
|
||||
mipmap: bool,
|
||||
) -> Result<Size<u32>> {
|
||||
if fb.is_raw {
|
||||
return Ok(fb.size);
|
||||
|
|
|
@ -57,6 +57,7 @@ impl FramebufferInterface for Gl46Framebuffer {
|
|||
viewport: &Viewport,
|
||||
_original: &Texture,
|
||||
source: &Texture,
|
||||
mipmap: bool,
|
||||
) -> Result<Size<u32>> {
|
||||
if fb.is_raw {
|
||||
return Ok(fb.size);
|
||||
|
@ -67,9 +68,15 @@ impl FramebufferInterface for Gl46Framebuffer {
|
|||
.size
|
||||
.scale_viewport(scaling, viewport.output.size);
|
||||
|
||||
if fb.size != size {
|
||||
if fb.size != size || (mipmap && fb.max_levels == 1) || (!mipmap && fb.max_levels != 1) {
|
||||
fb.size = size;
|
||||
|
||||
if mipmap {
|
||||
fb.max_levels = u32::MAX;
|
||||
} else {
|
||||
fb.max_levels = 1
|
||||
}
|
||||
|
||||
Self::init(
|
||||
fb,
|
||||
size,
|
||||
|
|
|
@ -52,6 +52,7 @@ pub trait FramebufferInterface {
|
|||
viewport: &Viewport,
|
||||
_original: &Texture,
|
||||
source: &Texture,
|
||||
mipmap: bool,
|
||||
) -> Result<Size<u32>>;
|
||||
fn clear<const REBIND: bool>(fb: &Framebuffer);
|
||||
fn copy_from(fb: &mut Framebuffer, image: &GLImage) -> Result<()>;
|
||||
|
|
Loading…
Reference in a new issue