@@ -179,7 +179,6 @@ typedef struct vk
179179 struct vk_image * backbuffer ;
180180#ifdef VULKAN_HDR_SWAPCHAIN
181181 VkRenderPass readback_render_pass ;
182- /* struct vk_image main_buffer; */
183182 struct vk_image readback_image ;
184183#endif /* VULKAN_HDR_SWAPCHAIN */
185184
@@ -231,7 +230,6 @@ typedef struct vk
231230 VkPipeline font ;
232231 VkPipeline rgb565_to_rgba8888 ;
233232#ifdef VULKAN_HDR_SWAPCHAIN
234- /* VkPipeline hdr; */
235233 VkPipeline hdr_to_sdr ; /* for readback */
236234#endif /* VULKAN_HDR_SWAPCHAIN */
237235 VkDescriptorSetLayout set_layout ;
@@ -2419,9 +2417,6 @@ static void vulkan_init_pipeline_layout(
24192417static void vulkan_init_pipelines (vk_t * vk )
24202418{
24212419#ifdef VULKAN_HDR_SWAPCHAIN
2422- /* static const uint32_t hdr_frag[] =
2423- #include "vulkan_shaders/hdr.frag.inc"
2424- ;*/
24252420 static const uint32_t hdr_tonemap_frag [] =
24262421#include "vulkan_shaders/hdr_tonemap.frag.inc"
24272422 ;
@@ -2648,30 +2643,6 @@ if (vk->context->flags & VK_CTX_FLAG_HDR_SUPPORT)
26482643{
26492644 blend_attachment .blendEnable = VK_FALSE ;
26502645
2651- /* HDR pipeline. */
2652- /*
2653- module_info.codeSize = sizeof(hdr_frag);
2654- module_info.pCode = hdr_frag;
2655- shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
2656- shader_stages[1].pName = "main";
2657- vkCreateShaderModule(vk->context->device,
2658- &module_info, NULL, &shader_stages[1].module);
2659-
2660- vkCreateGraphicsPipelines(vk->context->device, vk->pipelines.cache,
2661- 1, &pipe, NULL, &vk->pipelines.hdr);
2662- */
2663-
2664- /* Build display hdr pipelines. */
2665- /*
2666- for (i = 4; i < 6; i++)
2667- {
2668- input_assembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
2669- vkCreateGraphicsPipelines(vk->context->device, vk->pipelines.cache,
2670- 1, &pipe, NULL, &vk->display.pipelines[i]);
2671- }
2672-
2673- vkDestroyShaderModule(vk->context->device, shader_stages[1].module, NULL);
2674- */
26752646
26762647 /* HDR->SDR tonemapping readback pipeline. */
26772648 module_info .codeSize = sizeof (hdr_tonemap_frag );
@@ -2978,8 +2949,6 @@ static void vulkan_deinit_pipelines(vk_t *vk)
29782949#ifdef VULKAN_HDR_SWAPCHAIN
29792950if (vk -> context -> flags & VK_CTX_FLAG_HDR_SUPPORT )
29802951{
2981- /* vkDestroyPipeline(vk->context->device,
2982- vk->pipelines.hdr, NULL); */
29832952 vkDestroyPipeline (vk -> context -> device ,
29842953 vk -> pipelines .hdr_to_sdr , NULL );
29852954}
@@ -3477,7 +3446,6 @@ static void vulkan_free(void *data)
34773446 if (vk -> context -> flags & VK_CTX_FLAG_HDR_SUPPORT )
34783447 {
34793448 vulkan_destroy_buffer (vk -> context -> device , & vk -> hdr .ubo );
3480- /* vulkan_destroy_hdr_buffer(vk->context->device, &vk->main_buffer); */
34813449 vulkan_destroy_hdr_buffer (vk -> context -> device , & vk -> readback_image );
34823450 vulkan_deinit_hdr_readback_render_pass (vk );
34833451 video_driver_unset_hdr_support ();
@@ -4947,7 +4915,7 @@ static bool vulkan_frame(void *data, const void *frame,
49474915
49484916#ifdef VULKAN_HDR_SWAPCHAIN
49494917 vulkan_filter_chain_set_enable_hdr (
4950- (vulkan_filter_chain_t * )filter_chain , vk -> context -> flags & VK_CTX_FLAG_HDR_ENABLE );
4918+ (vulkan_filter_chain_t * )filter_chain , ( vk -> context -> flags & VK_CTX_FLAG_HDR_ENABLE ) ? 1.0f : 0.0f );
49514919#endif /* VULKAN_HDR_SWAPCHAIN */
49524920
49534921 /* Render offscreen filter chain passes. */
@@ -5047,12 +5015,6 @@ static bool vulkan_frame(void *data, const void *frame,
50475015 }
50485016#endif
50495017
5050- /*
5051- #ifdef VULKAN_HDR_SWAPCHAIN
5052- if (use_main_buffer)
5053- backbuffer = &vk->main_buffer;
5054- #endif /* VULKAN_HDR_SWAPCHAIN */
5055-
50565018 /* Render to backbuffer. */
50575019 if ( (backbuffer -> image != VK_NULL_HANDLE )
50585020 && (vk -> context -> flags & VK_CTX_FLAG_HAS_ACQUIRED_SWAPCHAIN ))
@@ -5365,7 +5327,6 @@ static bool vulkan_frame(void *data, const void *frame,
53655327#ifdef HAVE_THREADS
53665328 slock_unlock (vk -> context -> queue_lock );
53675329#endif
5368- /* vulkan_destroy_hdr_buffer(vk->context->device, &vk->main_buffer); */
53695330 vulkan_destroy_hdr_buffer (vk -> context -> device , & vk -> readback_image );
53705331 }
53715332 else
@@ -5383,9 +5344,6 @@ static bool vulkan_frame(void *data, const void *frame,
53835344#ifdef VULKAN_HDR_SWAPCHAIN
53845345 if (vk -> context -> flags & VK_CTX_FLAG_HDR_ENABLE )
53855346 {
5386- /* Create intermediary buffer to render filter chain output to */
5387- /* vulkan_init_render_target(&vk->main_buffer, video_width, video_height,
5388- vk->context->swapchain_format, vk->render_pass, vk->context); */
53895347 /* Create image for readback target in bgra8 format */
53905348 vulkan_init_render_target (& vk -> readback_image , video_width , video_height ,
53915349 VK_FORMAT_B8G8R8A8_UNORM , vk -> readback_render_pass , vk -> context );
0 commit comments