mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
video_out: HDR support (#2381)
* Initial HDR support * fix for crashes when debug tools used
This commit is contained in:
@@ -118,6 +118,10 @@ void OnResize() {
|
||||
Sdl::OnResize();
|
||||
}
|
||||
|
||||
void OnSurfaceFormatChange(vk::Format surface_format) {
|
||||
Vulkan::OnSurfaceFormatChange(surface_format);
|
||||
}
|
||||
|
||||
void Shutdown(const vk::Device& device) {
|
||||
auto result = device.waitIdle();
|
||||
if (result != vk::Result::eSuccess) {
|
||||
|
||||
@@ -22,6 +22,8 @@ void Initialize(const Vulkan::Instance& instance, const Frontend::WindowSDL& win
|
||||
|
||||
void OnResize();
|
||||
|
||||
void OnSurfaceFormatChange(vk::Format surface_format);
|
||||
|
||||
void Shutdown(const vk::Device& device);
|
||||
|
||||
bool ProcessEvent(SDL_Event* event);
|
||||
|
||||
@@ -1265,4 +1265,20 @@ void Shutdown() {
|
||||
IM_DELETE(bd);
|
||||
}
|
||||
|
||||
void OnSurfaceFormatChange(vk::Format surface_format) {
|
||||
VkData* bd = GetBackendData();
|
||||
const InitInfo& v = bd->init_info;
|
||||
auto& pl_format = const_cast<vk::Format&>(
|
||||
bd->init_info.pipeline_rendering_create_info.pColorAttachmentFormats[0]);
|
||||
if (pl_format != surface_format) {
|
||||
pl_format = surface_format;
|
||||
if (bd->pipeline) {
|
||||
v.device.destroyPipeline(bd->pipeline, v.allocator);
|
||||
bd->pipeline = VK_NULL_HANDLE;
|
||||
CreatePipeline(v.device, v.allocator, v.pipeline_cache, nullptr, &bd->pipeline,
|
||||
v.subpass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ImGui::Vulkan
|
||||
|
||||
@@ -67,5 +67,6 @@ void RenderDrawData(ImDrawData& draw_data, vk::CommandBuffer command_buffer,
|
||||
vk::Pipeline pipeline = VK_NULL_HANDLE);
|
||||
|
||||
void SetBlendEnabled(bool enabled);
|
||||
void OnSurfaceFormatChange(vk::Format surface_format);
|
||||
|
||||
} // namespace ImGui::Vulkan
|
||||
} // namespace ImGui::Vulkan
|
||||
|
||||
Reference in New Issue
Block a user