New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VideoBackends: Internal resolution frame dumping #4436
Conversation
I feel that this would be a nice feature to have for people like me who do a lot of video dumping in Dolphin. |
Source/Core/VideoBackends/Vulkan/Renderer.cpp, line 719 at r1 (raw file):
This code segment should probably be its own function. Comments from Reviewable |
If this stays Vulkan (or: !all backends) only, I'd like to have the Checkbox disabled for the other backends (that is, an according BackendInfo.bSupportsXxxx). Otherwise I like the idea ;) |
@BhaaLseN it's not a lot of work to port it to the other backends, just means rendering the frame dump to a FBO instead of to the window, and reading that back. I'll implement it on GL first, then maybe D3D. |
{ | ||
if (!IsFrameDumping()) | ||
return; | ||
|
||
// This needs to be converted to the GL bottom-up window coordinate system. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This PR can be considered complete now. It's only implemented for OpenGL and Vulkan, however the check box will not show up anymore if a user is using D3D. I wanted to keep this PR as small as possible, so if someone wishes to add support for the other backends it's not super-difficult, just a fair bit of code shuffling. |
₍₍ (ง ˘ω˘ )ว ⁾⁾ Let's get this reviewed so we can merge it before the progress report! This is awesome! |
I should also probably mention this fixes a regression introduced with the frame dumping changes where an extra frame would be "buffered" after saving a screenshot, so the image actually written to the disk would be one "screenshot" behind when the user actually triggered it. |
Can't really comment on the API-specific parts, but the cleanup of Reviewed 1 of 10 files at r2, 11 of 15 files at r5. Source/Core/VideoCommon/RenderBase.cpp, line 450 at r5 (raw file):
I hope we never get a Comments from Reviewable |
Review status: 12 of 19 files reviewed at latest revision, 3 unresolved discussions. Source/Core/VideoBackends/OGL/Render.cpp, line 1637 at r4 (raw file): Previously, degasus (Markus Wick) wrote…
Moved to SwapImpl(). Source/Core/VideoBackends/Vulkan/Renderer.cpp, line 719 at r1 (raw file): Previously, lioncash (Mat M.) wrote…
Done as CalculateFrameDumpDrawRectangle(). Source/Core/VideoCommon/RenderBase.cpp, line 450 at r5 (raw file): Previously, BhaaLseN (BhaaL) wrote…
Don't see how that could happen. target_width comes from FramebufferManager, which IIRC uses a "max(width, 1)" statement for the size, since creating zero-sized textures is invalid. Same with the backbuffer dimensions, this comes directly from the swap chain, and it shouldn't be zero for the same reason. That said, it might be worth adding an assert just in case though? Comments from Reviewable |
Small nitpicks, but LGTM Reviewed 2 of 10 files at r2, 2 of 4 files at r4, 10 of 15 files at r5. Source/Core/VideoBackends/OGL/Render.cpp, line 1737 at r5 (raw file):
Why 10? We usually use 9 for all kind of temporary usages. Or is 9 already used within the swapping logic? Source/Core/VideoCommon/RenderBase.cpp, line 513 at r5 (raw file):
heh, which video encoder is not able to process it? We don't guarantee a multiple of 4 in the other way either. Comments from Reviewable |
We have the s_backbuffer_{width,height} fields to represent this, so there's no point in passing them as parameters every time.
Review status: 8 of 18 files reviewed at latest revision, 3 unresolved discussions. Source/Core/VideoBackends/OGL/Render.cpp, line 1737 at r5 (raw file): Previously, degasus (Markus Wick) wrote…
GL_TEXTURE9 is used as the source image unit for the final blit to screen, but it doesn't matter since it's only bound here for the allocation/parameter setting, so I've changed it to 9 also. Source/Core/VideoCommon/RenderBase.cpp, line 513 at r5 (raw file): Previously, degasus (Markus Wick) wrote…
Not sure, this comment was left in the original code. If it's not an issue with libav, maybe it was from when we were using VFW previously? If libav has no such restriction on formats I'll drop it. Comments from Reviewable |
Reviewed 10 of 11 files at r6. Source/Core/VideoCommon/RenderBase.cpp, line 513 at r5 (raw file): Previously, stenzek (Stenzek) wrote…
libav doesn't require this AFAIK. I don't remeber such a code either. Comments from Reviewable |
Reviewed 1 of 1 files at r7. Comments from Reviewable |
This is sort of a RFC if such a feature would be worth doing for the other backends. It was really straightforward with Vulkan as the various final blit paths are all separated, but for the others it'd require a bit more refactoring.
This change is