mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
glgsg: Fix get_screenshot() for multisample FBOs
An FM_refresh bind should not bind the multisample FBO, but the resolved one (and while we're at it, FM_refresh should not try to resolve multisamples).
This commit is contained in:
parent
1851cc35bc
commit
5cadd86d1e
@ -283,6 +283,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
|
|||||||
} else if (mode == FM_refresh) {
|
} else if (mode == FM_refresh) {
|
||||||
// Just bind the FBO.
|
// Just bind the FBO.
|
||||||
rebuild_bitplanes();
|
rebuild_bitplanes();
|
||||||
|
|
||||||
|
// Bind the non-multisample FBO, since we won't be rendering anything and
|
||||||
|
// the caller probably wanted to grab a screenshot.
|
||||||
|
if (_fbo_multisample != 0 && !_fbo.empty()) {
|
||||||
|
glgsg->bind_fbo(_fbo[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The host window may not have had sRGB enabled, so we need to do this.
|
// The host window may not have had sRGB enabled, so we need to do this.
|
||||||
@ -1330,11 +1336,12 @@ end_frame(FrameMode mode, Thread *current_thread) {
|
|||||||
nassertv(_gsg != nullptr);
|
nassertv(_gsg != nullptr);
|
||||||
|
|
||||||
// Resolve Multisample rendering if using it.
|
// Resolve Multisample rendering if using it.
|
||||||
if (_requested_multisamples && _fbo_multisample) {
|
if (_requested_multisamples && _fbo_multisample && mode != FM_refresh) {
|
||||||
resolve_multisamples();
|
resolve_multisamples();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == FM_render) {
|
if (mode == FM_render) {
|
||||||
|
// Should happen *after* resolving multisamples, with the non-MS FBO bound.
|
||||||
copy_to_textures();
|
copy_to_textures();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user