HostDisplay: Add method to render screenshots at window size

This commit is contained in:
Connor McLaughlin
2021-03-06 02:11:17 +10:00
parent 757bef7b6d
commit 2aea58d056
8 changed files with 279 additions and 33 deletions

View File

@ -64,6 +64,8 @@ public:
virtual void SetVSync(bool enabled) override;
virtual bool Render() override;
virtual bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
HostDisplayPixelFormat* out_format) override;
static AdapterAndModeList StaticGetAdapterAndModeList(const WindowInfo* wi);
@ -89,9 +91,10 @@ protected:
};
bool CheckPostProcessingRenderTargets(u32 target_width, u32 target_height);
void ApplyPostProcessingChain(s32 final_left, s32 final_top, s32 final_width, s32 final_height, void* texture_handle,
u32 texture_width, s32 texture_height, s32 texture_view_x, s32 texture_view_y,
s32 texture_view_width, s32 texture_view_height);
void ApplyPostProcessingChain(VkFramebuffer target_fb, s32 final_left, s32 final_top, s32 final_width,
s32 final_height, void* texture_handle, u32 texture_width, s32 texture_height,
s32 texture_view_x, s32 texture_view_y, s32 texture_view_width, s32 texture_view_height,
u32 target_width, u32 target_height);
// Can be overridden by frontends.
virtual VkRenderPass GetRenderPassForDisplay() const;
@ -103,7 +106,7 @@ protected:
virtual void DestroyImGuiContext() override;
virtual bool UpdateImGuiFontTexture() override;
void BeginSwapChainRenderPass(VkFramebuffer framebuffer);
void BeginSwapChainRenderPass(VkFramebuffer framebuffer, u32 width, u32 height);
void RenderDisplay();
void RenderImGui();
void RenderSoftwareCursor();