Skip to content
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

An experiment of libplacebo on macOS with MoltenVK #111

Closed
CarterLi opened this issue Nov 18, 2021 · 29 comments
Closed

An experiment of libplacebo on macOS with MoltenVK #111

CarterLi opened this issue Nov 18, 2021 · 29 comments

Comments

@CarterLi
Copy link
Contributor

CarterLi commented Nov 18, 2021

Version:

The process:

  • meson failed to find vulkan.
Dependency vulkan found: NO unknown version, but need: ['>=1.1']

Solved by removing volkan version requirement in meson.build

  • Built successfully ( with -Dvulkan-registry specified ). Ran build/demos/plplay -v ~/HDR.webm, I got
Opening file: '/Users/carter/HDR.webm'
Format: matroska,webm
Duration: 45.433 s
Found video track (stream 0)
Resolution: 1920 x 1080
FPS: 60.000000
Bitrate: 0 kbps
Format: yuv420p10le
Initialized libplacebo v4.157.0 (API v157)
Attempting to initialize API: SDL2 (vulkan)
Available instance version: 1.2.189
Available layers:
    VK_LAYER_LUNARG_api_dump (v1.2.189)
    VK_LAYER_KHRONOS_validation (v1.2.189)
    VK_LAYER_LUNARG_device_simulation (v1.2.189)
    VK_LAYER_KHRONOS_synchronization2 (v1.2.189)
Enabling debug meta layer: VK_LAYER_KHRONOS_validation
Available instance extensions:
    VK_KHR_device_group_creation
    VK_KHR_external_fence_capabilities
    VK_KHR_external_memory_capabilities
    VK_KHR_external_semaphore_capabilities
    VK_KHR_get_physical_device_properties2
    VK_KHR_get_surface_capabilities2
    VK_KHR_surface
    VK_EXT_debug_report
    VK_EXT_debug_utils
    VK_EXT_metal_surface
    VK_EXT_swapchain_colorspace
    VK_MVK_macos_surface
    VK_EXT_validation_features (via VK_LAYER_KHRONOS_validation)
Enabling debug report extension: VK_EXT_debug_utils
Creating vulkan instance with extensions:
    VK_KHR_get_physical_device_properties2
    VK_KHR_surface
    VK_EXT_swapchain_colorspace
    VK_KHR_external_memory_capabilities
    VK_KHR_external_semaphore_capabilities
    VK_KHR_surface
    VK_MVK_macos_surface
    VK_EXT_debug_utils
  and layers:
    VK_LAYER_KHRONOS_validation
Probing for vulkan devices:
    GPU 0: Apple M1 Pro (integrated)
           uuid: 00:00:10:6B:00:00:A1:40:00:00:00:01:00:00:08:84
Vulkan device properties:
    Device Name: Apple M1 Pro
    Device ID: 106b:a140
    Device UUID: 00:00:10:6B:00:00:A1:40:00:00:00:01:00:00:08:84
    Driver version: 10105
    API version: 1.1.189
Queue families supported by device:
    0: flags 0x7 num 1
    1: flags 0x7 num 1
    2: flags 0x7 num 1
    3: flags 0x7 num 1
Using graphics queue 0
Available device extensions:
    VK_KHR_16bit_storage
    VK_KHR_8bit_storage
    VK_KHR_bind_memory2
    VK_KHR_create_renderpass2
    VK_KHR_dedicated_allocation
    VK_KHR_depth_stencil_resolve
    VK_KHR_descriptor_update_template
    VK_KHR_device_group
    VK_KHR_driver_properties
    VK_KHR_external_fence
    VK_KHR_external_memory
    VK_KHR_external_semaphore
    VK_KHR_get_memory_requirements2
    VK_KHR_imageless_framebuffer
    VK_KHR_image_format_list
    VK_KHR_maintenance1
    VK_KHR_maintenance2
    VK_KHR_maintenance3
    VK_KHR_multiview
    VK_KHR_portability_subset
    VK_KHR_push_descriptor
    VK_KHR_relaxed_block_layout
    VK_KHR_sampler_mirror_clamp_to_edge
    VK_KHR_sampler_ycbcr_conversion
    VK_KHR_shader_draw_parameters
    VK_KHR_shader_float16_int8
    VK_KHR_shader_subgroup_extended_types
    VK_KHR_storage_buffer_storage_class
    VK_KHR_swapchain
    VK_KHR_swapchain_mutable_format
    VK_KHR_timeline_semaphore
    VK_KHR_uniform_buffer_standard_layout
    VK_KHR_variable_pointers
    VK_EXT_debug_marker
    VK_EXT_descriptor_indexing
    VK_EXT_fragment_shader_interlock
    VK_EXT_hdr_metadata
    VK_EXT_host_query_reset
    VK_EXT_image_robustness
    VK_EXT_inline_uniform_block
    VK_EXT_memory_budget
    VK_EXT_post_depth_coverage
    VK_EXT_private_data
    VK_EXT_robustness2
    VK_EXT_scalar_block_layout
    VK_EXT_shader_stencil_export
    VK_EXT_shader_viewport_index_layer
    VK_EXT_subgroup_size_control
    VK_EXT_texel_buffer_alignment
    VK_EXT_texture_compression_astc_hdr
    VK_EXT_vertex_attribute_divisor
    VK_AMD_gpu_shader_half_float
    VK_AMD_negative_viewport_height
    VK_AMD_shader_image_load_store_lod
    VK_AMD_shader_trinary_minmax
    VK_IMG_format_pvrtc
    VK_INTEL_shader_integer_functions2
    VK_GOOGLE_display_timing
    VK_NV_glsl_shader
Creating vulkan device with extensions:
    VK_KHR_swapchain
    VK_KHR_swapchain
    VK_KHR_push_descriptor
    VK_EXT_hdr_metadata
    VK_EXT_host_query_reset
    VK_KHR_image_format_list
vk Loading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
    using unknown object: anon (0x10d00ee00)
vk Inserted device layer VK_LAYER_KHRONOS_validation (/usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib)
    using unknown object: anon (0x10d00ee00)
vk Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x6000010b98a0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x3a3b6ca0 | vkCreateDevice: VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x6000010b98a0[] supports it The Vulkan spec states: If the [VK_KHR_portability_subset] extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensions must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.2.189.0/mac/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451)
    using unknown object: anon (0x6000010b98a0)
vk vkCreateDevice:  Failed to create device chain.
    using unknown object: anon (0x10d00ee00)
vk Unloading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
    using unknown object: anon (0x10d00ee00)
vk->CreateDevice(vk->physd, &dinfo, PL_VK_ALLOC, &vk->dev): VK_ERROR_VALIDATION_FAILED_EXT (../src/vulkan/context.c:1230)
Failed creating logical device!
Failed initializing vulkan device
libplacebo: Failed creating vulkan device
Attempting to initialize API: SDL2 (opengl)
Detected OpenGL version strings:
    GL_VERSION:  2.1 Metal - 76.1
    GL_VENDOR:   Apple
    GL_RENDERER: Apple M1 Pro
    GL_EXTENSIONS: GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_SGI_color_matrix GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod
OpenGL debugging requested but GL_ARB_debug_output unavailable.. ignoring!
    GL_SHADING_LANGUAGE_VERSION: 1.20
pl_gpu_create_gl: OpenGL error: GL_INVALID_ENUM
Failed initializing opengl context!
libplacebo: Failed creating opengl device
No windowing system / graphical API compiled or supported!

Notably

vk Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x6000010b98a0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x3a3b6ca0 | vkCreateDevice: VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x6000010b98a0[] supports it The Vulkan spec states: If the [VK_KHR_portability_subset] extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensions must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.2.189.0/mac/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451)

Solved by enabling VK_KHR_portability_subset

// src/include/libplacebo/vulkan.h
#include <vulkan/vulkan_beta.h>
// src/vulkan/context.c
    {
        .name = VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME,
        .funs = (struct vk_fun[]) {
            {0}
        },
    }
  • Video was played successfully. Brightness was at the expected level ( HDR mode was enabled ). But the image was kind of mess ( top and bottom edge )

image

And lots of warnings were printed on the console

Creating VkEvent: VK_ERROR_VALIDATION_FAILED_EXT (../src/vulkan/command.c:170)
vk Validation Error: [ VUID-vkCreateEvent-events-04468 ] Object 0: handle = 0x14c00ea18, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7b0a45fb | vkCreateEvent: events are not supported via VK_KHR_portability_subset The Vulkan spec states: If the [VK_KHR_portability_subset] extension is enabled, and VkPhysicalDevicePortabilitySubsetFeaturesKHR::events is VK_FALSE, then the implementation does not support events, and vkCreateEvent must not be used (https://vulkan.lunarg.com/doc/view/1.2.189.0/mac/1.2-extensions/vkspec.html#VUID-vkCreateEvent-events-04468)

Solved by enabling VkPhysicalDevicePortabilitySubsetFeaturesKHR::events with

// src/vulkan/context.c

// pNext chain of features we want enabled
static const VkPhysicalDevicePortabilitySubsetFeaturesKHR portability_subset_features = {
    .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR,
    .events = true,
};

static const VkPhysicalDeviceHostQueryResetFeaturesEXT host_query_reset = {
    .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT,
    .pNext = (void *) &portability_subset_features,
    .hostQueryReset = true,
};

Full log

$ build/demos/plplay -v ~/HDR.webm
Opening file: '/Users/carter/HDR.webm'
Format: matroska,webm
Duration: 45.433 s
Found video track (stream 0)
Resolution: 1920 x 1080
FPS: 60.000000
Bitrate: 0 kbps
Format: yuv420p10le
Initialized libplacebo v4.157.0 (API v157)
Attempting to initialize API: SDL2 (vulkan)
Available instance version: 1.2.189
Available layers:
    VK_LAYER_LUNARG_api_dump (v1.2.189)
    VK_LAYER_KHRONOS_validation (v1.2.189)
    VK_LAYER_LUNARG_device_simulation (v1.2.189)
    VK_LAYER_KHRONOS_synchronization2 (v1.2.189)
Enabling debug meta layer: VK_LAYER_KHRONOS_validation
Available instance extensions:
    VK_KHR_device_group_creation
    VK_KHR_external_fence_capabilities
    VK_KHR_external_memory_capabilities
    VK_KHR_external_semaphore_capabilities
    VK_KHR_get_physical_device_properties2
    VK_KHR_get_surface_capabilities2
    VK_KHR_surface
    VK_EXT_debug_report
    VK_EXT_debug_utils
    VK_EXT_metal_surface
    VK_EXT_swapchain_colorspace
    VK_MVK_macos_surface
    VK_EXT_validation_features (via VK_LAYER_KHRONOS_validation)
Enabling debug report extension: VK_EXT_debug_utils
Creating vulkan instance with extensions:
    VK_KHR_get_physical_device_properties2
    VK_KHR_surface
    VK_EXT_swapchain_colorspace
    VK_KHR_external_memory_capabilities
    VK_KHR_external_semaphore_capabilities
    VK_KHR_surface
    VK_MVK_macos_surface
    VK_EXT_debug_utils
  and layers:
    VK_LAYER_KHRONOS_validation
Probing for vulkan devices:
    GPU 0: Apple M1 Pro (integrated)
           uuid: 00:00:10:6B:00:00:A1:40:00:00:00:01:00:00:08:84
Vulkan device properties:
    Device Name: Apple M1 Pro
    Device ID: 106b:a140
    Device UUID: 00:00:10:6B:00:00:A1:40:00:00:00:01:00:00:08:84
    Driver version: 10105
    API version: 1.1.189
Queue families supported by device:
    0: flags 0x7 num 1
    1: flags 0x7 num 1
    2: flags 0x7 num 1
    3: flags 0x7 num 1
Using graphics queue 0
Available device extensions:
    VK_KHR_16bit_storage
    VK_KHR_8bit_storage
    VK_KHR_bind_memory2
    VK_KHR_create_renderpass2
    VK_KHR_dedicated_allocation
    VK_KHR_depth_stencil_resolve
    VK_KHR_descriptor_update_template
    VK_KHR_device_group
    VK_KHR_driver_properties
    VK_KHR_external_fence
    VK_KHR_external_memory
    VK_KHR_external_semaphore
    VK_KHR_get_memory_requirements2
    VK_KHR_imageless_framebuffer
    VK_KHR_image_format_list
    VK_KHR_maintenance1
    VK_KHR_maintenance2
    VK_KHR_maintenance3
    VK_KHR_multiview
    VK_KHR_portability_subset
    VK_KHR_push_descriptor
    VK_KHR_relaxed_block_layout
    VK_KHR_sampler_mirror_clamp_to_edge
    VK_KHR_sampler_ycbcr_conversion
    VK_KHR_shader_draw_parameters
    VK_KHR_shader_float16_int8
    VK_KHR_shader_subgroup_extended_types
    VK_KHR_storage_buffer_storage_class
    VK_KHR_swapchain
    VK_KHR_swapchain_mutable_format
    VK_KHR_timeline_semaphore
    VK_KHR_uniform_buffer_standard_layout
    VK_KHR_variable_pointers
    VK_EXT_debug_marker
    VK_EXT_descriptor_indexing
    VK_EXT_fragment_shader_interlock
    VK_EXT_hdr_metadata
    VK_EXT_host_query_reset
    VK_EXT_image_robustness
    VK_EXT_inline_uniform_block
    VK_EXT_memory_budget
    VK_EXT_post_depth_coverage
    VK_EXT_private_data
    VK_EXT_robustness2
    VK_EXT_scalar_block_layout
    VK_EXT_shader_stencil_export
    VK_EXT_shader_viewport_index_layer
    VK_EXT_subgroup_size_control
    VK_EXT_texel_buffer_alignment
    VK_EXT_texture_compression_astc_hdr
    VK_EXT_vertex_attribute_divisor
    VK_AMD_gpu_shader_half_float
    VK_AMD_negative_viewport_height
    VK_AMD_shader_image_load_store_lod
    VK_AMD_shader_trinary_minmax
    VK_IMG_format_pvrtc
    VK_INTEL_shader_integer_functions2
    VK_GOOGLE_display_timing
    VK_NV_glsl_shader
Creating vulkan device with extensions:
    VK_KHR_swapchain
    VK_KHR_swapchain
    VK_KHR_push_descriptor
    VK_EXT_hdr_metadata
    VK_EXT_host_query_reset
    VK_KHR_image_format_list
    VK_KHR_portability_subset
vk Loading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
    using unknown object: anon (0x13c88f200)
vk Inserted device layer VK_LAYER_KHRONOS_validation (/usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib)
    using unknown object: anon (0x13c88f200)
vk Using MTLEvent for Vulkan semaphores.
    using unknown object: anon (0x12e01c618)
vk Created VkDevice to run on GPU Apple M1 Pro with the following 6 Vulkan extensions enabled:
		VK_KHR_image_format_list v1
		VK_KHR_portability_subset v1
		VK_KHR_push_descriptor v2
		VK_KHR_swapchain v70
		VK_EXT_hdr_metadata v2
		VK_EXT_host_query_reset v1
    using unknown object: anon (0x12e01c618)
glslang version: 11.6.0
Initialized SPIR-V compiler 'glslang'
Memory heaps supported by device:
    0: flags 0x1 size 17179869184
Memory types supported by device:
    0: flags 0x1 heap 0
    1: flags 0xf heap 0
    2: flags 0xb heap 0
    3: flags 0x11 heap 0
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not exportable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not importable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not exportable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not importable
Minimum texel alignment: 96
GPU information:
    GLSL version: 450 (vulkan)
      max_shmem_size:            32768
      max_group_threads:         1024
      max_group_size[0]:         1024
      max_group_size[1]:         1024
      max_group_size[2]:         1024
      subgroup_size:             32
      min_gather_offset:         -8
      max_gather_offset:         7
    Limits:
      thread_safe:               1
      callbacks:                 1
      max_buf_size:              18446744073709551615
      max_ubo_size:              4294967295
      max_ssbo_size:             4294967295
      max_vbo_size:              18446744073709551615
      max_mapped_size:           18446744073709551615
      max_buffer_texels:         67108864
      align_host_ptr:            0
      max_tex_1d_dim:            16384
      max_tex_2d_dim:            16384
      max_tex_3d_dim:            2048
      blittable_1d_3d:           1
      buf_transfer:              1
      align_tex_xfer_stride:     1
      align_tex_xfer_offset:     16
      max_variables:             0
      max_constants:             18446744073709551615
      max_pushc_size:            4096
      max_dispatch[0]:           1073741824
      max_dispatch[1]:           1073741824
      max_dispatch[2]:           1073741824
      fragment_queues:           1
      compute_queues:            1
GPU texture formats:
    NAME       TYPE   SIZE COMP CAPS         EMU DEPTH         HOST_BITS     GLSL_TYPE  GLSL_FMT   FOURCC
    r8         UNORM  1    R    SsLRbBVutHWG n   {8  0  0  0 } {8  0  0  0 } float      r8         R8
    r8s        SNORM  1    R    SsLRbBVutHWG n   {8  0  0  0 } {8  0  0  0 } float      r8_snorm
    rg8        UNORM  2    RG   SsLRbBVutHWG n   {8  8  0  0 } {8  8  0  0 } vec2       rg8        GR88
    rg8s       SNORM  2    RG   SsLRbBVutHWG n   {8  8  0  0 } {8  8  0  0 } vec2       rg8_snorm
    rgba8      UNORM  4    RGBA SsLRbBVutHWG n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8      AB24
    rgba8s     SNORM  4    RGBA SsLRbBVutHWG n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8_snorm
    bgra8      UNORM  4    BGRA SsLRbBVutHWG n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8      AR24
    rgb10a2    UNORM  4    RGBA SsLRbBVutHWG n   {10 10 10 2 } {10 10 10 2 } vec4       rgb10_a2   AB30
    r16        UNORM  2    R    SsLRbBVutHWG n   {16 0  0  0 } {16 0  0  0 } float      r16        R16
    r16hf      FLOAT  2    R    SsLRbBVutHWG n   {16 0  0  0 } {16 0  0  0 } float      r16f
    r16s       SNORM  2    R    SsLRbBVutHWG n   {16 0  0  0 } {16 0  0  0 } float      r16_snorm
    rg16       UNORM  4    RG   SsLRbBVutHWG n   {16 16 0  0 } {16 16 0  0 } vec2       rg16       GR32
    rg16hf     FLOAT  4    RG   SsLRbBVutHWG n   {16 16 0  0 } {16 16 0  0 } vec2       rg16f
    rg16s      SNORM  4    RG   SsLRbBVutHWG n   {16 16 0  0 } {16 16 0  0 } vec2       rg16_snorm
    rgba16     UNORM  8    RGBA SsLRbBVutHWG n   {16 16 16 16} {16 16 16 16} vec4       rgba16
    rgba16hf   FLOAT  8    RGBA SsLRbBVutHWG n   {16 16 16 16} {16 16 16 16} vec4       rgba16f    AB4H
    rgba16s    SNORM  8    RGBA SsLRbBVutHWG n   {16 16 16 16} {16 16 16 16} vec4       rgba16_snorm
    r32f       FLOAT  4    R    SsLRbBVutHWG n   {32 0  0  0 } {32 0  0  0 } float      r32f
    rg32f      FLOAT  8    RG   SsLRbBVutHWG n   {32 32 0  0 } {32 32 0  0 } vec2       rg32f
    rgba32f    FLOAT  16   RGBA SsLRbBVutHWG n   {32 32 32 32} {32 32 32 32} vec4       rgba32f
    r8i        SINT   1    R    Ss-R-BVutHWG n   {8  0  0  0 } {8  0  0  0 } int        r8i
    r8u        UINT   1    R    Ss-R-BVutHWG n   {8  0  0  0 } {8  0  0  0 } uint       r8ui
    rg8i       SINT   2    RG   Ss-R-BVutHWG n   {8  8  0  0 } {8  8  0  0 } ivec2      rg8i
    rg8u       UINT   2    RG   Ss-R-BVutHWG n   {8  8  0  0 } {8  8  0  0 } uvec2      rg8ui
    rgba8i     SINT   4    RGBA Ss-R-BVutHWG n   {8  8  8  8 } {8  8  8  8 } ivec4      rgba8i
    rgba8u     UINT   4    RGBA Ss-R-BVutHWG n   {8  8  8  8 } {8  8  8  8 } uvec4      rgba8ui
    r16i       SINT   2    R    Ss-R-BVutHWG n   {16 0  0  0 } {16 0  0  0 } int        r16i
    r16u       UINT   2    R    Ss-R-BVutHWG n   {16 0  0  0 } {16 0  0  0 } uint       r16ui
    rg16i      SINT   4    RG   Ss-R-BVutHWG n   {16 16 0  0 } {16 16 0  0 } ivec2      rg16i
    rg16u      UINT   4    RG   Ss-R-BVutHWG n   {16 16 0  0 } {16 16 0  0 } uvec2      rg16ui
    rgba16i    SINT   8    RGBA Ss-R-BVutHWG n   {16 16 16 16} {16 16 16 16} ivec4      rgba16i
    rgba16u    UINT   8    RGBA Ss-R-BVutHWG n   {16 16 16 16} {16 16 16 16} uvec4      rgba16ui
    r32i       SINT   4    R    Ss-R-BVutHWG n   {32 0  0  0 } {32 0  0  0 } int        r32i
    r32u       UINT   4    R    Ss-R-BVutHWG n   {32 0  0  0 } {32 0  0  0 } uint       r32ui
    rg32i      SINT   8    RG   Ss-R-BVutHWG n   {32 32 0  0 } {32 32 0  0 } ivec2      rg32i
    rg32u      UINT   8    RG   Ss-R-BVutHWG n   {32 32 0  0 } {32 32 0  0 } uvec2      rg32ui
    rgba32i    SINT   16   RGBA Ss-R-BVutHWG n   {32 32 32 32} {32 32 32 32} ivec4      rgba32i
    rgba32u    UINT   16   RGBA Ss-R-BVutHWG n   {32 32 32 32} {32 32 32 32} uvec4      rgba32ui
    rgb10a2u   UINT   4    RGBA Ss-R-B-utHWG n   {10 10 10 2 } {10 10 10 2 } uvec4      rgb10_a2ui
    a1bgr5     UNORM  2    ABGR S-LRbB-u-H-G n   {1  5  5  5 } {1  5  5  5 } vec4                  RA15
    abgr4      UNORM  2    ABGR S-LRbB-u-H-G n   {4  4  4  4 } {4  4  4  4 } vec4                  RA12
    bgr5a1     UNORM  2    BGRA S-LRbB-u-H-G n   {5  5  5  1 } {5  5  5  1 } vec4                  AR15
    bgr565     UNORM  2    BGR  S-LRbB-u-H-G n   {5  6  5  0 } {5  6  5  0 } vec3                  RG16
    bgr10a2    UNORM  4    BGRA S-LRbB-u-H-G n   {10 10 10 2 } {10 10 10 2 } vec4                  AR30
    rgb8i      SINT   3    RGB  ------V--H-- n   {8  8  8  0 } {8  8  8  0 } ivec3
    rgb8s      SNORM  3    RGB  ------V--H-- n   {8  8  8  0 } {8  8  8  0 } vec3
    rgb8u      UINT   3    RGB  ------V--H-- n   {8  8  8  0 } {8  8  8  0 } uvec3
    rgb10a2s   SNORM  4    RGBA ------V--H-- n   {10 10 10 2 } {10 10 10 2 } vec4
    rgb16hf    FLOAT  6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } vec3
    rgb16i     SINT   6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } ivec3
    rgb16s     SNORM  6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } vec3
    rgb16u     UINT   6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } uvec3
    rgb32f     FLOAT  12   RGB  ------V--H-- n   {32 32 32 0 } {32 32 32 0 } vec3
    rgb32i     SINT   12   RGB  ------V--H-- n   {32 32 32 0 } {32 32 32 0 } ivec3
    rgb32u     UINT   12   RGB  ------V--H-- n   {32 32 32 0 } {32 32 32 0 } uvec3
    a1rgb5     UNORM  2    ARGB ---------H-- n   {1  5  5  5 } {1  5  5  5 }                       BA15
    gr4        UNORM  1    GR   ---------H-- n   {4  4  0  0 } {4  4  0  0 }
    argb4      UNORM  2    ARGB ---------H-- n   {4  4  4  4 } {4  4  4  4 }                       BA12
    rgb565     UNORM  2    RGB  ---------H-- n   {5  6  5  0 } {5  6  5  0 }                       BG16
    bgr8       UNORM  3    BGR  ---------H-- n   {8  8  8  0 } {8  8  8  0 }                       RG24
    bgr8i      SINT   3    BGR  ---------H-- n   {8  8  8  0 } {8  8  8  0 }
    bgr8u      UINT   3    BGR  ---------H-- n   {8  8  8  0 } {8  8  8  0 }
    bgra8i     SINT   4    BGRA ---------H-- n   {8  8  8  8 } {8  8  8  8 }
    bgra8u     UINT   4    BGRA ---------H-- n   {8  8  8  8 } {8  8  8  8 }
    rgb10a2i   SINT   4    RGBA ---------H-- n   {10 10 10 2 } {10 10 10 2 }
    bgr10a2i   SINT   4    BGRA ---------H-- n   {10 10 10 2 } {10 10 10 2 }
    bgr10a2s   SNORM  4    BGRA ---------H-- n   {10 10 10 2 } {10 10 10 2 }
    bgr10a2u   UINT   4    BGRA ---------H-- n   {10 10 10 2 } {10 10 10 2 }
    r64i       SINT   8    R    ---------H-- n   {64 0  0  0 } {64 0  0  0 }
    r64u       UINT   8    R    ---------H-- n   {64 0  0  0 } {64 0  0  0 }
    rg64i      SINT   16   RG   ---------H-- n   {64 64 0  0 } {64 64 0  0 }
    rg64u      UINT   16   RG   ---------H-- n   {64 64 0  0 } {64 64 0  0 }
    rgb64i     SINT   24   RGB  ---------H-- n   {64 64 64 0 } {64 64 64 0 }
    rgb64u     UINT   24   RGB  ---------H-- n   {64 64 64 0 } {64 64 64 0 }
    rgba64i    SINT   32   RGBA ---------H-- n   {64 64 64 64} {64 64 64 64}
    rgba64u    UINT   32   RGBA ---------H-- n   {64 64 64 64} {64 64 64 64}
    rgb8       UNORM  3    RGB  SsLRbBV--HWG y   {8  8  8  0 } {8  8  8  0 } vec3       rgba8      BG24
    rgb16      UNORM  6    RGB  SsLRbBV--HWG y   {16 16 16 0 } {16 16 16 0 } vec3       rgba16
    r16f       FLOAT  4    R    SsLRbB---HWG y   {16 0  0  0 } {32 0  0  0 }            r16f
    rg16f      FLOAT  8    RG   SsLRbB---HWG y   {16 16 0  0 } {32 32 0  0 }            rg16f
    rgba16f    FLOAT  16   RGBA SsLRbB---HWG y   {16 16 16 16} {32 32 32 32}            rgba16f
    rgb16f     FLOAT  12   RGB  ---------H-- y   {16 16 16 0 } {32 32 32 0 }
Available surface configurations:
    0: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    1: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    2: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    3: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    4: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    5: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    6: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    7: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    8: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    9: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    10: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    11: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    12: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    13: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    14: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    15: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    16: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    17: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    18: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    19: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    20: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    21: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    22: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    23: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    24: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    25: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_PASS_THROUGH_EXT
    26: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_PASS_THROUGH_EXT
    27: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_PASS_THROUGH_EXT
    28: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_PASS_THROUGH_EXT
    29: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_PASS_THROUGH_EXT
    30: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    31: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    32: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    33: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    34: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    35: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    36: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    37: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    38: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    39: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    40: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    41: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    42: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    43: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    44: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    45: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT2020_LINEAR_EXT
    46: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT2020_LINEAR_EXT
    47: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT2020_LINEAR_EXT
    48: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_BT2020_LINEAR_EXT
    49: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT2020_LINEAR_EXT
    50: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_HDR10_HLG_EXT
    51: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_HDR10_HLG_EXT
    52: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_HDR10_HLG_EXT
    53: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_HLG_EXT
    54: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_HLG_EXT
    55: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_HDR10_ST2084_EXT
    56: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_HDR10_ST2084_EXT
    57: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_HDR10_ST2084_EXT
    58: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_ST2084_EXT
    59: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_ST2084_EXT
Picked surface configuration 28: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_PASS_THROUGH_EXT
Picked surface configuration 58: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_HDR10_ST2084_EXT
Requested alpha compositing mode: VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
Requested surface transform: VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
Requested image count: 4 (min 2 max 3)
Requested image size: 1920x1080 (min 1x1 < cur 1728x1051 < max 16384x16384)
(Re)creating swapchain of size 1920x1080
vk Created 3 swapchain images with initial size (1920, 1080).
    using unknown object: anon (0x12e00be00)
No matching format found
Allocating 25067520 memory of type 0xf (id 1) in heap 0
Allocating 100270080 memory of type 0xf (id 1) in heap 0
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format rg16
Allocating 2073600 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _const_2_0;
[ 10]     layout(offset=4) float _const_2_1;
[ 11] };
[ 12] layout(binding=0) uniform  sampler2D _src_tex_0_0;
[ 13] layout(binding=1) uniform  sampler2D _src_tex_0_1;
[ 14] layout(location=0) in vec2 _tex_coord_1_0_v;
[ 15] layout(location=0) out vec2 _tex_coord_1_0;
[ 16] layout(location=1) in vec2 _tex_coord_1_1_v;
[ 17] layout(location=1) out vec2 _tex_coord_1_1;
[ 18] layout(location=2) in vec2 _position_4_0_v;
[ 19] void main() {
[ 20] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 21] _tex_coord_1_1 = _tex_coord_1_1_v;
[ 22] gl_Position = vec4(_position_4_0_v, 0.0, 1.0);
[ 23] }
Spent 58.163 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _const_2_0;
[ 10]     layout(offset=4) float _const_2_1;
[ 11] };
[ 12] layout(binding=0) uniform  sampler2D _src_tex_0_0;
[ 13] layout(binding=1) uniform  sampler2D _src_tex_0_1;
[ 14] layout(location=0) in vec2 _tex_coord_1_0;
[ 15] layout(location=1) in vec2 _tex_coord_1_1;
[ 16] layout(location=0)  out vec4 out_color;
[ 17]
[ 18] vec4 _sub_3_0() {
[ 19] // pl_shader_sample_direct
[ 20] vec4 color = vec4(_const_2_1) * texture(_src_tex_0_1, _tex_coord_1_1);
[ 21] return color;
[ 22] }
[ 23]
[ 24] vec4 _main_5_0() {
[ 25] vec4 tmp;
[ 26] // pl_shader_sample_direct
[ 27] vec4 color = vec4(_const_2_0) * texture(_src_tex_0_0, _tex_coord_1_0);
[ 28] tmp = _sub_3_0();
[ 29] color[1] = tmp[0];
[ 30] return color;
[ 31] }
[ 32]
[ 33] void main() {
[ 34] out_color = _main_5_0();
[ 35] }
Spent 0.489 ms translating SPIR-V
Spent 0.076 ms compiling shader
Spent 0.893 ms creating pipeline
Pass statistics: size 5466, SPIR-V: vert 1740 frag 1844 comp 0
Allocating 1048576 memory of type 0xf (id 1) in heap 0
LUT cache invalidated, regenerating..
Allocating 2048 memory of type 0x1 (id 0) in heap 0
Allocating 1048576 memory of type 0xf (id 1) in heap 0
(Re)creating 960x1080x0 texture with format rg16hf
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_0;
[ 10]     layout(offset=8) vec2 _tex_pt_3_0;
[ 11]     layout(offset=16) float _const_7_0;
[ 12]     layout(offset=20) float _const_8_0;
[ 13]     layout(offset=24) float _const_10_0;
[ 14]     layout(offset=28) float _const_11_0;
[ 15]     layout(offset=32) float _const_12_0;
[ 16] };
[ 17] layout(binding=0) uniform  sampler2D _src_tex_0_0;
[ 18] layout(binding=1) uniform  sampler2D _weights_5_0;
[ 19] layout(location=0) in vec2 _tex_coord_1_0_v;
[ 20] layout(location=0) out vec2 _tex_coord_1_0;
[ 21] layout(location=1) in vec2 _position_13_0_v;
[ 22] void main() {
[ 23] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 24] gl_Position = vec4(_position_13_0_v, 0.0, 1.0);
[ 25] }
Spent 0.405 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_0;
[ 10]     layout(offset=8) vec2 _tex_pt_3_0;
[ 11]     layout(offset=16) float _const_7_0;
[ 12]     layout(offset=20) float _const_8_0;
[ 13]     layout(offset=24) float _const_10_0;
[ 14]     layout(offset=28) float _const_11_0;
[ 15]     layout(offset=32) float _const_12_0;
[ 16] };
[ 17] layout(binding=0) uniform  sampler2D _src_tex_0_0;
[ 18] layout(binding=1) uniform  sampler2D _weights_5_0;
[ 19] layout(location=0) in vec2 _tex_coord_1_0;
[ 20] layout(location=0)  out vec4 out_color;
[ 21]
[ 22] #define _LUT_POS_6_0(x) mix(_const_7_0, _const_8_0, (x))
[ 23] #define _LUT_POS_9_0(x) mix(_const_10_0, _const_11_0, (x))
[ 24] #define _lut_4_0(pos) (texture(_weights_5_0, vec2(\
[ 25]     _LUT_POS_6_0(vec2(pos).x)\
[ 26]    ,_LUT_POS_9_0(vec2(pos).y)\
[ 27]   )).xyzw)
[ 28] vec4 _main_14_0() {
[ 29] // pl_shader_sample_ortho
[ 30] vec4 color = vec4(0.0);
[ 31] {
[ 32] vec2 pos = _tex_coord_1_0, size = _tex_size_2_0, pt = _tex_pt_3_0;
[ 33] vec2 dir = vec2(0.0, 1.0);
[ 34] pt *= dir;
[ 35] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 36] float fcoord = dot(fcoord2, dir);
[ 37] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 38] float weight;
[ 39] vec4 ws, c;
[ 40] // scaler samples
[ 41] ws = _lut_4_0(vec2(0.00000000000000000000, fcoord));
[ 42] weight = ws[0];
[ 43] c = texture(_src_tex_0_0, base + pt * vec2(0.0));
[ 44] color[0] += weight * c[0];
[ 45] color[1] += weight * c[1];
[ 46] weight = ws[1];
[ 47] c = texture(_src_tex_0_0, base + pt * vec2(1.0));
[ 48] color[0] += weight * c[0];
[ 49] color[1] += weight * c[1];
[ 50] weight = ws[2];
[ 51] c = texture(_src_tex_0_0, base + pt * vec2(2.0));
[ 52] color[0] += weight * c[0];
[ 53] color[1] += weight * c[1];
[ 54] weight = ws[3];
[ 55] c = texture(_src_tex_0_0, base + pt * vec2(3.0));
[ 56] color[0] += weight * c[0];
[ 57] color[1] += weight * c[1];
[ 58] ws = _lut_4_0(vec2(1.00000000000000000000, fcoord));
[ 59] weight = ws[0];
[ 60] c = texture(_src_tex_0_0, base + pt * vec2(4.0));
[ 61] color[0] += weight * c[0];
[ 62] color[1] += weight * c[1];
[ 63] weight = ws[1];
[ 64] c = texture(_src_tex_0_0, base + pt * vec2(5.0));
[ 65] color[0] += weight * c[0];
[ 66] color[1] += weight * c[1];
[ 67] color *= vec4(_const_12_0);
[ 68] color.a = 1.0;
[ 69] }
[ 70] return color;
[ 71] }
[ 72]
[ 73] void main() {
[ 74] out_color = _main_14_0();
[ 75] }
Spent 0.849 ms translating SPIR-V
Spent 0.101 ms compiling shader
Spent 0.805 ms creating pipeline
Pass statistics: size 6685, SPIR-V: vert 1836 frag 6872 comp 0
LUT cache invalidated, regenerating..
Allocating 2048 memory of type 0x1 (id 0) in heap 0
LUT cache invalidated, regenerating..
Allocating 16384 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _const_2_3;
[ 10]     layout(offset=8) vec2 _tex_size_2_4;
[ 11]     layout(offset=16) vec2 _tex_pt_3_4;
[ 12]     layout(offset=24) float _const_7_4;
[ 13]     layout(offset=28) float _const_8_4;
[ 14]     layout(offset=32) float _const_10_4;
[ 15]     layout(offset=36) float _const_11_4;
[ 16]     layout(offset=40) float _const_12_4;
[ 17]     layout(offset=48) vec3 _cmat_c_3_2;
[ 18]     layout(offset=60) float _const_4_2;
[ 19]     layout(offset=64) int _const_8_2;
[ 20]     layout(offset=68) float _const_9_2;
[ 21]     layout(offset=80) mat3 _cmat_2_2;
[ 22] };
[ 23] layout(binding=0) uniform  sampler2D _src_tex_0_3;
[ 24] layout(binding=1) uniform  sampler2D _src_tex_0_4;
[ 25] layout(binding=2) uniform  sampler2D _weights_5_4;
[ 26] layout(binding=3) uniform  sampler2D _weights_7_2;
[ 27] layout(location=0) in vec2 _tex_coord_1_3_v;
[ 28] layout(location=0) out vec2 _tex_coord_1_3;
[ 29] layout(location=1) in vec2 _tex_coord_1_4_v;
[ 30] layout(location=1) out vec2 _tex_coord_1_4;
[ 31] layout(location=2) in vec2 _position_10_2_v;
[ 32] void main() {
[ 33] _tex_coord_1_3 = _tex_coord_1_3_v;
[ 34] _tex_coord_1_4 = _tex_coord_1_4_v;
[ 35] gl_Position = vec4(_position_10_2_v, 0.0, 1.0);
[ 36] }
Spent 0.512 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _const_2_3;
[ 10]     layout(offset=8) vec2 _tex_size_2_4;
[ 11]     layout(offset=16) vec2 _tex_pt_3_4;
[ 12]     layout(offset=24) float _const_7_4;
[ 13]     layout(offset=28) float _const_8_4;
[ 14]     layout(offset=32) float _const_10_4;
[ 15]     layout(offset=36) float _const_11_4;
[ 16]     layout(offset=40) float _const_12_4;
[ 17]     layout(offset=48) vec3 _cmat_c_3_2;
[ 18]     layout(offset=60) float _const_4_2;
[ 19]     layout(offset=64) int _const_8_2;
[ 20]     layout(offset=68) float _const_9_2;
[ 21]     layout(offset=80) mat3 _cmat_2_2;
[ 22] };
[ 23] layout(binding=0) uniform  sampler2D _src_tex_0_3;
[ 24] layout(binding=1) uniform  sampler2D _src_tex_0_4;
[ 25] layout(binding=2) uniform  sampler2D _weights_5_4;
[ 26] layout(binding=3) uniform  sampler2D _weights_7_2;
[ 27] layout(location=0) in vec2 _tex_coord_1_3;
[ 28] layout(location=1) in vec2 _tex_coord_1_4;
[ 29] layout(location=0)  out vec4 out_color;
[ 30]
[ 31] vec4 _sub_0_2() {
[ 32] // pl_shader_sample_direct
[ 33] vec4 color = vec4(_const_2_3) * texture(_src_tex_0_3, _tex_coord_1_3);
[ 34] return color;
[ 35] }
[ 36]
[ 37] #define _LUT_POS_6_4(x) mix(_const_7_4, _const_8_4, (x))
[ 38] #define _LUT_POS_9_4(x) mix(_const_10_4, _const_11_4, (x))
[ 39] #define _lut_4_4(pos) (texture(_weights_5_4, vec2(\
[ 40]     _LUT_POS_6_4(vec2(pos).x)\
[ 41]    ,_LUT_POS_9_4(vec2(pos).y)\
[ 42]   )).xyzw)
[ 43] vec4 _sub_1_2() {
[ 44] // pl_shader_sample_ortho
[ 45] vec4 color = vec4(0.0);
[ 46] {
[ 47] vec2 pos = _tex_coord_1_4, size = _tex_size_2_4, pt = _tex_pt_3_4;
[ 48] vec2 dir = vec2(1.0, 0.0);
[ 49] pt *= dir;
[ 50] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 51] float fcoord = dot(fcoord2, dir);
[ 52] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 53] float weight;
[ 54] vec4 ws, c;
[ 55] // scaler samples
[ 56] ws = _lut_4_4(vec2(0.00000000000000000000, fcoord));
[ 57] weight = ws[0];
[ 58] c = texture(_src_tex_0_4, base + pt * vec2(0.0));
[ 59] color[0] += weight * c[0];
[ 60] color[1] += weight * c[1];
[ 61] weight = ws[1];
[ 62] c = texture(_src_tex_0_4, base + pt * vec2(1.0));
[ 63] color[0] += weight * c[0];
[ 64] color[1] += weight * c[1];
[ 65] weight = ws[2];
[ 66] c = texture(_src_tex_0_4, base + pt * vec2(2.0));
[ 67] color[0] += weight * c[0];
[ 68] color[1] += weight * c[1];
[ 69] weight = ws[3];
[ 70] c = texture(_src_tex_0_4, base + pt * vec2(3.0));
[ 71] color[0] += weight * c[0];
[ 72] color[1] += weight * c[1];
[ 73] ws = _lut_4_4(vec2(1.00000000000000000000, fcoord));
[ 74] weight = ws[0];
[ 75] c = texture(_src_tex_0_4, base + pt * vec2(4.0));
[ 76] color[0] += weight * c[0];
[ 77] color[1] += weight * c[1];
[ 78] weight = ws[1];
[ 79] c = texture(_src_tex_0_4, base + pt * vec2(5.0));
[ 80] color[0] += weight * c[0];
[ 81] color[1] += weight * c[1];
[ 82] color *= vec4(_const_12_4);
[ 83] color.a = 1.0;
[ 84] }
[ 85] return color;
[ 86] }
[ 87]
[ 88] #define _lut_6_2(pos) (texelFetch(_weights_7_2, ivec2(pos), 0).x)
[ 89] vec4 _main_11_2() {
[ 90] vec4 color = vec4(0.0, 0.5, 0.5, 1.0);
[ 91] // pass_read_image
[ 92] {
[ 93] vec4 tmp;
[ 94] tmp = _sub_0_2();
[ 95] color[0] = tmp[0];
[ 96] tmp = _sub_1_2();
[ 97] color[1] = tmp[0];
[ 98] color[2] = tmp[1];
[ 99] }
[100] // pl_shader_decode_color
[101] {
[102] color.rgb = _cmat_2_2 * color.rgb + _cmat_c_3_2;
[103] }
[104] // pl_shader_color_map
[105] {
[106] }
[107] // pl_shader_encode_color
[108] {
[109] color.rgb /= vec3(max(color.a, 1e-6));
[110] }
[111] color *= vec4(1.0 / _const_4_2);
[112] vec4 _orig_color_5_2 = color;
[113] color = vec4(0.0);
[114] color[0] = _orig_color_5_2[0];
[115] color[1] = _orig_color_5_2[1];
[116] color[2] = _orig_color_5_2[2];
[117] color[3] = _orig_color_5_2[3];
[118] // pl_shader_dither
[119] {
[120] float bias;
[121] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_8_2);
[122] bias = _lut_6_2(ivec2(pos * _const_9_2));
[123] color = vec4(1023.0) * color + vec4(bias);
[124] color = floor(color) * vec4(1.0 / 1023.0);
[125] }
[126] return color;
[127] }
[128]
[129] void main() {
[130] out_color = _main_11_2();
[131] }
Spent 1.059 ms translating SPIR-V
Spent 0.136 ms compiling shader
Spent 1.324 ms creating pipeline
Pass statistics: size 10608, SPIR-V: vert 2488 frag 10252 comp 0
Requested alpha compositing mode: VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
Requested surface transform: VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
Requested image count: 4 (min 2 max 3)
Requested image size: 1728x1051 (min 1x1 < cur 1728x1051 < max 16384x16384)
(Re)creating swapchain of size 1728x1051
vk Created 3 swapchain images with initial size (1728, 1051).
    using unknown object: anon (0x13e118e00)
Dropped frame with PTS 0.033
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x1081x0 texture with format rg16hf
Freeing slab of size 4147200
Allocating 4151040 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1081x0 texture with format rgba16hf
Allocating 16604160 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _const_2_3;
[ 10]     layout(offset=8) vec2 _tex_size_2_4;
[ 11]     layout(offset=16) vec2 _tex_pt_3_4;
[ 12]     layout(offset=24) float _const_7_4;
[ 13]     layout(offset=28) float _const_8_4;
[ 14]     layout(offset=32) float _const_10_4;
[ 15]     layout(offset=36) float _const_11_4;
[ 16]     layout(offset=40) float _const_12_4;
[ 17]     layout(offset=48) vec3 _cmat_c_3_2;
[ 18]     layout(offset=64) mat3 _cmat_2_2;
[ 19] };
[ 20] layout(binding=0) uniform  sampler2D _src_tex_0_3;
[ 21] layout(binding=1) uniform  sampler2D _src_tex_0_4;
[ 22] layout(binding=2) uniform  sampler2D _weights_5_4;
[ 23] layout(location=0) in vec2 _tex_coord_1_3_v;
[ 24] layout(location=0) out vec2 _tex_coord_1_3;
[ 25] layout(location=1) in vec2 _tex_coord_1_4_v;
[ 26] layout(location=1) out vec2 _tex_coord_1_4;
[ 27] layout(location=2) in vec2 _position_4_2_v;
[ 28] void main() {
[ 29] _tex_coord_1_3 = _tex_coord_1_3_v;
[ 30] _tex_coord_1_4 = _tex_coord_1_4_v;
[ 31] gl_Position = vec4(_position_4_2_v, 0.0, 1.0);
[ 32] }
Spent 1.601 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _const_2_3;
[ 10]     layout(offset=8) vec2 _tex_size_2_4;
[ 11]     layout(offset=16) vec2 _tex_pt_3_4;
[ 12]     layout(offset=24) float _const_7_4;
[ 13]     layout(offset=28) float _const_8_4;
[ 14]     layout(offset=32) float _const_10_4;
[ 15]     layout(offset=36) float _const_11_4;
[ 16]     layout(offset=40) float _const_12_4;
[ 17]     layout(offset=48) vec3 _cmat_c_3_2;
[ 18]     layout(offset=64) mat3 _cmat_2_2;
[ 19] };
[ 20] layout(binding=0) uniform  sampler2D _src_tex_0_3;
[ 21] layout(binding=1) uniform  sampler2D _src_tex_0_4;
[ 22] layout(binding=2) uniform  sampler2D _weights_5_4;
[ 23] layout(location=0) in vec2 _tex_coord_1_3;
[ 24] layout(location=1) in vec2 _tex_coord_1_4;
[ 25] layout(location=0)  out vec4 out_color;
[ 26]
[ 27] vec4 _sub_0_2() {
[ 28] // pl_shader_sample_direct
[ 29] vec4 color = vec4(_const_2_3) * texture(_src_tex_0_3, _tex_coord_1_3);
[ 30] return color;
[ 31] }
[ 32]
[ 33] #define _LUT_POS_6_4(x) mix(_const_7_4, _const_8_4, (x))
[ 34] #define _LUT_POS_9_4(x) mix(_const_10_4, _const_11_4, (x))
[ 35] #define _lut_4_4(pos) (texture(_weights_5_4, vec2(\
[ 36]     _LUT_POS_6_4(vec2(pos).x)\
[ 37]    ,_LUT_POS_9_4(vec2(pos).y)\
[ 38]   )).xyzw)
[ 39] vec4 _sub_1_2() {
[ 40] // pl_shader_sample_ortho
[ 41] vec4 color = vec4(0.0);
[ 42] {
[ 43] vec2 pos = _tex_coord_1_4, size = _tex_size_2_4, pt = _tex_pt_3_4;
[ 44] vec2 dir = vec2(1.0, 0.0);
[ 45] pt *= dir;
[ 46] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 47] float fcoord = dot(fcoord2, dir);
[ 48] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 49] float weight;
[ 50] vec4 ws, c;
[ 51] // scaler samples
[ 52] ws = _lut_4_4(vec2(0.00000000000000000000, fcoord));
[ 53] weight = ws[0];
[ 54] c = texture(_src_tex_0_4, base + pt * vec2(0.0));
[ 55] color[0] += weight * c[0];
[ 56] color[1] += weight * c[1];
[ 57] weight = ws[1];
[ 58] c = texture(_src_tex_0_4, base + pt * vec2(1.0));
[ 59] color[0] += weight * c[0];
[ 60] color[1] += weight * c[1];
[ 61] weight = ws[2];
[ 62] c = texture(_src_tex_0_4, base + pt * vec2(2.0));
[ 63] color[0] += weight * c[0];
[ 64] color[1] += weight * c[1];
[ 65] weight = ws[3];
[ 66] c = texture(_src_tex_0_4, base + pt * vec2(3.0));
[ 67] color[0] += weight * c[0];
[ 68] color[1] += weight * c[1];
[ 69] ws = _lut_4_4(vec2(1.00000000000000000000, fcoord));
[ 70] weight = ws[0];
[ 71] c = texture(_src_tex_0_4, base + pt * vec2(4.0));
[ 72] color[0] += weight * c[0];
[ 73] color[1] += weight * c[1];
[ 74] weight = ws[1];
[ 75] c = texture(_src_tex_0_4, base + pt * vec2(5.0));
[ 76] color[0] += weight * c[0];
[ 77] color[1] += weight * c[1];
[ 78] color *= vec4(_const_12_4);
[ 79] color.a = 1.0;
[ 80] }
[ 81] return color;
[ 82] }
[ 83]
[ 84] vec4 _main_5_2() {
[ 85] vec4 color = vec4(0.0, 0.5, 0.5, 1.0);
[ 86] // pass_read_image
[ 87] {
[ 88] vec4 tmp;
[ 89] tmp = _sub_0_2();
[ 90] color[0] = tmp[0];
[ 91] tmp = _sub_1_2();
[ 92] color[1] = tmp[0];
[ 93] color[2] = tmp[1];
[ 94] }
[ 95] // pl_shader_decode_color
[ 96] {
[ 97] color.rgb = _cmat_2_2 * color.rgb + _cmat_c_3_2;
[ 98] }
[ 99] // pl_shader_linearize
[100] color.rgb = max(color.rgb, 0.0);
[101] color.rgb = pow(color.rgb, vec3(1.0/78.84375000000000000000));
[102] color.rgb = max(color.rgb - vec3(0.83593750000000000000), 0.0)
[103]              / (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * color.rgb);
[104] color.rgb = pow(color.rgb, vec3(1.0/0.15930175781250000000));
[105] color.rgb *= vec3(49.26108374384236298501);
[106] return color;
[107] }
[108]
[109] void main() {
[110] out_color = _main_5_2();
[111] }
Spent 1.305 ms translating SPIR-V
Spent 0.160 ms compiling shader
Spent 1.588 ms creating pipeline
Pass statistics: size 9748, SPIR-V: vert 2268 frag 9872 comp 0
LUT cache invalidated, regenerating..
Allocating 2048 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x973x0 texture with format rgba16hf
Allocating 14945280 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_0;
[ 10]     layout(offset=8) vec2 _tex_pt_3_0;
[ 11]     layout(offset=16) float _const_7_0;
[ 12]     layout(offset=20) float _const_8_0;
[ 13]     layout(offset=24) float _const_10_0;
[ 14]     layout(offset=28) float _const_11_0;
[ 15]     layout(offset=32) float _const_12_0;
[ 16] };
[ 17] layout(binding=0) uniform  sampler2D _src_tex_0_0;
[ 18] layout(binding=1) uniform  sampler2D _weights_5_0;
[ 19] layout(location=0) in vec2 _tex_coord_1_0_v;
[ 20] layout(location=0) out vec2 _tex_coord_1_0;
[ 21] layout(location=1) in vec2 _position_13_0_v;
[ 22] void main() {
[ 23] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 24] gl_Position = vec4(_position_13_0_v, 0.0, 1.0);
[ 25] }
Spent 0.543 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_0;
[ 10]     layout(offset=8) vec2 _tex_pt_3_0;
[ 11]     layout(offset=16) float _const_7_0;
[ 12]     layout(offset=20) float _const_8_0;
[ 13]     layout(offset=24) float _const_10_0;
[ 14]     layout(offset=28) float _const_11_0;
[ 15]     layout(offset=32) float _const_12_0;
[ 16] };
[ 17] layout(binding=0) uniform  sampler2D _src_tex_0_0;
[ 18] layout(binding=1) uniform  sampler2D _weights_5_0;
[ 19] layout(location=0) in vec2 _tex_coord_1_0;
[ 20] layout(location=0)  out vec4 out_color;
[ 21]
[ 22] #define _LUT_POS_6_0(x) mix(_const_7_0, _const_8_0, (x))
[ 23] #define _LUT_POS_9_0(x) mix(_const_10_0, _const_11_0, (x))
[ 24] #define _lut_4_0(pos) (texture(_weights_5_0, vec2(\
[ 25]     _LUT_POS_6_0(vec2(pos).x)\
[ 26]    ,_LUT_POS_9_0(vec2(pos).y)\
[ 27]   )).xyzw)
[ 28] vec4 _main_14_0() {
[ 29] // pl_shader_sample_ortho
[ 30] vec4 color = vec4(0.0);
[ 31] {
[ 32] vec2 pos = _tex_coord_1_0, size = _tex_size_2_0, pt = _tex_pt_3_0;
[ 33] vec2 dir = vec2(0.0, 1.0);
[ 34] pt *= dir;
[ 35] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 36] float fcoord = dot(fcoord2, dir);
[ 37] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 38] float weight;
[ 39] vec4 ws, c;
[ 40] // scaler samples
[ 41] ws = _lut_4_0(vec2(0.00000000000000000000, fcoord));
[ 42] weight = ws[0];
[ 43] c = texture(_src_tex_0_0, base + pt * vec2(0.0));
[ 44] color[0] += weight * c[0];
[ 45] color[1] += weight * c[1];
[ 46] color[2] += weight * c[2];
[ 47] weight = ws[1];
[ 48] c = texture(_src_tex_0_0, base + pt * vec2(1.0));
[ 49] color[0] += weight * c[0];
[ 50] color[1] += weight * c[1];
[ 51] color[2] += weight * c[2];
[ 52] weight = ws[2];
[ 53] c = texture(_src_tex_0_0, base + pt * vec2(2.0));
[ 54] color[0] += weight * c[0];
[ 55] color[1] += weight * c[1];
[ 56] color[2] += weight * c[2];
[ 57] weight = ws[3];
[ 58] c = texture(_src_tex_0_0, base + pt * vec2(3.0));
[ 59] color[0] += weight * c[0];
[ 60] color[1] += weight * c[1];
[ 61] color[2] += weight * c[2];
[ 62] ws = _lut_4_0(vec2(1.00000000000000000000, fcoord));
[ 63] weight = ws[0];
[ 64] c = texture(_src_tex_0_0, base + pt * vec2(4.0));
[ 65] color[0] += weight * c[0];
[ 66] color[1] += weight * c[1];
[ 67] color[2] += weight * c[2];
[ 68] weight = ws[1];
[ 69] c = texture(_src_tex_0_0, base + pt * vec2(5.0));
[ 70] color[0] += weight * c[0];
[ 71] color[1] += weight * c[1];
[ 72] color[2] += weight * c[2];
[ 73] color *= vec4(_const_12_0);
[ 74] color.a = 1.0;
[ 75] }
[ 76] return color;
[ 77] }
[ 78]
[ 79] void main() {
[ 80] out_color = _main_14_0();
[ 81] }
Spent 0.927 ms translating SPIR-V
Spent 0.131 ms compiling shader
Spent 1.127 ms creating pipeline
Pass statistics: size 6871, SPIR-V: vert 1836 frag 7832 comp 0
LUT cache invalidated, regenerating..
Allocating 2048 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_5;
[ 10]     layout(offset=8) vec2 _tex_pt_3_5;
[ 11]     layout(offset=16) float _const_7_5;
[ 12]     layout(offset=20) float _const_8_5;
[ 13]     layout(offset=24) float _const_10_5;
[ 14]     layout(offset=28) float _const_11_5;
[ 15]     layout(offset=32) float _const_12_5;
[ 16]     layout(offset=36) float _const_13_5;
[ 17]     layout(offset=40) int _const_17_5;
[ 18]     layout(offset=44) float _const_18_5;
[ 19] };
[ 20] layout(binding=0) uniform  sampler2D _src_tex_0_5;
[ 21] layout(binding=1) uniform  sampler2D _weights_5_5;
[ 22] layout(binding=2) uniform  sampler2D _weights_16_5;
[ 23] layout(location=0) in vec2 _tex_coord_1_5_v;
[ 24] layout(location=0) out vec2 _tex_coord_1_5;
[ 25] layout(location=1) in vec2 _position_19_5_v;
[ 26] void main() {
[ 27] _tex_coord_1_5 = _tex_coord_1_5_v;
[ 28] gl_Position = vec4(_position_19_5_v, 0.0, 1.0);
[ 29] }
Spent 0.526 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_5;
[ 10]     layout(offset=8) vec2 _tex_pt_3_5;
[ 11]     layout(offset=16) float _const_7_5;
[ 12]     layout(offset=20) float _const_8_5;
[ 13]     layout(offset=24) float _const_10_5;
[ 14]     layout(offset=28) float _const_11_5;
[ 15]     layout(offset=32) float _const_12_5;
[ 16]     layout(offset=36) float _const_13_5;
[ 17]     layout(offset=40) int _const_17_5;
[ 18]     layout(offset=44) float _const_18_5;
[ 19] };
[ 20] layout(binding=0) uniform  sampler2D _src_tex_0_5;
[ 21] layout(binding=1) uniform  sampler2D _weights_5_5;
[ 22] layout(binding=2) uniform  sampler2D _weights_16_5;
[ 23] layout(location=0) in vec2 _tex_coord_1_5;
[ 24] layout(location=0)  out vec4 out_color;
[ 25]
[ 26] #define _LUT_POS_6_5(x) mix(_const_7_5, _const_8_5, (x))
[ 27] #define _LUT_POS_9_5(x) mix(_const_10_5, _const_11_5, (x))
[ 28] #define _lut_4_5(pos) (texture(_weights_5_5, vec2(\
[ 29]     _LUT_POS_6_5(vec2(pos).x)\
[ 30]    ,_LUT_POS_9_5(vec2(pos).y)\
[ 31]   )).xyzw)
[ 32] #define _lut_15_5(pos) (texelFetch(_weights_16_5, ivec2(pos), 0).x)
[ 33] vec4 _main_20_5() {
[ 34] // pl_shader_sample_ortho
[ 35] vec4 color = vec4(0.0);
[ 36] {
[ 37] vec2 pos = _tex_coord_1_5, size = _tex_size_2_5, pt = _tex_pt_3_5;
[ 38] vec2 dir = vec2(1.0, 0.0);
[ 39] pt *= dir;
[ 40] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 41] float fcoord = dot(fcoord2, dir);
[ 42] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 43] float weight;
[ 44] vec4 ws, c;
[ 45] // scaler samples
[ 46] ws = _lut_4_5(vec2(0.00000000000000000000, fcoord));
[ 47] weight = ws[0];
[ 48] c = texture(_src_tex_0_5, base + pt * vec2(0.0));
[ 49] color[0] += weight * c[0];
[ 50] color[1] += weight * c[1];
[ 51] color[2] += weight * c[2];
[ 52] weight = ws[1];
[ 53] c = texture(_src_tex_0_5, base + pt * vec2(1.0));
[ 54] color[0] += weight * c[0];
[ 55] color[1] += weight * c[1];
[ 56] color[2] += weight * c[2];
[ 57] weight = ws[2];
[ 58] c = texture(_src_tex_0_5, base + pt * vec2(2.0));
[ 59] color[0] += weight * c[0];
[ 60] color[1] += weight * c[1];
[ 61] color[2] += weight * c[2];
[ 62] weight = ws[3];
[ 63] c = texture(_src_tex_0_5, base + pt * vec2(3.0));
[ 64] color[0] += weight * c[0];
[ 65] color[1] += weight * c[1];
[ 66] color[2] += weight * c[2];
[ 67] ws = _lut_4_5(vec2(1.00000000000000000000, fcoord));
[ 68] weight = ws[0];
[ 69] c = texture(_src_tex_0_5, base + pt * vec2(4.0));
[ 70] color[0] += weight * c[0];
[ 71] color[1] += weight * c[1];
[ 72] color[2] += weight * c[2];
[ 73] weight = ws[1];
[ 74] c = texture(_src_tex_0_5, base + pt * vec2(5.0));
[ 75] color[0] += weight * c[0];
[ 76] color[1] += weight * c[1];
[ 77] color[2] += weight * c[2];
[ 78] color *= vec4(_const_12_5);
[ 79] color.a = 1.0;
[ 80] }
[ 81] // pl_shader_color_map
[ 82] {
[ 83] // pl_shader_delinearize
[ 84] color.rgb = max(color.rgb, 0.0);
[ 85] color.rgb *= vec3(1.0/49.26108374384236298501);
[ 86] color.rgb = pow(color.rgb, vec3(0.15930175781250000000));
[ 87] color.rgb = (vec3(0.83593750000000000000) + vec3(18.85156250000000000000) * color.rgb)
[ 88]              / (vec3(1.0) + vec3(18.68750000000000000000) * color.rgb);
[ 89] color.rgb = pow(color.rgb, vec3(78.84375000000000000000));
[ 90] }
[ 91] // pl_shader_encode_color
[ 92] {
[ 93] color.rgb /= vec3(max(color.a, 1e-6));
[ 94] }
[ 95] color *= vec4(1.0 / _const_13_5);
[ 96] vec4 _orig_color_14_5 = color;
[ 97] color = vec4(0.0);
[ 98] color[0] = _orig_color_14_5[0];
[ 99] color[1] = _orig_color_14_5[1];
[100] color[2] = _orig_color_14_5[2];
[101] color[3] = _orig_color_14_5[3];
[102] // pl_shader_dither
[103] {
[104] float bias;
[105] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_17_5);
[106] bias = _lut_15_5(ivec2(pos * _const_18_5));
[107] color = vec4(1023.0) * color + vec4(bias);
[108] color = floor(color) * vec4(1.0 / 1023.0);
[109] }
[110] return color;
[111] }
[112]
[113] void main() {
[114] out_color = _main_20_5();
[115] }
Spent 1.167 ms translating SPIR-V
Spent 0.184 ms compiling shader
Spent 1.581 ms creating pipeline
Pass statistics: size 9399, SPIR-V: vert 2052 frag 11360 comp 0
Dropped frame with PTS 0.067
Dropped frame with PTS 0.100
Dropped frame with PTS 0.133
Dropped frame with PTS 0.167
Allocating 268435456 memory of type 0xf (id 1) in heap 0
Allocating 268435456 memory of type 0xf (id 1) in heap 0
(Re)creating 1728x973x0 texture with format rgba16hf
Allocating 13450752 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x1080x0 texture with format rg16hf
Freeing slab of size 4151040
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format rgba16hf
Freeing slab of size 16604160
Allocating 16588800 memory of type 0x1 (id 0) in heap 0
Freeing slab of size 2048
Allocating 2048 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_5;
[ 10]     layout(offset=8) vec2 _tex_pt_3_5;
[ 11]     layout(offset=16) float _const_7_5;
[ 12]     layout(offset=20) float _const_8_5;
[ 13]     layout(offset=24) float _const_10_5;
[ 14]     layout(offset=28) float _const_11_5;
[ 15]     layout(offset=32) float _const_12_5;
[ 16] };
[ 17] layout(binding=0) uniform  sampler2D _src_tex_0_5;
[ 18] layout(binding=1) uniform  sampler2D _weights_5_5;
[ 19] layout(location=0) in vec2 _tex_coord_1_5_v;
[ 20] layout(location=0) out vec2 _tex_coord_1_5;
[ 21] layout(location=1) in vec2 _position_13_5_v;
[ 22] void main() {
[ 23] _tex_coord_1_5 = _tex_coord_1_5_v;
[ 24] gl_Position = vec4(_position_13_5_v, 0.0, 1.0);
[ 25] }
Spent 0.948 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) vec2 _tex_size_2_5;
[ 10]     layout(offset=8) vec2 _tex_pt_3_5;
[ 11]     layout(offset=16) float _const_7_5;
[ 12]     layout(offset=20) float _const_8_5;
[ 13]     layout(offset=24) float _const_10_5;
[ 14]     layout(offset=28) float _const_11_5;
[ 15]     layout(offset=32) float _const_12_5;
[ 16] };
[ 17] layout(binding=0) uniform  sampler2D _src_tex_0_5;
[ 18] layout(binding=1) uniform  sampler2D _weights_5_5;
[ 19] layout(location=0) in vec2 _tex_coord_1_5;
[ 20] layout(location=0)  out vec4 out_color;
[ 21]
[ 22] #define _LUT_POS_6_5(x) mix(_const_7_5, _const_8_5, (x))
[ 23] #define _LUT_POS_9_5(x) mix(_const_10_5, _const_11_5, (x))
[ 24] #define _lut_4_5(pos) (texture(_weights_5_5, vec2(\
[ 25]     _LUT_POS_6_5(vec2(pos).x)\
[ 26]    ,_LUT_POS_9_5(vec2(pos).y)\
[ 27]   )).xyzw)
[ 28] vec4 _main_14_5() {
[ 29] // pl_shader_sample_ortho
[ 30] vec4 color = vec4(0.0);
[ 31] {
[ 32] vec2 pos = _tex_coord_1_5, size = _tex_size_2_5, pt = _tex_pt_3_5;
[ 33] vec2 dir = vec2(1.0, 0.0);
[ 34] pt *= dir;
[ 35] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 36] float fcoord = dot(fcoord2, dir);
[ 37] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 38] float weight;
[ 39] vec4 ws, c;
[ 40] // scaler samples
[ 41] ws = _lut_4_5(vec2(0.00000000000000000000, fcoord));
[ 42] weight = ws[0];
[ 43] c = texture(_src_tex_0_5, base + pt * vec2(0.0));
[ 44] color[0] += weight * c[0];
[ 45] color[1] += weight * c[1];
[ 46] color[2] += weight * c[2];
[ 47] weight = ws[1];
[ 48] c = texture(_src_tex_0_5, base + pt * vec2(1.0));
[ 49] color[0] += weight * c[0];
[ 50] color[1] += weight * c[1];
[ 51] color[2] += weight * c[2];
[ 52] weight = ws[2];
[ 53] c = texture(_src_tex_0_5, base + pt * vec2(2.0));
[ 54] color[0] += weight * c[0];
[ 55] color[1] += weight * c[1];
[ 56] color[2] += weight * c[2];
[ 57] weight = ws[3];
[ 58] c = texture(_src_tex_0_5, base + pt * vec2(3.0));
[ 59] color[0] += weight * c[0];
[ 60] color[1] += weight * c[1];
[ 61] color[2] += weight * c[2];
[ 62] ws = _lut_4_5(vec2(1.00000000000000000000, fcoord));
[ 63] weight = ws[0];
[ 64] c = texture(_src_tex_0_5, base + pt * vec2(4.0));
[ 65] color[0] += weight * c[0];
[ 66] color[1] += weight * c[1];
[ 67] color[2] += weight * c[2];
[ 68] weight = ws[1];
[ 69] c = texture(_src_tex_0_5, base + pt * vec2(5.0));
[ 70] color[0] += weight * c[0];
[ 71] color[1] += weight * c[1];
[ 72] color[2] += weight * c[2];
[ 73] color *= vec4(_const_12_5);
[ 74] color.a = 1.0;
[ 75] }
[ 76] return color;
[ 77] }
[ 78]
[ 79] void main() {
[ 80] out_color = _main_14_5();
[ 81] }
Spent 3.361 ms translating SPIR-V
Spent 0.240 ms compiling shader
Spent 2.248 ms creating pipeline
Pass statistics: size 6871, SPIR-V: vert 1836 frag 7832 comp 0
(Re)creating 1728x973x0 texture with format rgba16hf
Allocating 13450752 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _weight_2_0;
[ 10]     layout(offset=4) float _weight_5_0;
[ 11]     layout(offset=8) float _const_6_0;
[ 12]     layout(offset=12) int _const_10_0;
[ 13]     layout(offset=16) float _const_11_0;
[ 14] };
[ 15] layout(binding=0) uniform  sampler2D _frame_0_0;
[ 16] layout(binding=1) uniform  sampler2D _frame_3_0;
[ 17] layout(binding=2) uniform  sampler2D _weights_9_0;
[ 18] layout(location=0) in vec2 _tex_coord_1_0_v;
[ 19] layout(location=0) out vec2 _tex_coord_1_0;
[ 20] layout(location=1) in vec2 _tex_coord_4_0_v;
[ 21] layout(location=1) out vec2 _tex_coord_4_0;
[ 22] layout(location=2) in vec2 _position_12_0_v;
[ 23] void main() {
[ 24] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 25] _tex_coord_4_0 = _tex_coord_4_0_v;
[ 26] gl_Position = vec4(_position_12_0_v, 0.0, 1.0);
[ 27] }
Spent 1.129 ms translating SPIR-V
fragment shader source:
[  1] #version 450
[  2] #extension GL_KHR_shader_subgroup_basic : enable
[  3] #extension GL_KHR_shader_subgroup_vote : enable
[  4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[  5] #extension GL_KHR_shader_subgroup_ballot : enable
[  6] #extension GL_KHR_shader_subgroup_shuffle : enable
[  7] #extension GL_ARB_texture_gather : enable
[  8] layout(std430, push_constant) uniform PushC {
[  9]     layout(offset=0) float _weight_2_0;
[ 10]     layout(offset=4) float _weight_5_0;
[ 11]     layout(offset=8) float _const_6_0;
[ 12]     layout(offset=12) int _const_10_0;
[ 13]     layout(offset=16) float _const_11_0;
[ 14] };
[ 15] layout(binding=0) uniform  sampler2D _frame_0_0;
[ 16] layout(binding=1) uniform  sampler2D _frame_3_0;
[ 17] layout(binding=2) uniform  sampler2D _weights_9_0;
[ 18] layout(location=0) in vec2 _tex_coord_1_0;
[ 19] layout(location=1) in vec2 _tex_coord_4_0;
[ 20] layout(location=0)  out vec4 out_color;
[ 21]
[ 22] #define _lut_8_0(pos) (texelFetch(_weights_9_0, ivec2(pos), 0).x)
[ 23] vec4 _main_13_0() {
[ 24] vec4 color;
[ 25] // pl_render_image_mix
[ 26] {
[ 27] vec4 mix_color = vec4(0.0);
[ 28] color = texture(_frame_0_0, _tex_coord_1_0);
[ 29] // pl_shader_color_map
[ 30] {
[ 31] }
[ 32] mix_color += _weight_2_0 * color;
[ 33] color = texture(_frame_3_0, _tex_coord_4_0);
[ 34] // pl_shader_color_map
[ 35] {
[ 36] }
[ 37] mix_color += _weight_5_0 * color;
[ 38] color = mix_color;
[ 39] }
[ 40] // pl_shader_color_map
[ 41] {
[ 42] // pl_shader_delinearize
[ 43] color.rgb = max(color.rgb, 0.0);
[ 44] color.rgb *= vec3(1.0/49.26108374384236298501);
[ 45] color.rgb = pow(color.rgb, vec3(0.15930175781250000000));
[ 46] color.rgb = (vec3(0.83593750000000000000) + vec3(18.85156250000000000000) * color.rgb)
[ 47]              / (vec3(1.0) + vec3(18.68750000000000000000) * color.rgb);
[ 48] color.rgb = pow(color.rgb, vec3(78.84375000000000000000));
[ 49] }
[ 50] // pl_shader_encode_color
[ 51] {
[ 52] color.rgb /= vec3(max(color.a, 1e-6));
[ 53] }
[ 54] color *= vec4(1.0 / _const_6_0);
[ 55] vec4 _orig_color_7_0 = color;
[ 56] color = vec4(0.0);
[ 57] color[0] = _orig_color_7_0[0];
[ 58] color[1] = _orig_color_7_0[1];
[ 59] color[2] = _orig_color_7_0[2];
[ 60] color[3] = _orig_color_7_0[3];
[ 61] // pl_shader_dither
[ 62] {
[ 63] float bias;
[ 64] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_10_0);
[ 65] bias = _lut_8_0(ivec2(pos * _const_11_0));
[ 66] color = vec4(1023.0) * color + vec4(bias);
[ 67] color = floor(color) * vec4(1.0 / 1023.0);
[ 68] }
[ 69] return color;
[ 70] }
[ 71]
[ 72] void main() {
[ 73] out_color = _main_13_0();
[ 74] }
Spent 1.743 ms translating SPIR-V
Spent 0.096 ms compiling shader
Spent 1.999 ms creating pipeline
Pass statistics: size 7703, SPIR-V: vert 1952 frag 5384 comp 0
(Re)creating 1728x973x0 texture with format rgba16hf
Allocating 13450752 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x1081x0 texture with format rg16hf
Allocating 4151040 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1081x0 texture with format rgba16hf
Allocating 16604160 memory of type 0x1 (id 0) in heap 0
Allocating 2048 memory of type 0x1 (id 0) in heap 0
Freeing slab of size 4147200
Freeing slab of size 16588800
Freeing slab of size 2048
Dropped frame with PTS 1.583
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x540x0 texture with format r16
Allocating 1036800 memory of type 0x1 (id 0) in heap 0
(Re)creating 960x1080x0 texture with format rg16hf
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format rgba16hf
Allocating 16588800 memory of type 0x1 (id 0) in heap 0
Allocating 2048 memory of type 0x1 (id 0) in heap 0
(Re)creating 1728x973x0 texture with format rgba16hf
Allocating 13450752 memory of type 0x1 (id 0) in heap 0
Freeing slab of size 4151040
Estimated source FPS: 59.925, display FPS: 17.590
Freeing slab of size 16604160
Freeing slab of size 2048
Exiting...
Received frame after EOF signaled... discarding frame!
Dropped frame with PTS 2.417
Received frame after EOF signaled... discarding frame!
Dropped frame with PTS 2.433
Freeing slab of size 4147200
Freeing slab of size 1036800
Freeing slab of size 1036800
Freeing slab of size 4147200
Freeing slab of size 1036800
Freeing slab of size 1036800
Dropped frame with PTS 2.383
Freeing slab of size 4147200
Freeing slab of size 1036800
Freeing slab of size 1036800
Dropped frame with PTS 2.400
Freeing slab of size 4147200
Freeing slab of size 1036800
Freeing slab of size 1036800
Freeing slab of size 2073600
Freeing slab of size 4147200
Freeing slab of size 16588800
Freeing slab of size 14945280
Freeing slab of size 13450752
Freeing slab of size 13450752
Freeing slab of size 2048
Freeing slab of size 2048
Freeing slab of size 2048
Freeing slab of size 2048
Freeing slab of size 13450752
Freeing slab of size 13450752
Freeing slab of size 16384
Freeing slab of size 25067520
Freeing slab of size 100270080
Freeing slab of size 268435456
Freeing slab of size 268435456
Freeing slab of size 1048576
Freeing slab of size 1048576
Flushing remaining commands...
vk Unloading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
    using unknown object: anon (0x13c88f200)
@haasn
Copy link
Owner

haasn commented Nov 18, 2021

Hi, not sure if you saw, but this MR already introduces support for the portability extension. Is that a hard requirement these days? I can try rebasing it on master and merging it. (Also note that master does not use VkEvent at all)

The fact that it's still a beta extension is icky. I don't know why they can't get around to making it stable if they already require it for release versions of MoltenVK...

Edit: I rebased it onto current master.

@CarterLi
Copy link
Contributor Author

Hi, not sure if you saw, but this MR already introduces support for the portability extension. Is that a hard requirement these days? I can try rebasing it on master and merging it. (Also note that master does not use VkEvent at all)

The fact that it's still a beta extension is icky. I don't know why they can't get around to making it stable if they already require it for release versions of MoltenVK...

Edit: I rebased it onto current master.

No I didnt check the PR list on gitlab, but I am glad to see that.

What about removing the volkan version requirement, at least for macos?

What about the graphic issue?

@CarterLi
Copy link
Contributor Author

Notice that opengl mode failed too in my first try

pl_gpu_create_gl: OpenGL error: GL_INVALID_ENUM

Any ideas?

@haasn
Copy link
Owner

haasn commented Nov 18, 2021

What about removing the volkan version requirement, at least for macos?

I could do this. I'm not sure it serves a real purpose anyway, since vulkan 1.1 is ancient.

@haasn
Copy link
Owner

haasn commented Nov 18, 2021

@CarterLi I updated the MR to drop the vulkan requirement. Can you test if you still get the graphical corruption with that branch? Also, can you test with a more familiar/recognizable source file? (I'm not sure what it's supposed to look like)

Finally, can you compile with nuklear and show me the configuration of the UI? (In particular, is it picking a transparent background color? What happens if you change it?)

Any ideas?

Nope. Something like an apitrace log would probably be more useful here. Or you can try sprinkling that gl_check_err call throughout that function, e.g.:

    if (!gl_check_err(gpu, "pl_gpu_create_gl: 1")) goto error;

Replacing 1 by a bunch of different numbers. That should help narrow down which exact GL call triggers the error.

@CarterLi
Copy link
Contributor Author

@CarterLi I updated the MR to drop the vulkan requirement. Can you test if you still get the graphical corruption with that branch? Also, can you test with a more familiar/recognizable source file? (I'm not sure what it's supposed to look like)

Finally, can you compile with nuklear and show me the configuration of the UI? (In particular, is it picking a transparent background color? What happens if you change it?)

Any ideas?

Nope. Something like an apitrace log would probably be more useful here. Or you can try sprinkling that gl_check_err call throughout that function, e.g.:

    if (!gl_check_err(gpu, "pl_gpu_create_gl: 1")) goto error;

Replacing 1 by a bunch of different numbers. That should help narrow down which exact GL call triggers the error.

Thanks for your quick reply, but I have to test it tomorrow ( in my timezone )

@CarterLi
Copy link
Contributor Author

Some other projects such as ppsspp do use moltenvk on macOS but they dont have such issues

Strange

@CarterLi
Copy link
Contributor Author

image

Can you test if you still get the graphical corruption with that branch?

The graphic is still corrupted

Also, can you test with a more familiar/recognizable source file?

The source file can be found here: iina/iina#3539 (comment)

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 19, 2021

plplay crashed when I was trying to resize the window

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               plplay [6865]
Path:                  /Users/USER/*/plplay
Identifier:            plplay
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        fish [700]
Responsible:           iTerm2 [696]
User ID:               501

Date/Time:             2021-11-19 10:10:16.4193 +0800
OS Version:            macOS 12.0.1 (21A559)
Report Version:        12
Anonymous UUID:        6B003244-78E0-07F2-4173-072C2FD1A758


Time Awake Since Boot: 2000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000554feafa0440
Exception Codes:       0x0000000000000001, 0x0000554feafa0440
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [6865]

VM Region Info: 0x554feafa0440 is not in any region.  Bytes after previous region: 93320696693825  Bytes before following region: 11751383235520
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)        1000000000-7000000000   [384.0G] ---/--- SM=NUL  ...(unallocated)
--->  GAP OF 0x5f9000000000 BYTES
      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-/rwx SM=PRV  

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	       0x1ab76e750 objc_release + 16
1   libobjc.A.dylib               	       0x1ab77347c AutoreleasePoolPage::releaseUntil(objc_object**) + 200
2   libobjc.A.dylib               	       0x1ab76fe18 objc_autoreleasePoolPop + 208
3   CoreFoundation                	       0x1ab969f58 _CFAutoreleasePoolPop + 32
4   Foundation                    	       0x1ac85535c -[NSAutoreleasePool drain] + 140
5   AppKit                        	       0x1ae87ddd4 -[NSWindow(NSWindowResizing) _resizeWithEvent:] + 2004
6   AppKit                        	       0x1ae7711fc -[NSTitledFrame attemptResizeWithEvent:] + 204
7   AppKit                        	       0x1ae770f3c -[NSThemeFrame handleMouseDown:] + 288
8   AppKit                        	       0x1ae7fca68 -[NSThemeFrame mouseDown:] + 40
9   AppKit                        	       0x1ae6fd7d8 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4524
10  AppKit                        	       0x1ae670c78 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2444
11  AppKit                        	       0x1ae670080 -[NSWindow(NSEventRouting) sendEvent:] + 348
12  AppKit                        	       0x1ae66efe4 -[NSApplication(NSEvent) sendEvent:] + 2776
13  libglfw.3.3.dylib             	       0x104e000c4 _glfwPlatformPollEvents + 176
14  plplay                        	       0x104c1fb40 glfw_poll + 48 (window_glfw.c:373)
15  plplay                        	       0x104c1f3d8 window_poll + 56 (window.c:52)
16  plplay                        	       0x104c19844 render_loop + 880 (plplay.c:453)
17  plplay                        	       0x104c187f0 main + 1664 (plplay.c:612)
18  dyld                          	       0x104eb10f4 start + 520

Thread 1:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 4:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	       0x1ab8a5954 mach_msg_trap + 8
1   libsystem_kernel.dylib        	       0x1ab8a5d00 mach_msg + 76
2   CoreFoundation                	       0x1ab9ace38 __CFRunLoopServiceMachPort + 372
3   CoreFoundation                	       0x1ab9ab2f0 __CFRunLoopRun + 1212
4   CoreFoundation                	       0x1ab9aa694 CFRunLoopRunSpecific + 600
5   AppKit                        	       0x1ae66cc24 _NSEventThread + 196
6   libsystem_pthread.dylib       	       0x1ab8e14ec _pthread_start + 148
7   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 5:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 6:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 7:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 8:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 9:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 10:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 11:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 12:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 13:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 14:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libavcodec.58.134.100.dylib   	       0x1069fb9e4 0x106638000 + 3946980
3   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 15:
0   libsystem_kernel.dylib        	       0x1ab8a90c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1ab8e1ab4 _pthread_cond_wait + 1228
2   libplacebo.178.dylib          	       0x105665258 pl_cond_timedwait + 48 (pl_thread_pthread.h:91)
3   libplacebo.178.dylib          	       0x105665108 pl_queue_push_block + 136 (frame_queue.c:311)
4   plplay                        	       0x104c193f8 decode_loop + 628 (plplay.c:280)
5   libsystem_pthread.dylib       	       0x1ab8e14ec _pthread_start + 148
6   libsystem_pthread.dylib       	       0x1ab8dc2d0 thread_start + 8

Thread 16:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 17:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 18:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 19:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 20:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0

Thread 21:
0   libsystem_pthread.dylib       	       0x1ab8dc2bc start_wqthread + 0


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000600002610420   x1: 0x0000600002480fc0   x2: 0x0000000000000000   x3: 0x00000001ab6f623c
    x4: 0x0000000000000000   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x00006000024839c0
    x8: 0x0000554feafa0420   x9: 0x0000554feafa0420  x10: 0x0000000142011788  x11: 0x0000000000000001
   x12: 0x00000000000000fd  x13: 0x0000000080f7939d  x14: 0x0000000081179800  x15: 0x0000000000179800
   x16: 0x00000001ab76e740  x17: 0x0000000205cc10f0  x18: 0x000000013812b940  x19: 0x0000000142011000
   x20: 0x00000001420113f8  x21: 0x0000600002610420  x22: 0x00000000a1a1a1a1  x23: 0x0000000104f1c660
   x24: 0xa3a3a3a3a3a3a3a3  x25: 0x0000000000000001  x26: 0x0000000000000009  x27: 0x000060000138ba80
   x28: 0x00000001f5b82426   fp: 0x000000016b162c60   lr: 0x00000001ab77347c
    sp: 0x000000016b162c20   pc: 0x00000001ab76e750 cpsr: 0x20000000
   far: 0x0000554feafa0440  esr: 0x92000005 (Data Abort) byte read Translation fault

Binary Images:
       0x1ab766000 -        0x1ab7a1fff libobjc.A.dylib (*) <2eabed7f-1e81-3a1b-bb4b-985b8dd3b77f> /usr/lib/libobjc.A.dylib
       0x1ab928000 -        0x1abe6bfff com.apple.CoreFoundation (6.9) <b2ff96d0-ae99-31ef-9014-fc9964b4f3e0> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1ac81f000 -        0x1acc0cfff com.apple.Foundation (6.9) <de039f1b-ffe5-3644-a8cf-7ba52c32cd73> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
       0x1ae4be000 -        0x1af36ffff com.apple.AppKit (6.9) <518f4e68-c324-320f-9d7f-85c224eae972> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
       0x104df0000 -        0x104e13fff libglfw.3.3.dylib (*) <d5637568-69ea-3ee7-b452-5ad48c720ed6> /opt/homebrew/*/libglfw.3.3.dylib
       0x104c14000 -        0x104c67fff plplay (*) <5d3a0951-e3c4-36da-a59a-efc79abdfd73> /Users/USER/*/plplay
       0x104eac000 -        0x104f0bfff dyld (*) <86a8ba48-8bb4-3b30-9cda-051f73c74f44> /usr/lib/dyld
       0x1ab8da000 -        0x1ab8e6fff libsystem_pthread.dylib (*) <4786e19a-9312-38e6-80ef-9c1394548118> /usr/lib/system/libsystem_pthread.dylib
       0x1ab8a4000 -        0x1ab8d9fff libsystem_kernel.dylib (*) <c8524c02-b14f-30bd-a228-c44b4a448e68> /usr/lib/system/libsystem_kernel.dylib
       0x106638000 -        0x106eebfff libavcodec.58.134.100.dylib (*) <5beef38a-0514-3bc5-b009-76197b27599e> /opt/homebrew/*/libavcodec.58.134.100.dylib
       0x105614000 -        0x105a8bfff libplacebo.178.dylib (*) <96d89eb8-921d-3197-a841-bfe52ac3b916> /Users/USER/*/libplacebo.178.dylib
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=904.0M resident=0K(0%) swapped_out_or_unallocated=904.0M(100%)
Writable regions: Total=1.7G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.7G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               512K        4 
Activity Tracing                   256K        1 
CG backing stores                 4992K        8 
CG image                            96K        5 
ColorSync                          512K       25 
CoreAnimation                      176K       10 
CoreGraphics                        32K        2 
CoreUI image data                 1120K        8 
Foundation                          16K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           325.3M       59 
MALLOC guard page                  192K       11 
MALLOC_MEDIUM (reserved)         952.0M        8         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.3M       22 
Stack                             19.1M       22 
VM_ALLOCATE                        272K       17 
__AUTH                            1938K      191 
__AUTH_CONST                      11.7M      351 
__DATA                            20.7M      394 
__DATA_CONST                      17.9M      414 
__DATA_DIRTY                       740K      122 
__FONT_DATA                          4K        1 
__LINKEDIT                       586.1M       65 
__OBJC_CONST                      1630K      159 
__OBJC_RO                         81.8M        1 
__OBJC_RW                         3088K        1 
__TEXT                           317.9M      430 
__UNICODE                          588K        1 
dyld private memory               1024K        1 
mapped file                      156.2M       23 
shared memory                      912K       16 
===========                     =======  ======= 
TOTAL                              2.9G     2375 
TOTAL, minus reserved VM space     1.6G     2375 



-----------
Full Report
-----------

{"app_name":"plplay","timestamp":"2021-11-19 10:10:19.00 +0800","app_version":"","slice_uuid":"5d3a0951-e3c4-36da-a59a-efc79abdfd73","build_version":"","platform":1,"share_with_app_devs":1,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.0.1 (21A559)","incident_id":"33571890-0744-4461-8B74-5382537F5297","name":"plplay"}
{
  "uptime" : 2000,
  "procLaunch" : "2021-11-19 10:10:10.3028 +0800",
  "procRole" : "Foreground",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro18,1",
  "procStartAbsTime" : 47908649743,
  "coalitionID" : 753,
  "osVersion" : {
    "train" : "macOS 12.0.1",
    "build" : "21A559",
    "releaseType" : "User"
  },
  "captureTime" : "2021-11-19 10:10:16.4193 +0800",
  "incident" : "33571890-0744-4461-8B74-5382537F5297",
  "bug_type" : "309",
  "pid" : 6865,
  "procExitAbsTime" : 48054282749,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "plplay",
  "procPath" : "\/Users\/USER\/*\/plplay",
  "parentProc" : "fish",
  "parentPid" : 700,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "6B003244-78E0-07F2-4173-072C2FD1A758",
  "responsiblePid" : 696,
  "responsibleProc" : "iTerm2",
  "sip" : "enabled",
  "vmRegionInfo" : "0x554feafa0440 is not in any region.  Bytes after previous region: 93320696693825  Bytes before following region: 11751383235520\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      commpage (reserved)        1000000000-7000000000   [384.0G] ---\/--- SM=NUL  ...(unallocated)\n--->  GAP OF 0x5f9000000000 BYTES\n      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-\/rwx SM=PRV  ",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x0000554feafa0440","rawCodes":[1,93801733030976],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000554feafa0440"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":6865},
  "vmregioninfo" : "0x554feafa0440 is not in any region.  Bytes after previous region: 93320696693825  Bytes before following region: 11751383235520\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      commpage (reserved)        1000000000-7000000000   [384.0G] ---\/--- SM=NUL  ...(unallocated)\n--->  GAP OF 0x5f9000000000 BYTES\n      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-\/rwx SM=PRV  ",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":40170,"threadState":{"x":[{"value":105553156178976},{"value":105553154543552},{"value":0},{"value":7171170876,"symbolLocation":0,"symbol":"nanov2_free_definite_size"},{"value":0},{"value":0},{"value":0},{"value":105553154554304},{"value":93801733030944},{"value":93801733030944},{"value":5402335112},{"value":1},{"value":253},{"value":2163708829},{"value":2165807104},{"value":1546240},{"value":7171663680,"symbolLocation":0,"symbol":"objc_release"},{"value":8687194352},{"value":5235718464},{"value":5402333184},{"value":5402334200},{"value":105553156178976},{"value":2711724449},{"value":4377921120,"symbolLocation":224,"symbol":"_main_thread"},{"value":11791448172606497699},{"value":1},{"value":9},{"value":105553136761472},{"value":8417453094,"objc-selector":"nextEventMatchingMask:untilDate:inMode:dequeue:"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":7171683452},"cpsr":{"value":536870912},"fp":{"value":6091582560},"sp":{"value":6091582496},"esr":{"value":2449473541,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":7171663696,"matchesCrashFrame":1},"far":{"value":93801733030976}},"queue":"com.apple.main-thread","frames":[{"imageOffset":34640,"symbol":"objc_release","symbolLocation":16,"imageIndex":0},{"imageOffset":54396,"symbol":"AutoreleasePoolPage::releaseUntil(objc_object**)","symbolLocation":200,"imageIndex":0},{"imageOffset":40472,"symbol":"objc_autoreleasePoolPop","symbolLocation":208,"imageIndex":0},{"imageOffset":270168,"symbol":"_CFAutoreleasePoolPop","symbolLocation":32,"imageIndex":1},{"imageOffset":222044,"symbol":"-[NSAutoreleasePool drain]","symbolLocation":140,"imageIndex":2},{"imageOffset":3931604,"symbol":"-[NSWindow(NSWindowResizing) _resizeWithEvent:]","symbolLocation":2004,"imageIndex":3},{"imageOffset":2830844,"symbol":"-[NSTitledFrame attemptResizeWithEvent:]","symbolLocation":204,"imageIndex":3},{"imageOffset":2830140,"symbol":"-[NSThemeFrame handleMouseDown:]","symbolLocation":288,"imageIndex":3},{"imageOffset":3402344,"symbol":"-[NSThemeFrame mouseDown:]","symbolLocation":40,"imageIndex":3},{"imageOffset":2357208,"symbol":"-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:]","symbolLocation":4524,"imageIndex":3},{"imageOffset":1780856,"symbol":"-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:]","symbolLocation":2444,"imageIndex":3},{"imageOffset":1777792,"symbol":"-[NSWindow(NSEventRouting) sendEvent:]","symbolLocation":348,"imageIndex":3},{"imageOffset":1773540,"symbol":"-[NSApplication(NSEvent) sendEvent:]","symbolLocation":2776,"imageIndex":3},{"imageOffset":65732,"symbol":"_glfwPlatformPollEvents","symbolLocation":176,"imageIndex":4},{"imageOffset":47936,"sourceLine":373,"sourceFile":"window_glfw.c","symbol":"glfw_poll","imageIndex":5,"symbolLocation":48},{"imageOffset":46040,"sourceLine":52,"sourceFile":"window.c","symbol":"window_poll","imageIndex":5,"symbolLocation":56},{"imageOffset":22596,"sourceLine":453,"sourceFile":"plplay.c","symbol":"render_loop","imageIndex":5,"symbolLocation":880},{"imageOffset":18416,"sourceLine":612,"sourceFile":"plplay.c","symbol":"main","imageIndex":5,"symbolLocation":1664},{"imageOffset":20724,"symbol":"start","symbolLocation":520,"imageIndex":6}]},{"id":40180,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40181,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40195,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40203,"name":"com.apple.NSEventThread","frames":[{"imageOffset":6484,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":7424,"symbol":"mach_msg","symbolLocation":76,"imageIndex":8},{"imageOffset":544312,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":1},{"imageOffset":537328,"symbol":"__CFRunLoopRun","symbolLocation":1212,"imageIndex":1},{"imageOffset":534164,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":1},{"imageOffset":1764388,"symbol":"_NSEventThread","symbolLocation":196,"imageIndex":3},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":7},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40211,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40212,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40213,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40214,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40215,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40216,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40217,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40218,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40219,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40220,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":3946980,"imageIndex":9},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40221,"frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":8},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":7},{"imageOffset":332376,"sourceLine":91,"sourceFile":"pl_thread_pthread.h","symbol":"pl_cond_timedwait","imageIndex":10,"symbolLocation":48},{"imageOffset":332040,"sourceLine":311,"sourceFile":"frame_queue.c","symbol":"pl_queue_push_block","imageIndex":10,"symbolLocation":136},{"imageOffset":21496,"sourceLine":280,"sourceFile":"plplay.c","symbol":"decode_loop","imageIndex":5,"symbolLocation":628},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":7},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":7}]},{"id":40249,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40250,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40271,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40272,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40273,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":40274,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7171629056,
    "size" : 245760,
    "uuid" : "2eabed7f-1e81-3a1b-bb4b-985b8dd3b77f",
    "path" : "\/usr\/lib\/libobjc.A.dylib",
    "name" : "libobjc.A.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7173472256,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 5521408,
    "uuid" : "b2ff96d0-ae99-31ef-9014-fc9964b4f3e0",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "1855.105"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7189164032,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.Foundation",
    "size" : 4120576,
    "uuid" : "de039f1b-ffe5-3644-a8cf-7ba52c32cd73",
    "path" : "\/System\/Library\/Frameworks\/Foundation.framework\/Versions\/C\/Foundation",
    "name" : "Foundation",
    "CFBundleVersion" : "1855.105"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7219175424,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.AppKit",
    "size" : 15409152,
    "uuid" : "518f4e68-c324-320f-9d7f-85c224eae972",
    "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit",
    "name" : "AppKit",
    "CFBundleVersion" : "2113"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4376690688,
    "size" : 147456,
    "uuid" : "d5637568-69ea-3ee7-b452-5ad48c720ed6",
    "path" : "\/opt\/homebrew\/*\/libglfw.3.3.dylib",
    "name" : "libglfw.3.3.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4374740992,
    "size" : 344064,
    "uuid" : "5d3a0951-e3c4-36da-a59a-efc79abdfd73",
    "path" : "\/Users\/USER\/*\/plplay",
    "name" : "plplay"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4377460736,
    "size" : 393216,
    "uuid" : "86a8ba48-8bb4-3b30-9cda-051f73c74f44",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7173152768,
    "size" : 53248,
    "uuid" : "4786e19a-9312-38e6-80ef-9c1394548118",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7172931584,
    "size" : 221184,
    "uuid" : "c8524c02-b14f-30bd-a228-c44b4a448e68",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4402151424,
    "size" : 9125888,
    "uuid" : "5beef38a-0514-3bc5-b009-76197b27599e",
    "path" : "\/opt\/homebrew\/*\/libavcodec.58.134.100.dylib",
    "name" : "libavcodec.58.134.100.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4385226752,
    "size" : 4685824,
    "uuid" : "96d89eb8-921d-3197-a841-bfe52ac3b916",
    "path" : "\/Users\/USER\/*\/libplacebo.178.dylib",
    "name" : "libplacebo.178.dylib"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 7169982464,
  "size" : 3072180224,
  "uuid" : "a6162d66-93e3-3251-93cc-b11f7c8c830e"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=904.0M resident=0K(0%) swapped_out_or_unallocated=904.0M(100%)\nWritable regions: Total=1.7G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.7G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nAccelerate framework               512K        4 \nActivity Tracing                   256K        1 \nCG backing stores                 4992K        8 \nCG image                            96K        5 \nColorSync                          512K       25 \nCoreAnimation                      176K       10 \nCoreGraphics                        32K        2 \nCoreUI image data                 1120K        8 \nFoundation                          16K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           325.3M       59 \nMALLOC guard page                  192K       11 \nMALLOC_MEDIUM (reserved)         952.0M        8         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                       56.3M       22 \nStack                             19.1M       22 \nVM_ALLOCATE                        272K       17 \n__AUTH                            1938K      191 \n__AUTH_CONST                      11.7M      351 \n__DATA                            20.7M      394 \n__DATA_CONST                      17.9M      414 \n__DATA_DIRTY                       740K      122 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       586.1M       65 \n__OBJC_CONST                      1630K      159 \n__OBJC_RO                         81.8M        1 \n__OBJC_RW                         3088K        1 \n__TEXT                           317.9M      430 \n__UNICODE                          588K        1 \ndyld private memory               1024K        1 \nmapped file                      156.2M       23 \nshared memory                      912K       16 \n===========                     =======  ======= \nTOTAL                              2.9G     2375 \nTOTAL, minus reserved VM space     1.6G     2375 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60da5e84ab0ca017dace9abf",
      "factorPackIds" : {

      },
      "deploymentId" : 240000008
    },
    {
      "rolloutId" : "607844aa04477260f58a8077",
      "factorPackIds" : {
        "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a"
      },
      "deploymentId" : 240000066
    },
    {
      "rolloutId" : "5ffde50ce2aacd000d47a95f",
      "factorPackIds" : {

      },
      "deploymentId" : 240000076
    },
    {
      "rolloutId" : "602ad4dac86151000cf27e46",
      "factorPackIds" : {
        "SIRI_DICTATION_ASSETS" : "6181ebb28763315b9604755e"
      },
      "deploymentId" : 240000271
    },
    {
      "rolloutId" : "5fc94383418129005b4e9ae0",
      "factorPackIds" : {

      },
      "deploymentId" : 240000162
    },
    {
      "rolloutId" : "601d9415f79519000ccd4b69",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "6194416dea7ed64a7812a429"
      },
      "deploymentId" : 240000322
    }
  ],
  "experiments" : [

  ]
}
}

Model: MacBookPro18,1, BootROM 7429.41.5, proc 10:8:2 processors, 16 GB, SMC 
Graphics: Apple M1 Pro, Apple M1 Pro, Built-In
Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online
Display: DELL P2421D, 2560 x 1440 (QHD/WQHD - Wide Quad High Definition), MirrorOff, Online
Memory Module: LPDDR5
AirPort: Wi-Fi, wl0: Sep 24 2021 15:49:44 version 20.10.853.23.8.7.106 FWID 01-78e271b2
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus
USB Device: USB3.0 Hub
USB Device: USB2.0 Hub
USB Device: Gaming Keyboard G610
USB Device: USB31Bus
USB Device: USB31Bus
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.

It didn't crash with sdl2 mode. I don't know if it was a glfw issue or plplay issue. It's constantly reproducible

@CarterLi
Copy link
Contributor Author

Nope. Something like an apitrace log would probably be more useful here. Or you can try sprinkling that gl_check_err call throughout that function, e.g.:

    if (!gl_check_err(gpu, "pl_gpu_create_gl: 1")) goto error;

Replacing 1 by a bunch of different numbers. That should help narrow down which exact GL call triggers the error.

Seems that this line is problematic

get(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &max_vectors);

@Robot-DaneelOlivaw
Copy link

It works fine on my end.

  • libplacebo version: 4.178.0
Build Configuration
The Meson build system
Version: 0.60.1
Source dir: /Users/R-DO/Developer/libplacebo
Build dir: /Users/R-DO/Developer/libplacebo/build
Build type: native build
Project name: libplacebo
Project version: 4.178.0
C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
C linker for the host machine: cc ld64 711
C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
C++ linker for the host machine: c++ ld64 711
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program git found: YES (/usr/bin/git)
Compiler for C supports arguments -Wincompatible-pointer-types: YES 
Compiler for C supports link arguments -Wl,--exclude-libs=ALL: NO 
Program python3 found: YES (/usr/local/opt/python@3.10/bin/python3.10)
Library m found: YES
Run-time dependency threads found: YES
Header <pthread.h> has symbol "pthread_condattr_setclock" with dependency threads: NO 
Found pkg-config: /usr/local/bin/pkg-config (0.29.2)
Run-time dependency vulkan found: YES
Found CMake: /usr/local/bin/cmake (3.21.4)
Run-time dependency epoxy found: NO (tried pkgconfig, framework and cmake)
Run-time dependency shaderc found: YES 2021.3.1
Run-time dependency spirv-cross-c-shared found: YES 0.48.0
Library version found: NO
Check usable header "d3d11_4.h" : NO 
Run-time dependency libunwind found: NO (tried pkgconfig, framework and cmake)
Message: Skipping `glslang` because `shaderc` is available
Run-time dependency lcms2 found: YES 2.12
Configuring config.h using configuration
Configuring config_internal.h using configuration
Run-time dependency glfw3 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency sdl2 found: YES 2.0.16
Run-time dependency sdl2_image found: YES 2.0.5
Dependency threads found: YES unknown (cached)
Run-time dependency libavcodec found: YES 58.134.100
Run-time dependency libavformat found: YES 58.76.100
Run-time dependency libavutil found: YES 56.70.100
Has header "nuklear.h" : YES 
Configuring config_demos.h using configuration
Build targets in project: 8

libplacebo 4.178.0

  User defined options
    backend        : ninja
    vulkan-registry: /Users/R-DO/VulkanSDK/1.2.189.0/macOS/share/vulkan/registry/vk.xml

Found ninja-1.10.2 at /usr/local/bin/ninja
  • macOS Version: 12.0.1 (intel)
  • Vulkan SDK: 1.2.189.0

screenshot

But sometimes it shows me this error:

error message
Opening file: '/Users/R-DO/2021 LG OLED l  Ink Art 4K HDR 60fps [WO2b03Zdu4Q].webm'
Format: matroska,webm
Duration: 45.461 s
Found video track (stream 0)
Resolution: 3840 x 2160
FPS: 60.000000
Bitrate: 0 kbps
Format: yuv420p10le
Initialized libplacebo v4.157.0-151-g93d05c4 (API v178)
Attempting to initialize API: SDL2 (vulkan)
Available instance version: 1.2.189
Available layers:
    VK_LAYER_LUNARG_api_dump (v1.2.189)
    VK_LAYER_KHRONOS_validation (v1.2.189)
    VK_LAYER_LUNARG_device_simulation (v1.2.189)
    VK_LAYER_KHRONOS_synchronization2 (v1.2.189)
Enabling debug meta layer: VK_LAYER_KHRONOS_validation
Available instance extensions:
    VK_KHR_device_group_creation
    VK_KHR_external_fence_capabilities
    VK_KHR_external_memory_capabilities
    VK_KHR_external_semaphore_capabilities
    VK_KHR_get_physical_device_properties2
    VK_KHR_get_surface_capabilities2
    VK_KHR_surface
    VK_EXT_debug_report
    VK_EXT_debug_utils
    VK_EXT_metal_surface
    VK_EXT_swapchain_colorspace
    VK_MVK_macos_surface
    VK_EXT_validation_features (via VK_LAYER_KHRONOS_validation)
Enabling debug report extension: VK_EXT_debug_utils
Creating vulkan instance with extensions:
    VK_KHR_get_physical_device_properties2
    VK_KHR_surface
    VK_EXT_swapchain_colorspace
    VK_KHR_external_memory_capabilities
    VK_KHR_external_semaphore_capabilities
    VK_KHR_surface
    VK_MVK_macos_surface
    VK_EXT_debug_utils
  and layers:
    VK_LAYER_KHRONOS_validation
Probing for vulkan devices:
    GPU 0: Intel(R) Iris(TM) Plus Graphics 650 (integrated)
           uuid: 00:00:80:86:00:00:59:27:00:00:00:01:00:00:05:20
Vulkan device properties:
    Device Name: Intel(R) Iris(TM) Plus Graphics 650
    Device ID: 8086:5927
    Device UUID: 00:00:80:86:00:00:59:27:00:00:00:01:00:00:05:20
    Driver version: 10105
    API version: 1.1.189
Queue families supported by device:
    0: flags 0x7 num 1
    1: flags 0x7 num 1
    2: flags 0x7 num 1
    3: flags 0x7 num 1
Using graphics queue 0
Available device extensions:
    VK_KHR_16bit_storage
    VK_KHR_8bit_storage
    VK_KHR_bind_memory2
    VK_KHR_create_renderpass2
    VK_KHR_dedicated_allocation
    VK_KHR_depth_stencil_resolve
    VK_KHR_descriptor_update_template
    VK_KHR_device_group
    VK_KHR_driver_properties
    VK_KHR_external_fence
    VK_KHR_external_memory
    VK_KHR_external_semaphore
    VK_KHR_get_memory_requirements2
    VK_KHR_imageless_framebuffer
    VK_KHR_image_format_list
    VK_KHR_maintenance1
    VK_KHR_maintenance2
    VK_KHR_maintenance3
    VK_KHR_multiview
    VK_KHR_portability_subset
    VK_KHR_push_descriptor
    VK_KHR_relaxed_block_layout
    VK_KHR_sampler_mirror_clamp_to_edge
    VK_KHR_sampler_ycbcr_conversion
    VK_KHR_shader_draw_parameters
    VK_KHR_shader_float16_int8
    VK_KHR_shader_subgroup_extended_types
    VK_KHR_storage_buffer_storage_class
    VK_KHR_swapchain
    VK_KHR_swapchain_mutable_format
    VK_KHR_timeline_semaphore
    VK_KHR_uniform_buffer_standard_layout
    VK_KHR_variable_pointers
    VK_EXT_debug_marker
    VK_EXT_descriptor_indexing
    VK_EXT_fragment_shader_interlock
    VK_EXT_hdr_metadata
    VK_EXT_host_query_reset
    VK_EXT_image_robustness
    VK_EXT_inline_uniform_block
    VK_EXT_memory_budget
    VK_EXT_private_data
    VK_EXT_robustness2
    VK_EXT_scalar_block_layout
    VK_EXT_shader_stencil_export
    VK_EXT_shader_viewport_index_layer
    VK_EXT_subgroup_size_control
    VK_EXT_texel_buffer_alignment
    VK_EXT_vertex_attribute_divisor
    VK_AMD_gpu_shader_half_float
    VK_AMD_negative_viewport_height
    VK_AMD_shader_trinary_minmax
    VK_INTEL_shader_integer_functions2
    VK_GOOGLE_display_timing
    VK_NV_glsl_shader
Creating vulkan device with extensions:
    VK_KHR_swapchain
    VK_KHR_swapchain
    VK_KHR_push_descriptor
    VK_EXT_hdr_metadata
    VK_EXT_host_query_reset
    VK_KHR_image_format_list
    VK_KHR_timeline_semaphore
    VK_KHR_portability_subset
vk Loading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
    using VkInstance: anon (0x7fa32c072800)
vk Inserted device layer VK_LAYER_KHRONOS_validation (/usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib)
    using VkInstance: anon (0x7fa32c072800)
vk Using MTLEvent for Vulkan semaphores.
    using VkDevice: anon (0x7fa32c097218)
vk Created VkDevice to run on GPU Intel(R) Iris(TM) Plus Graphics 650 with the following 7 Vulkan extensions enabled:
		VK_KHR_image_format_list v1
		VK_KHR_portability_subset v1
		VK_KHR_push_descriptor v2
		VK_KHR_swapchain v70
		VK_KHR_timeline_semaphore v2
		VK_EXT_hdr_metadata v2
		VK_EXT_host_query_reset v1
    using VkDevice: anon (0x7fa32c097218)
Memory heaps supported by device:
    0: flags 0x1 size 8192M
Memory types supported by device:
    0: flags 0x1 heap 0
    1: flags 0xf heap 0
    2: flags 0xb heap 0
Memory summary:     0 used     0 res     0 alloc, efficiency 100.00%, utilization 100.00%
shaderc SPIR-V version 1.5 rev 4
Initialized SPIR-V compiler 'shaderc'
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not exportable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not importable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not exportable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not importable
Minimum texel alignment: 96
GPU information:
    GLSL version: 450 (vulkan)
      max_shmem_size:            65536
      max_group_threads:         1024
      max_group_size[0]:         1024
      max_group_size[1]:         1024
      max_group_size[2]:         1024
      subgroup_size:             32
      min_gather_offset:         -8
      max_gather_offset:         7
    Limits:
      thread_safe:               1
      callbacks:                 1
      max_buf_size:              18446744073709551615
      max_ubo_size:              65536
      max_ssbo_size:             2147483648
      max_vbo_size:              18446744073709551615
      max_mapped_size:           18446744073709551615
      max_buffer_texels:         67108864
      align_host_ptr:            0
      max_tex_1d_dim:            16384
      max_tex_2d_dim:            16384
      max_tex_3d_dim:            2048
      blittable_1d_3d:           1
      buf_transfer:              1
      align_tex_xfer_pitch:      1
      align_tex_xfer_offset:     256
      max_variables:             0
      max_constants:             18446744073709551615
      max_pushc_size:            4096
      align_vertex_stride:       4
      max_dispatch[0]:           1073741824
      max_dispatch[1]:           1073741824
      max_dispatch[2]:           1073741824
      fragment_queues:           1
      compute_queues:            1
GPU texture formats:
    NAME       TYPE   SIZE COMP CAPS         EMU DEPTH         HOST_BITS     GLSL_TYPE  GLSL_FMT   FOURCC
    r8         UNORM  1    R    SsLRbBVutHWG n   {8  0  0  0 } {8  0  0  0 } float      r8         R8    
    r8s        SNORM  1    R    SsLRbBVutHWG n   {8  0  0  0 } {8  0  0  0 } float      r8_snorm         
    rg8        UNORM  2    RG   SsLRbBVutHWG n   {8  8  0  0 } {8  8  0  0 } vec2       rg8        GR88  
    rg8s       SNORM  2    RG   SsLRbBVutHWG n   {8  8  0  0 } {8  8  0  0 } vec2       rg8_snorm        
    rgba8      UNORM  4    RGBA SsLRbBVutHWG n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8      AB24  
    rgba8s     SNORM  4    RGBA SsLRbBVutHWG n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8_snorm       
    bgra8      UNORM  4    BGRA SsLRbBVutHWG n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8      AR24  
    rgb10a2    UNORM  4    RGBA SsLRbBVutHWG n   {10 10 10 2 } {10 10 10 2 } vec4       rgb10_a2   AB30  
    r16        UNORM  2    R    SsLRbBVutHWG n   {16 0  0  0 } {16 0  0  0 } float      r16        R16   
    r16hf      FLOAT  2    R    SsLRbBVutHWG n   {16 0  0  0 } {16 0  0  0 } float      r16f             
    r16s       SNORM  2    R    SsLRbBVutHWG n   {16 0  0  0 } {16 0  0  0 } float      r16_snorm        
    rg16       UNORM  4    RG   SsLRbBVutHWG n   {16 16 0  0 } {16 16 0  0 } vec2       rg16       GR32  
    rg16hf     FLOAT  4    RG   SsLRbBVutHWG n   {16 16 0  0 } {16 16 0  0 } vec2       rg16f            
    rg16s      SNORM  4    RG   SsLRbBVutHWG n   {16 16 0  0 } {16 16 0  0 } vec2       rg16_snorm       
    rgba16     UNORM  8    RGBA SsLRbBVutHWG n   {16 16 16 16} {16 16 16 16} vec4       rgba16           
    rgba16hf   FLOAT  8    RGBA SsLRbBVutHWG n   {16 16 16 16} {16 16 16 16} vec4       rgba16f    AB4H  
    rgba16s    SNORM  8    RGBA SsLRbBVutHWG n   {16 16 16 16} {16 16 16 16} vec4       rgba16_snorm       
    r32f       FLOAT  4    R    SsLRbBVutHWG n   {32 0  0  0 } {32 0  0  0 } float      r32f             
    rg32f      FLOAT  8    RG   SsLRbBVutHWG n   {32 32 0  0 } {32 32 0  0 } vec2       rg32f            
    rgba32f    FLOAT  16   RGBA SsLRbBVutHWG n   {32 32 32 32} {32 32 32 32} vec4       rgba32f          
    r8i        SINT   1    R    Ss-R-BVutHWG n   {8  0  0  0 } {8  0  0  0 } int        r8i              
    r8u        UINT   1    R    Ss-R-BVutHWG n   {8  0  0  0 } {8  0  0  0 } uint       r8ui             
    rg8i       SINT   2    RG   Ss-R-BVutHWG n   {8  8  0  0 } {8  8  0  0 } ivec2      rg8i             
    rg8u       UINT   2    RG   Ss-R-BVutHWG n   {8  8  0  0 } {8  8  0  0 } uvec2      rg8ui            
    rgba8i     SINT   4    RGBA Ss-R-BVutHWG n   {8  8  8  8 } {8  8  8  8 } ivec4      rgba8i           
    rgba8u     UINT   4    RGBA Ss-R-BVutHWG n   {8  8  8  8 } {8  8  8  8 } uvec4      rgba8ui          
    r16i       SINT   2    R    Ss-R-BVutHWG n   {16 0  0  0 } {16 0  0  0 } int        r16i             
    r16u       UINT   2    R    Ss-R-BVutHWG n   {16 0  0  0 } {16 0  0  0 } uint       r16ui            
    rg16i      SINT   4    RG   Ss-R-BVutHWG n   {16 16 0  0 } {16 16 0  0 } ivec2      rg16i            
    rg16u      UINT   4    RG   Ss-R-BVutHWG n   {16 16 0  0 } {16 16 0  0 } uvec2      rg16ui           
    rgba16i    SINT   8    RGBA Ss-R-BVutHWG n   {16 16 16 16} {16 16 16 16} ivec4      rgba16i          
    rgba16u    UINT   8    RGBA Ss-R-BVutHWG n   {16 16 16 16} {16 16 16 16} uvec4      rgba16ui         
    r32i       SINT   4    R    Ss-R-BVutHWG n   {32 0  0  0 } {32 0  0  0 } int        r32i             
    r32u       UINT   4    R    Ss-R-BVutHWG n   {32 0  0  0 } {32 0  0  0 } uint       r32ui            
    rg32i      SINT   8    RG   Ss-R-BVutHWG n   {32 32 0  0 } {32 32 0  0 } ivec2      rg32i            
    rg32u      UINT   8    RG   Ss-R-BVutHWG n   {32 32 0  0 } {32 32 0  0 } uvec2      rg32ui           
    rgba32i    SINT   16   RGBA Ss-R-BVutHWG n   {32 32 32 32} {32 32 32 32} ivec4      rgba32i          
    rgba32u    UINT   16   RGBA Ss-R-BVutHWG n   {32 32 32 32} {32 32 32 32} uvec4      rgba32ui         
    rgb10a2u   UINT   4    RGBA Ss-R-B-utHWG n   {10 10 10 2 } {10 10 10 2 } uvec4      rgb10_a2ui       
    bgr10a2    UNORM  4    BGRA S-LRbB-u-H-G n   {10 10 10 2 } {10 10 10 2 } vec4                  AR30  
    rgb8i      SINT   3    RGB  ------V--H-- n   {8  8  8  0 } {8  8  8  0 } ivec3                       
    rgb8s      SNORM  3    RGB  ------V--H-- n   {8  8  8  0 } {8  8  8  0 } vec3                        
    rgb8u      UINT   3    RGB  ------V--H-- n   {8  8  8  0 } {8  8  8  0 } uvec3                       
    rgb10a2s   SNORM  4    RGBA ------V--H-- n   {10 10 10 2 } {10 10 10 2 } vec4                        
    rgb16hf    FLOAT  6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } vec3                        
    rgb16i     SINT   6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } ivec3                       
    rgb16s     SNORM  6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } vec3                        
    rgb16u     UINT   6    RGB  ------V--H-- n   {16 16 16 0 } {16 16 16 0 } uvec3                       
    rgb32f     FLOAT  12   RGB  ------V--H-- n   {32 32 32 0 } {32 32 32 0 } vec3                        
    rgb32i     SINT   12   RGB  ------V--H-- n   {32 32 32 0 } {32 32 32 0 } ivec3                       
    rgb32u     UINT   12   RGB  ------V--H-- n   {32 32 32 0 } {32 32 32 0 } uvec3                       
    a1rgb5     UNORM  2    ARGB ---------H-- n   {1  5  5  5 } {1  5  5  5 }                       BA15  
    a1bgr5     UNORM  2    ABGR ---------H-- n   {1  5  5  5 } {1  5  5  5 }                       RA15  
    gr4        UNORM  1    GR   ---------H-- n   {4  4  0  0 } {4  4  0  0 }                             
    argb4      UNORM  2    ARGB ---------H-- n   {4  4  4  4 } {4  4  4  4 }                       BA12  
    abgr4      UNORM  2    ABGR ---------H-- n   {4  4  4  4 } {4  4  4  4 }                       RA12  
    rgb565     UNORM  2    RGB  ---------H-- n   {5  6  5  0 } {5  6  5  0 }                       BG16  
    bgr5a1     UNORM  2    BGRA ---------H-- n   {5  5  5  1 } {5  5  5  1 }                       AR15  
    bgr565     UNORM  2    BGR  ---------H-- n   {5  6  5  0 } {5  6  5  0 }                       RG16  
    bgr8       UNORM  3    BGR  ---------H-- n   {8  8  8  0 } {8  8  8  0 }                       RG24  
    bgr8i      SINT   3    BGR  ---------H-- n   {8  8  8  0 } {8  8  8  0 }                             
    bgr8u      UINT   3    BGR  ---------H-- n   {8  8  8  0 } {8  8  8  0 }                             
    bgra8i     SINT   4    BGRA ---------H-- n   {8  8  8  8 } {8  8  8  8 }                             
    bgra8u     UINT   4    BGRA ---------H-- n   {8  8  8  8 } {8  8  8  8 }                             
    rgb10a2i   SINT   4    RGBA ---------H-- n   {10 10 10 2 } {10 10 10 2 }                             
    bgr10a2i   SINT   4    BGRA ---------H-- n   {10 10 10 2 } {10 10 10 2 }                             
    bgr10a2s   SNORM  4    BGRA ---------H-- n   {10 10 10 2 } {10 10 10 2 }                             
    bgr10a2u   UINT   4    BGRA ---------H-- n   {10 10 10 2 } {10 10 10 2 }                             
    r64i       SINT   8    R    ---------H-- n   {64 0  0  0 } {64 0  0  0 }                             
    r64u       UINT   8    R    ---------H-- n   {64 0  0  0 } {64 0  0  0 }                             
    rg64i      SINT   16   RG   ---------H-- n   {64 64 0  0 } {64 64 0  0 }                             
    rg64u      UINT   16   RG   ---------H-- n   {64 64 0  0 } {64 64 0  0 }                             
    rgb64i     SINT   24   RGB  ---------H-- n   {64 64 64 0 } {64 64 64 0 }                             
    rgb64u     UINT   24   RGB  ---------H-- n   {64 64 64 0 } {64 64 64 0 }                             
    rgba64i    SINT   32   RGBA ---------H-- n   {64 64 64 64} {64 64 64 64}                             
    rgba64u    UINT   32   RGBA ---------H-- n   {64 64 64 64} {64 64 64 64}                             
    rgb8       UNORM  3    RGB  SsLRbBV--HWG y   {8  8  8  0 } {8  8  8  0 } vec3       rgba8      BG24  
    rgb16      UNORM  6    RGB  SsLRbBV--HWG y   {16 16 16 0 } {16 16 16 0 } vec3       rgba16           
    r16f       FLOAT  4    R    SsLRbB---HWG y   {16 0  0  0 } {32 0  0  0 }            r16f             
    rg16f      FLOAT  8    RG   SsLRbB---HWG y   {16 16 0  0 } {32 32 0  0 }            rg16f            
    rgba16f    FLOAT  16   RGBA SsLRbB---HWG y   {16 16 16 16} {32 32 32 32}            rgba16f          
    rgb16f     FLOAT  12   RGB  ---------H-- y   {16 16 16 0 } {32 32 32 0 }                             
Available surface configurations:
    0: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    1: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    2: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    3: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    4: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
    5: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    6: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    7: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    8: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    9: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    10: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    11: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    12: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    13: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    14: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    15: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    16: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    17: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    18: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    19: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT709_NONLINEAR_EXT
    20: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    21: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    22: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    23: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    24: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    25: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_PASS_THROUGH_EXT
    26: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_PASS_THROUGH_EXT
    27: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_PASS_THROUGH_EXT
    28: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_PASS_THROUGH_EXT
    29: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_PASS_THROUGH_EXT
    30: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    31: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    32: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    33: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    34: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    35: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    36: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    37: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    38: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    39: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    40: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    41: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    42: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    43: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    44: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    45: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT2020_LINEAR_EXT
    46: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT2020_LINEAR_EXT
    47: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT2020_LINEAR_EXT
    48: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_BT2020_LINEAR_EXT
    49: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT2020_LINEAR_EXT
    50: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_HDR10_HLG_EXT
    51: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_HDR10_HLG_EXT
    52: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_HDR10_HLG_EXT
    53: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_HLG_EXT
    54: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_HLG_EXT
    55: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_HDR10_ST2084_EXT
    56: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_HDR10_ST2084_EXT
    57: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_HDR10_ST2084_EXT
    58: VK_FORMAT_A2B10G10R10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_ST2084_EXT
    59: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_ST2084_EXT
Picked surface configuration 28: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_PASS_THROUGH_EXT
Picked surface configuration 58: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_HDR10_ST2084_EXT
Requested alpha compositing mode: VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
Requested surface transform: VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
Requested image count: 4 (min 2 max 3)
Requested image size: 3840x2160 (min 1x1 < cur 1280x688 < max 16384x16384)
(Re)creating swapchain of size 3840x2160
vk Created 3 swapchain images with initial size (3840, 2160).
    using VkSwapchainKHR: anon (0x7fa32d019800)
Unsupported AVPixelFormat: yuv420p10le
Flushing remaining commands...
vk Unloading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
    using VkInstance: anon (0x7fa32c072800)

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

It didn't crash with sdl2 mode. I don't know if it was a glfw issue or plplay issue. It's constantly reproducible

Looks like a GLFW issue. Our usage of the GLFW API is not exactly complex. Simply calling glfwPollEvents should not segfault.

Seems that this line is problematic

Thanks, will fix.

haasn added a commit that referenced this issue Nov 19, 2021
@haasn
Copy link
Owner

haasn commented Nov 19, 2021

Thanks, will fix.

Pushed a fix for it. Wonder how far OpenGL gets for you now?

haasn added a commit that referenced this issue Nov 19, 2021
Prevents UB on pl_plane_find_fmt() when comparing the row stride against
the texel alignment.

cf. #111
@haasn
Copy link
Owner

haasn commented Nov 19, 2021

But sometimes it shows me this error:

Should be fixed as well.

@Robot-DaneelOlivaw
Copy link

But sometimes it shows me this error:

Should be fixed as well.

Not getting any error now. Thanks.

@CarterLi
Copy link
Contributor Author

Thanks, will fix.

Pushed a fix for it. Wonder how far OpenGL gets for you now?

$ build/demos/plplay -v ~/HDR.webm
Opening file: '/Users/carter/HDR.webm'
Format: matroska,webm
Duration: 45.433 s
Found video track (stream 0)
Resolution: 1920 x 1080
FPS: 60.000000
Bitrate: 0 kbps
Format: yuv420p10le
Initialized libplacebo v4.157.0-153-g89b11e2 (API v178)
Attempting to initialize API: SDL2 (opengl)
Detected OpenGL version strings:
    GL_VERSION:  2.1 Metal - 76.1
    GL_VENDOR:   Apple
    GL_RENDERER: Apple M1 Pro
    GL_EXTENSIONS: GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_SGI_color_matrix GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod
OpenGL debugging requested, but GL_KHR_debug is not available... ignoring!
    GL_SHADING_LANGUAGE_VERSION: 1.20
GPU information:
    GLSL version: 120
      subgroup_size:             0
      min_gather_offset:         0
      max_gather_offset:         0
    Limits:
      thread_safe:               1
      callbacks:                 1
      max_buf_size:              18446744073709551615
      max_ubo_size:              0
      max_ssbo_size:             0
      max_vbo_size:              18446744073709551615
      max_mapped_size:           0
      max_buffer_texels:         0
      align_host_ptr:            0
      max_tex_1d_dim:            16384
      max_tex_2d_dim:            16384
      max_tex_3d_dim:            2048
      blittable_1d_3d:           0
      buf_transfer:              1
      align_tex_xfer_pitch:      4
      align_tex_xfer_offset:     32
      max_variables:             64
      max_constants:             0
      max_pushc_size:            0
      align_vertex_stride:       1
      fragment_queues:           1
      compute_queues:            1
GPU texture formats:
    NAME       TYPE   SIZE COMP CAPS         EMU DEPTH         HOST_BITS     GLSL_TYPE  GLSL_FMT   FOURCC
    r8         UNORM  1    R    S-LRbBV--H-- n   {8  0  0  0 } {8  0  0  0 } float      r8         R8
    rg8        UNORM  2    RG   S-LRbBV--H-- n   {8  8  0  0 } {8  8  0  0 } vec2       rg8        GR88
    rgba8      UNORM  4    RGBA S-LRbBV--H-- n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8      AB24
    bgra8      UNORM  4    BGRA S-LRbBV--H-- n   {8  8  8  8 } {8  8  8  8 } vec4       rgba8      AR24
    r16        UNORM  2    R    S-LRbBV--H-- n   {16 0  0  0 } {16 0  0  0 } float      r16        R16
    rg16       UNORM  4    RG   S-LRbBV--H-- n   {16 16 0  0 } {16 16 0  0 } vec2       rg16       GR32
    rgba16     UNORM  8    RGBA S-LRbBV--H-- n   {16 16 16 16} {16 16 16 16} vec4       rgba16
    rgb8       UNORM  3    RGB  S-LRbBV--H-- y   {8  8  8  0 } {8  8  8  0 } vec3                  BG24
    rgb16      UNORM  6    RGB  S-LRbBV--H-- y   {16 16 16 0 } {16 16 16 0 } vec3
    r32f       FLOAT  4    R    S-LRbBV--H-- y   {32 0  0  0 } {32 0  0  0 } float      r32f
    rg32f      FLOAT  8    RG   S-LRbBV--H-- y   {32 32 0  0 } {32 32 0  0 } vec2       rg32f
    rgb32f     FLOAT  12   RGB  S-LRbBV--H-- y   {32 32 32 0 } {32 32 32 0 } vec3
    rgba32f    FLOAT  16   RGBA S-LRbBV--H-- y   {32 32 32 32} {32 32 32 32} vec4       rgba32f
    r16f       FLOAT  4    R    S-LRbB---H-- y   {16 0  0  0 } {32 0  0  0 } float      r16f
    rg16f      FLOAT  8    RG   S-LRbB---H-- y   {16 16 0  0 } {32 32 0  0 } vec2       rg16f
    rgb16f     FLOAT  12   RGB  S-LRbB---H-- y   {16 16 16 0 } {32 32 32 0 } vec3
    rgba16f    FLOAT  16   RGBA S-LRbB---H-- y   {16 16 16 16} {32 32 32 32} vec4       rgba16f
Codec: vp9 (Google VP9)
Found no storable FBO format; compute shaders disabled
(Re)creating 1920x1080x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 1920x1080x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format rg16
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_0;
[  3] uniform  sampler2D _src_tex_0_1;
[  4] uniform float _const_2_0;
[  5] uniform float _const_2_1;
[  6]  attribute vec2 _tex_coord_1_0_v;
[  7]  varying vec2 _tex_coord_1_0;
[  8]  attribute vec2 _tex_coord_1_1_v;
[  9]  varying vec2 _tex_coord_1_1;
[ 10]  attribute vec2 _position_4_0_v;
[ 11] void main() {
[ 12] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 13] _tex_coord_1_1 = _tex_coord_1_1_v;
[ 14] vec2 va_pos = _position_4_0_v;
[ 15] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 16] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_0;
[  3] uniform  sampler2D _src_tex_0_1;
[  4] uniform float _const_2_0;
[  5] uniform float _const_2_1;
[  6]  varying vec2 _tex_coord_1_0;
[  7]  varying vec2 _tex_coord_1_1;
[  8]
[  9] vec4 _sub_3_0() {
[ 10] // pl_shader_sample_direct
[ 11] vec4 color = vec4(_const_2_1) * texture2D(_src_tex_0_1, _tex_coord_1_1);
[ 12] return color;
[ 13] }
[ 14]
[ 15] vec4 _main_5_0() {
[ 16] vec4 tmp;
[ 17] // pl_shader_sample_direct
[ 18] vec4 color = vec4(_const_2_0) * texture2D(_src_tex_0_0, _tex_coord_1_0);
[ 19] tmp = _sub_3_0();
[ 20] color[1] = tmp[0];
[ 21] return color;
[ 22] }
[ 23]
[ 24] void main() {
[ 25] gl_FragColor = _main_5_0();
[ 26] }
shader compile log (status=1):
shader link log (status=1):
Spent 4.385 ms compiling shader
LUT cache invalidated, regenerating..
(Re)creating 960x1080x0 texture with format rg32f
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_0;
[  3] uniform  sampler2D _weights_5_0;
[  4] uniform vec2 _tex_size_2_0;
[  5] uniform vec2 _tex_pt_3_0;
[  6] uniform float _const_7_0;
[  7] uniform float _const_8_0;
[  8] uniform float _const_10_0;
[  9] uniform float _const_11_0;
[ 10] uniform float _const_12_0;
[ 11]  attribute vec2 _tex_coord_1_0_v;
[ 12]  varying vec2 _tex_coord_1_0;
[ 13]  attribute vec2 _position_13_0_v;
[ 14] void main() {
[ 15] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 16] vec2 va_pos = _position_13_0_v;
[ 17] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 18] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_0;
[  3] uniform  sampler2D _weights_5_0;
[  4] uniform vec2 _tex_size_2_0;
[  5] uniform vec2 _tex_pt_3_0;
[  6] uniform float _const_7_0;
[  7] uniform float _const_8_0;
[  8] uniform float _const_10_0;
[  9] uniform float _const_11_0;
[ 10] uniform float _const_12_0;
[ 11]  varying vec2 _tex_coord_1_0;
[ 12]
[ 13] #define _LUT_POS_6_0(x) mix(_const_7_0, _const_8_0, (x))
[ 14] #define _LUT_POS_9_0(x) mix(_const_10_0, _const_11_0, (x))
[ 15] #define _lut_4_0(pos) (texture2D(_weights_5_0, vec2(\
[ 16]     _LUT_POS_6_0(vec2(pos).x)\
[ 17]    ,_LUT_POS_9_0(vec2(pos).y)\
[ 18]   )).xyzw)
[ 19] vec4 _main_14_0() {
[ 20] // pl_shader_sample_ortho
[ 21] vec4 color = vec4(0.0);
[ 22] {
[ 23] vec2 pos = _tex_coord_1_0, size = _tex_size_2_0, pt = _tex_pt_3_0;
[ 24] vec2 dir = vec2(0.0, 1.0);
[ 25] pt *= dir;
[ 26] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 27] float fcoord = dot(fcoord2, dir);
[ 28] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 29] float weight;
[ 30] vec4 ws, c;
[ 31] // scaler samples
[ 32] ws = _lut_4_0(vec2(0.00000000000000000000, fcoord));
[ 33] weight = ws[0];
[ 34] c = texture2D(_src_tex_0_0, base + pt * vec2(0.0));
[ 35] color[0] += weight * c[0];
[ 36] color[1] += weight * c[1];
[ 37] weight = ws[1];
[ 38] c = texture2D(_src_tex_0_0, base + pt * vec2(1.0));
[ 39] color[0] += weight * c[0];
[ 40] color[1] += weight * c[1];
[ 41] weight = ws[2];
[ 42] c = texture2D(_src_tex_0_0, base + pt * vec2(2.0));
[ 43] color[0] += weight * c[0];
[ 44] color[1] += weight * c[1];
[ 45] weight = ws[3];
[ 46] c = texture2D(_src_tex_0_0, base + pt * vec2(3.0));
[ 47] color[0] += weight * c[0];
[ 48] color[1] += weight * c[1];
[ 49] ws = _lut_4_0(vec2(1.00000000000000000000, fcoord));
[ 50] weight = ws[0];
[ 51] c = texture2D(_src_tex_0_0, base + pt * vec2(4.0));
[ 52] color[0] += weight * c[0];
[ 53] color[1] += weight * c[1];
[ 54] weight = ws[1];
[ 55] c = texture2D(_src_tex_0_0, base + pt * vec2(5.0));
[ 56] color[0] += weight * c[0];
[ 57] color[1] += weight * c[1];
[ 58] color *= vec4(_const_12_0);
[ 59] color.a = 1.0;
[ 60] }
[ 61] return color;
[ 62] }
[ 63]
[ 64] void main() {
[ 65] gl_FragColor = _main_14_0();
[ 66] }
shader compile log (status=1):
shader link log (status=1):
Spent 1.233 ms compiling shader
LUT cache invalidated, regenerating..
LUT cache invalidated, regenerating..
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_3;
[  3] uniform  sampler2D _src_tex_0_4;
[  4] uniform  sampler2D _weights_5_4;
[  5] uniform  sampler2D _weights_29_2;
[  6] uniform float _const_2_3;
[  7] uniform vec2 _tex_size_2_4;
[  8] uniform vec2 _tex_pt_3_4;
[  9] uniform float _const_7_4;
[ 10] uniform float _const_8_4;
[ 11] uniform float _const_10_4;
[ 12] uniform float _const_11_4;
[ 13] uniform float _const_12_4;
[ 14] uniform mat3 _cmat_2_2;
[ 15] uniform vec3 _cmat_c_3_2;
[ 16] uniform float _const_4_2;
[ 17] uniform float _const_5_2;
[ 18] uniform float _dst_range_6_2;
[ 19] uniform float _src_floor_7_2;
[ 20] uniform float _dst_peak_8_2;
[ 21] uniform float _dst_floor_9_2;
[ 22] uniform float _const_10_2;
[ 23] uniform float _dst_avg_11_2;
[ 24] uniform float _const_12_2;
[ 25] uniform float _const_13_2;
[ 26] uniform float _const_14_2;
[ 27] uniform float _const_15_2;
[ 28] uniform float _const_16_2;
[ 29] uniform float _const_17_2;
[ 30] uniform float _const_18_2;
[ 31] uniform mat3 _cms_matrix_19_2;
[ 32] uniform float _const_20_2;
[ 33] uniform float _const_21_2;
[ 34] uniform float _const_23_2;
[ 35] uniform float _const_24_2;
[ 36] uniform float _const_25_2;
[ 37] uniform float _const_26_2;
[ 38] uniform float _const_27_2;
[ 39] uniform float _const_31_2;
[ 40] uniform float _const_32_2;
[ 41] uniform float _const_34_2;
[ 42] uniform float _const_35_2;
[ 43] uniform float _const_36_2;
[ 44] uniform float _const_37_2;
[ 45] uniform float _const_38_2;
[ 46]  attribute vec2 _tex_coord_1_3_v;
[ 47]  varying vec2 _tex_coord_1_3;
[ 48]  attribute vec2 _tex_coord_1_4_v;
[ 49]  varying vec2 _tex_coord_1_4;
[ 50]  attribute vec2 _position_40_2_v;
[ 51] void main() {
[ 52] _tex_coord_1_3 = _tex_coord_1_3_v;
[ 53] _tex_coord_1_4 = _tex_coord_1_4_v;
[ 54] vec2 va_pos = _position_40_2_v;
[ 55] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 56] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_3;
[  3] uniform  sampler2D _src_tex_0_4;
[  4] uniform  sampler2D _weights_5_4;
[  5] uniform  sampler2D _weights_29_2;
[  6] uniform float _const_2_3;
[  7] uniform vec2 _tex_size_2_4;
[  8] uniform vec2 _tex_pt_3_4;
[  9] uniform float _const_7_4;
[ 10] uniform float _const_8_4;
[ 11] uniform float _const_10_4;
[ 12] uniform float _const_11_4;
[ 13] uniform float _const_12_4;
[ 14] uniform mat3 _cmat_2_2;
[ 15] uniform vec3 _cmat_c_3_2;
[ 16] uniform float _const_4_2;
[ 17] uniform float _const_5_2;
[ 18] uniform float _dst_range_6_2;
[ 19] uniform float _src_floor_7_2;
[ 20] uniform float _dst_peak_8_2;
[ 21] uniform float _dst_floor_9_2;
[ 22] uniform float _const_10_2;
[ 23] uniform float _dst_avg_11_2;
[ 24] uniform float _const_12_2;
[ 25] uniform float _const_13_2;
[ 26] uniform float _const_14_2;
[ 27] uniform float _const_15_2;
[ 28] uniform float _const_16_2;
[ 29] uniform float _const_17_2;
[ 30] uniform float _const_18_2;
[ 31] uniform mat3 _cms_matrix_19_2;
[ 32] uniform float _const_20_2;
[ 33] uniform float _const_21_2;
[ 34] uniform float _const_23_2;
[ 35] uniform float _const_24_2;
[ 36] uniform float _const_25_2;
[ 37] uniform float _const_26_2;
[ 38] uniform float _const_27_2;
[ 39] uniform float _const_31_2;
[ 40] uniform float _const_32_2;
[ 41] uniform float _const_34_2;
[ 42] uniform float _const_35_2;
[ 43] uniform float _const_36_2;
[ 44] uniform float _const_37_2;
[ 45] uniform float _const_38_2;
[ 46]  varying vec2 _tex_coord_1_3;
[ 47]  varying vec2 _tex_coord_1_4;
[ 48]
[ 49] vec4 _sub_0_2() {
[ 50] // pl_shader_sample_direct
[ 51] vec4 color = vec4(_const_2_3) * texture2D(_src_tex_0_3, _tex_coord_1_3);
[ 52] return color;
[ 53] }
[ 54]
[ 55] #define _LUT_POS_6_4(x) mix(_const_7_4, _const_8_4, (x))
[ 56] #define _LUT_POS_9_4(x) mix(_const_10_4, _const_11_4, (x))
[ 57] #define _lut_4_4(pos) (texture2D(_weights_5_4, vec2(\
[ 58]     _LUT_POS_6_4(vec2(pos).x)\
[ 59]    ,_LUT_POS_9_4(vec2(pos).y)\
[ 60]   )).xyzw)
[ 61] vec4 _sub_1_2() {
[ 62] // pl_shader_sample_ortho
[ 63] vec4 color = vec4(0.0);
[ 64] {
[ 65] vec2 pos = _tex_coord_1_4, size = _tex_size_2_4, pt = _tex_pt_3_4;
[ 66] vec2 dir = vec2(1.0, 0.0);
[ 67] pt *= dir;
[ 68] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 69] float fcoord = dot(fcoord2, dir);
[ 70] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 71] float weight;
[ 72] vec4 ws, c;
[ 73] // scaler samples
[ 74] ws = _lut_4_4(vec2(0.00000000000000000000, fcoord));
[ 75] weight = ws[0];
[ 76] c = texture2D(_src_tex_0_4, base + pt * vec2(0.0));
[ 77] color[0] += weight * c[0];
[ 78] color[1] += weight * c[1];
[ 79] weight = ws[1];
[ 80] c = texture2D(_src_tex_0_4, base + pt * vec2(1.0));
[ 81] color[0] += weight * c[0];
[ 82] color[1] += weight * c[1];
[ 83] weight = ws[2];
[ 84] c = texture2D(_src_tex_0_4, base + pt * vec2(2.0));
[ 85] color[0] += weight * c[0];
[ 86] color[1] += weight * c[1];
[ 87] weight = ws[3];
[ 88] c = texture2D(_src_tex_0_4, base + pt * vec2(3.0));
[ 89] color[0] += weight * c[0];
[ 90] color[1] += weight * c[1];
[ 91] ws = _lut_4_4(vec2(1.00000000000000000000, fcoord));
[ 92] weight = ws[0];
[ 93] c = texture2D(_src_tex_0_4, base + pt * vec2(4.0));
[ 94] color[0] += weight * c[0];
[ 95] color[1] += weight * c[1];
[ 96] weight = ws[1];
[ 97] c = texture2D(_src_tex_0_4, base + pt * vec2(5.0));
[ 98] color[0] += weight * c[0];
[ 99] color[1] += weight * c[1];
[100] color *= vec4(_const_12_4);
[101] color.a = 1.0;
[102] }
[103] return color;
[104] }
[105]
[106] #define _luma_coeffs_22_2 vec3(_const_23_2, _const_24_2, _const_25_2)
[107] #define _LUT_POS_30_2(x) mix(_const_31_2, _const_32_2, (x))
[108] #define _LUT_POS_33_2(x) mix(_const_34_2, _const_35_2, (x))
[109] #define _lut_28_2(pos) (texture2D(_weights_29_2, vec2(\
[110]     _LUT_POS_30_2(vec2(pos).x)\
[111]    ,_LUT_POS_33_2(vec2(pos).y)\
[112]   )).x)
[113] vec4 _main_41_2() {
[114] vec4 color = vec4(0.0, 0.5, 0.5, 1.0);
[115] // pass_read_image
[116] {
[117] vec4 tmp;
[118] tmp = _sub_0_2();
[119] color[0] = tmp[0];
[120] tmp = _sub_1_2();
[121] color[1] = tmp[0];
[122] color[2] = tmp[1];
[123] }
[124] // pl_shader_decode_color
[125] {
[126] color.rgb = _cmat_2_2 * color.rgb + _cmat_c_3_2;
[127] }
[128] // pl_shader_color_map
[129] {
[130] // pl_shader_linearize
[131] color.rgb = max(color.rgb, 0.0);
[132] color.rgb = pow(color.rgb, vec3(1.0/78.84375000000000000000));
[133] color.rgb = max(color.rgb - vec3(0.83593750000000000000), 0.0)
[134]              / (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * color.rgb);
[135] color.rgb = pow(color.rgb, vec3(1.0/0.15930175781250000000));
[136] color.rgb *= vec3(49.26108374384236298501);
[137] // pl_shader_tone_map
[138] {
[139] float sig_peak = _const_4_2;
[140] float sig_avg = _const_5_2;
[141] int sig_idx = 0;
[142] if (color[1] > color[sig_idx]) sig_idx = 1;
[143] if (color[2] > color[sig_idx]) sig_idx = 2;
[144] vec3 sig = clamp(color.rgb, 0.0, sig_peak);
[145] vec3 sig_orig = color.rgb;
[146] float slope = min(_const_10_2, _dst_avg_11_2 / sig_avg);
[147] sig *= slope;
[148] sig_peak *= slope;
[149] vec4 sig_pq = vec4(sig.rgb, sig_peak);
[150] sig_pq *= vec4(1.0/49.26108374384236298501);
[151] sig_pq = pow(max(sig_pq, 0.0), vec4(0.15930175781250000000));
[152] sig_pq = (vec4(0.83593750000000000000) + vec4(18.85156250000000000000) * sig_pq)
[153]           / (vec4(1.0) + vec4(18.68750000000000000000) * sig_pq);
[154] sig_pq = pow(sig_pq, vec4(78.84375000000000000000));
[155] float scale = 1.0 / (sig_pq.a - _const_12_2);
[156] sig = clamp(vec3(scale) * (sig_pq.rgb - vec3(_const_12_2)), 0.0, 1.0);
[157] float maxLum = _const_13_2 * scale;
[158] float ks = 1.5 * maxLum - 0.5;
[159] vec3 tb = (sig - vec3(ks)) / vec3(1.0 - ks);
[160] vec3 tb2 = tb * tb;
[161] vec3 tb3 = tb2 * tb;
[162] vec3 pb = (2.0 * tb3 - 3.0 * tb2 + vec3(1.0)) * vec3(ks) +
[163]           (tb3 - 2.0 * tb2 + tb) * vec3(1.0 - ks) +
[164]           (-2.0 * tb3 + 3.0 * tb2) * vec3(maxLum);
[165] sig = mix(sig, pb, vec3(greaterThan(sig, vec3(ks))));
[166] float minLum = _const_14_2 * scale;
[167] float p = 4.0;
[168] if (minLum >= 0.0)
[169]     p = min(1.0 / minLum, 4.0);
[170] vec3 boost = vec3(minLum) * pow(vec3(1.0) - sig, vec3(p));
[171] vec3 sig_lift = sig + boost;
[172] if (maxLum < 1.0) {
[173] sig_lift -= vec3(minLum);
[174] sig_lift /= 1.0 + minLum / maxLum * pow(1.0 - maxLum, p);
[175] sig_lift += vec3(minLum);
[176] }
[177] sig = mix(sig, sig_lift, vec3(lessThan(sig, vec3(1.0))));
[178] sig = vec3(sig_pq.a - _const_12_2) * sig + vec3(_const_12_2);
[179] sig = pow(max(sig, 0.0), vec3(1.0/78.84375000000000000000));
[180] sig = max(sig - vec3(0.83593750000000000000), 0.0) /
[181]           (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * sig);
[182] sig = pow(sig, vec3(1.0/0.15930175781250000000));
[183] sig *= vec3(49.26108374384236298501);
[184] float orig = max(sig_orig[sig_idx], 1e-10);
[185] vec3 sig_lin = sig_orig * sig[sig_idx] / orig;
[186] float coeff = max(sig[sig_idx] - _const_15_2, 1e-6) /
[187]               max(sig[sig_idx], 1.0);
[188] coeff = _const_16_2 * pow(coeff / _const_17_2, _const_18_2);
[189] color.rgb = mix(sig_lin, sig, coeff);
[190] }
[191] color.rgb = _cms_matrix_19_2 * color.rgb;
[192] float cmin = min(min(color.r, color.g), color.b);
[193] if (cmin < _const_20_2) {
[194]     float luma = dot(_luma_coeffs_22_2, color.rgb);
[195]     float coeff = (_const_20_2 - cmin) / (luma - cmin);
[196]     coeff = clamp(coeff, 0.0, 1.0);
[197]     color.rgb = mix(color.rgb, vec3(luma), coeff);
[198] }
[199] float cmax = 1.0/_const_21_2 * max(max(color.r, color.g), color.b);
[200] if (cmax > 1.0)
[201]     color.rgb /= cmax;
[202] // pl_shader_delinearize
[203] color.rgb = max(color.rgb, 0.0);
[204] color.rgb = pow(vec3(_const_26_2) * color.rgb, vec3(1.0/2.4)) - vec3(_const_27_2);
[205] }
[206] // pl_shader_encode_color
[207] {
[208] }
[209] // pl_shader_dither
[210] {
[211] float bias;
[212] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_36_2);
[213] bias = _lut_28_2(ivec2(pos * _const_37_2));
[214] color = vec4(255.0) * color + vec4(bias);
[215] color = floor(color) * vec4(1.0 / 255.0);
[216] }
[217] color *= vec4(1.0 / _const_38_2);
[218] vec4 _orig_color_39_2 = color;
[219] color = vec4(0.0, 0.0, 0.0, 1.0);
[220] color[0] = _orig_color_39_2[0];
[221] color[1] = _orig_color_39_2[1];
[222] color[2] = _orig_color_39_2[2];
[223] color[3] = _orig_color_39_2[3];
[224] return color;
[225] }
[226]
[227] void main() {
[228] gl_FragColor = _main_41_2();
[229] }
shader compile log (status=1):
shader link log (status=1):
Spent 3.443 ms compiling shader
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D ui_tex;
[  3] uniform mat2 _proj_0_0;
[  4] uniform vec2 _offset_1_0;
[  5]  attribute vec2 pos_v;
[  6]  attribute vec2 coord_v;
[  7]  varying vec2 coord;
[  8]  attribute vec4 vcolor_v;
[  9]  varying vec4 vcolor;
[ 10] void main() {
[ 11] vec2 va_pos = pos_v;
[ 12] va_pos = _proj_0_0 * va_pos;
[ 13] va_pos += _offset_1_0;
[ 14] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 15] coord = coord_v;
[ 16] vcolor = vcolor_v;
[ 17] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D ui_tex;
[  3] uniform mat2 _proj_0_0;
[  4] uniform vec2 _offset_1_0;
[  5]  varying vec2 coord;
[  6]  varying vec4 vcolor;
[  7]
[  8] vec4 _main_2_0() {
[  9] // pl_shader_custom
[ 10] vec4 color = vec4(0.0);
[ 11] {
[ 12] color = texture2D(ui_tex, coord).r * vcolor;
[ 13] }
[ 14] // pl_shader_color_map
[ 15] {
[ 16] }
[ 17] // pl_shader_encode_color
[ 18] {
[ 19] }
[ 20] return color;
[ 21] }
[ 22]
[ 23] void main() {
[ 24] gl_FragColor = _main_2_0();
[ 25] }
shader compile log (status=1):
shader link log (status=1):
Spent 0.446 ms compiling shader
Dropped frame with PTS 0.033
Dropped frame with PTS 0.050
Dropped frame with PTS 0.067
Dropped frame with PTS 0.083
Dropped frame with PTS 0.100
Dropped frame with PTS 0.117
Dropped frame with PTS 0.133
Dropped frame with PTS 0.150
Dropped frame with PTS 0.167
Dropped frame with PTS 0.183
Dropped frame with PTS 0.200
Dropped frame with PTS 0.217
Dropped frame with PTS 0.233
Dropped frame with PTS 0.250
Dropped frame with PTS 0.267
Dropped frame with PTS 0.283
Dropped frame with PTS 0.300
Dropped frame with PTS 0.317
Dropped frame with PTS 0.333
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x1081x0 texture with format rg32f
(Re)creating 1920x1081x0 texture with format rgb32f
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_3;
[  3] uniform  sampler2D _src_tex_0_4;
[  4] uniform  sampler2D _weights_5_4;
[  5] uniform float _const_2_3;
[  6] uniform vec2 _tex_size_2_4;
[  7] uniform vec2 _tex_pt_3_4;
[  8] uniform float _const_7_4;
[  9] uniform float _const_8_4;
[ 10] uniform float _const_10_4;
[ 11] uniform float _const_11_4;
[ 12] uniform float _const_12_4;
[ 13] uniform mat3 _cmat_2_2;
[ 14] uniform vec3 _cmat_c_3_2;
[ 15]  attribute vec2 _tex_coord_1_3_v;
[ 16]  varying vec2 _tex_coord_1_3;
[ 17]  attribute vec2 _tex_coord_1_4_v;
[ 18]  varying vec2 _tex_coord_1_4;
[ 19]  attribute vec2 _position_4_2_v;
[ 20] void main() {
[ 21] _tex_coord_1_3 = _tex_coord_1_3_v;
[ 22] _tex_coord_1_4 = _tex_coord_1_4_v;
[ 23] vec2 va_pos = _position_4_2_v;
[ 24] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 25] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_3;
[  3] uniform  sampler2D _src_tex_0_4;
[  4] uniform  sampler2D _weights_5_4;
[  5] uniform float _const_2_3;
[  6] uniform vec2 _tex_size_2_4;
[  7] uniform vec2 _tex_pt_3_4;
[  8] uniform float _const_7_4;
[  9] uniform float _const_8_4;
[ 10] uniform float _const_10_4;
[ 11] uniform float _const_11_4;
[ 12] uniform float _const_12_4;
[ 13] uniform mat3 _cmat_2_2;
[ 14] uniform vec3 _cmat_c_3_2;
[ 15]  varying vec2 _tex_coord_1_3;
[ 16]  varying vec2 _tex_coord_1_4;
[ 17]
[ 18] vec4 _sub_0_2() {
[ 19] // pl_shader_sample_direct
[ 20] vec4 color = vec4(_const_2_3) * texture2D(_src_tex_0_3, _tex_coord_1_3);
[ 21] return color;
[ 22] }
[ 23]
[ 24] #define _LUT_POS_6_4(x) mix(_const_7_4, _const_8_4, (x))
[ 25] #define _LUT_POS_9_4(x) mix(_const_10_4, _const_11_4, (x))
[ 26] #define _lut_4_4(pos) (texture2D(_weights_5_4, vec2(\
[ 27]     _LUT_POS_6_4(vec2(pos).x)\
[ 28]    ,_LUT_POS_9_4(vec2(pos).y)\
[ 29]   )).xyzw)
[ 30] vec4 _sub_1_2() {
[ 31] // pl_shader_sample_ortho
[ 32] vec4 color = vec4(0.0);
[ 33] {
[ 34] vec2 pos = _tex_coord_1_4, size = _tex_size_2_4, pt = _tex_pt_3_4;
[ 35] vec2 dir = vec2(1.0, 0.0);
[ 36] pt *= dir;
[ 37] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 38] float fcoord = dot(fcoord2, dir);
[ 39] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 40] float weight;
[ 41] vec4 ws, c;
[ 42] // scaler samples
[ 43] ws = _lut_4_4(vec2(0.00000000000000000000, fcoord));
[ 44] weight = ws[0];
[ 45] c = texture2D(_src_tex_0_4, base + pt * vec2(0.0));
[ 46] color[0] += weight * c[0];
[ 47] color[1] += weight * c[1];
[ 48] weight = ws[1];
[ 49] c = texture2D(_src_tex_0_4, base + pt * vec2(1.0));
[ 50] color[0] += weight * c[0];
[ 51] color[1] += weight * c[1];
[ 52] weight = ws[2];
[ 53] c = texture2D(_src_tex_0_4, base + pt * vec2(2.0));
[ 54] color[0] += weight * c[0];
[ 55] color[1] += weight * c[1];
[ 56] weight = ws[3];
[ 57] c = texture2D(_src_tex_0_4, base + pt * vec2(3.0));
[ 58] color[0] += weight * c[0];
[ 59] color[1] += weight * c[1];
[ 60] ws = _lut_4_4(vec2(1.00000000000000000000, fcoord));
[ 61] weight = ws[0];
[ 62] c = texture2D(_src_tex_0_4, base + pt * vec2(4.0));
[ 63] color[0] += weight * c[0];
[ 64] color[1] += weight * c[1];
[ 65] weight = ws[1];
[ 66] c = texture2D(_src_tex_0_4, base + pt * vec2(5.0));
[ 67] color[0] += weight * c[0];
[ 68] color[1] += weight * c[1];
[ 69] color *= vec4(_const_12_4);
[ 70] color.a = 1.0;
[ 71] }
[ 72] return color;
[ 73] }
[ 74]
[ 75] vec4 _main_5_2() {
[ 76] vec4 color = vec4(0.0, 0.5, 0.5, 1.0);
[ 77] // pass_read_image
[ 78] {
[ 79] vec4 tmp;
[ 80] tmp = _sub_0_2();
[ 81] color[0] = tmp[0];
[ 82] tmp = _sub_1_2();
[ 83] color[1] = tmp[0];
[ 84] color[2] = tmp[1];
[ 85] }
[ 86] // pl_shader_decode_color
[ 87] {
[ 88] color.rgb = _cmat_2_2 * color.rgb + _cmat_c_3_2;
[ 89] }
[ 90] // pl_shader_linearize
[ 91] color.rgb = max(color.rgb, 0.0);
[ 92] color.rgb = pow(color.rgb, vec3(1.0/78.84375000000000000000));
[ 93] color.rgb = max(color.rgb - vec3(0.83593750000000000000), 0.0)
[ 94]              / (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * color.rgb);
[ 95] color.rgb = pow(color.rgb, vec3(1.0/0.15930175781250000000));
[ 96] color.rgb *= vec3(49.26108374384236298501);
[ 97] return color;
[ 98] }
[ 99]
[100] void main() {
[101] gl_FragColor = _main_5_2();
[102] }
shader compile log (status=1):
shader link log (status=1):
Spent 4.905 ms compiling shader
LUT cache invalidated, regenerating..
(Re)creating 1920x973x0 texture with format rgb32f
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_0;
[  3] uniform  sampler2D _weights_5_0;
[  4] uniform vec2 _tex_size_2_0;
[  5] uniform vec2 _tex_pt_3_0;
[  6] uniform float _const_7_0;
[  7] uniform float _const_8_0;
[  8] uniform float _const_10_0;
[  9] uniform float _const_11_0;
[ 10] uniform float _const_12_0;
[ 11]  attribute vec2 _tex_coord_1_0_v;
[ 12]  varying vec2 _tex_coord_1_0;
[ 13]  attribute vec2 _position_13_0_v;
[ 14] void main() {
[ 15] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 16] vec2 va_pos = _position_13_0_v;
[ 17] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 18] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_0;
[  3] uniform  sampler2D _weights_5_0;
[  4] uniform vec2 _tex_size_2_0;
[  5] uniform vec2 _tex_pt_3_0;
[  6] uniform float _const_7_0;
[  7] uniform float _const_8_0;
[  8] uniform float _const_10_0;
[  9] uniform float _const_11_0;
[ 10] uniform float _const_12_0;
[ 11]  varying vec2 _tex_coord_1_0;
[ 12]
[ 13] #define _LUT_POS_6_0(x) mix(_const_7_0, _const_8_0, (x))
[ 14] #define _LUT_POS_9_0(x) mix(_const_10_0, _const_11_0, (x))
[ 15] #define _lut_4_0(pos) (texture2D(_weights_5_0, vec2(\
[ 16]     _LUT_POS_6_0(vec2(pos).x)\
[ 17]    ,_LUT_POS_9_0(vec2(pos).y)\
[ 18]   )).xyzw)
[ 19] vec4 _main_14_0() {
[ 20] // pl_shader_sample_ortho
[ 21] vec4 color = vec4(0.0);
[ 22] {
[ 23] vec2 pos = _tex_coord_1_0, size = _tex_size_2_0, pt = _tex_pt_3_0;
[ 24] vec2 dir = vec2(0.0, 1.0);
[ 25] pt *= dir;
[ 26] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 27] float fcoord = dot(fcoord2, dir);
[ 28] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 29] float weight;
[ 30] vec4 ws, c;
[ 31] // scaler samples
[ 32] ws = _lut_4_0(vec2(0.00000000000000000000, fcoord));
[ 33] weight = ws[0];
[ 34] c = texture2D(_src_tex_0_0, base + pt * vec2(0.0));
[ 35] color[0] += weight * c[0];
[ 36] color[1] += weight * c[1];
[ 37] color[2] += weight * c[2];
[ 38] weight = ws[1];
[ 39] c = texture2D(_src_tex_0_0, base + pt * vec2(1.0));
[ 40] color[0] += weight * c[0];
[ 41] color[1] += weight * c[1];
[ 42] color[2] += weight * c[2];
[ 43] weight = ws[2];
[ 44] c = texture2D(_src_tex_0_0, base + pt * vec2(2.0));
[ 45] color[0] += weight * c[0];
[ 46] color[1] += weight * c[1];
[ 47] color[2] += weight * c[2];
[ 48] weight = ws[3];
[ 49] c = texture2D(_src_tex_0_0, base + pt * vec2(3.0));
[ 50] color[0] += weight * c[0];
[ 51] color[1] += weight * c[1];
[ 52] color[2] += weight * c[2];
[ 53] ws = _lut_4_0(vec2(1.00000000000000000000, fcoord));
[ 54] weight = ws[0];
[ 55] c = texture2D(_src_tex_0_0, base + pt * vec2(4.0));
[ 56] color[0] += weight * c[0];
[ 57] color[1] += weight * c[1];
[ 58] color[2] += weight * c[2];
[ 59] weight = ws[1];
[ 60] c = texture2D(_src_tex_0_0, base + pt * vec2(5.0));
[ 61] color[0] += weight * c[0];
[ 62] color[1] += weight * c[1];
[ 63] color[2] += weight * c[2];
[ 64] color *= vec4(_const_12_0);
[ 65] color.a = 1.0;
[ 66] }
[ 67] return color;
[ 68] }
[ 69]
[ 70] void main() {
[ 71] gl_FragColor = _main_14_0();
[ 72] }
shader compile log (status=1):
shader link log (status=1):
Spent 3.120 ms compiling shader
LUT cache invalidated, regenerating..
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_5;
[  3] uniform  sampler2D _weights_5_5;
[  4] uniform  sampler2D _weights_38_5;
[  5] uniform vec2 _tex_size_2_5;
[  6] uniform vec2 _tex_pt_3_5;
[  7] uniform float _const_7_5;
[  8] uniform float _const_8_5;
[  9] uniform float _const_10_5;
[ 10] uniform float _const_11_5;
[ 11] uniform float _const_12_5;
[ 12] uniform float _const_13_5;
[ 13] uniform float _const_14_5;
[ 14] uniform float _dst_range_15_5;
[ 15] uniform float _src_floor_16_5;
[ 16] uniform float _dst_peak_17_5;
[ 17] uniform float _dst_floor_18_5;
[ 18] uniform float _const_19_5;
[ 19] uniform float _dst_avg_20_5;
[ 20] uniform float _const_21_5;
[ 21] uniform float _const_22_5;
[ 22] uniform float _const_23_5;
[ 23] uniform float _const_24_5;
[ 24] uniform float _const_25_5;
[ 25] uniform float _const_26_5;
[ 26] uniform float _const_27_5;
[ 27] uniform mat3 _cms_matrix_28_5;
[ 28] uniform float _const_29_5;
[ 29] uniform float _const_30_5;
[ 30] uniform float _const_32_5;
[ 31] uniform float _const_33_5;
[ 32] uniform float _const_34_5;
[ 33] uniform float _const_35_5;
[ 34] uniform float _const_36_5;
[ 35] uniform float _const_40_5;
[ 36] uniform float _const_41_5;
[ 37] uniform float _const_43_5;
[ 38] uniform float _const_44_5;
[ 39] uniform float _const_45_5;
[ 40] uniform float _const_46_5;
[ 41] uniform float _const_47_5;
[ 42]  attribute vec2 _tex_coord_1_5_v;
[ 43]  varying vec2 _tex_coord_1_5;
[ 44]  attribute vec2 _position_49_5_v;
[ 45] void main() {
[ 46] _tex_coord_1_5 = _tex_coord_1_5_v;
[ 47] vec2 va_pos = _position_49_5_v;
[ 48] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 49] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_5;
[  3] uniform  sampler2D _weights_5_5;
[  4] uniform  sampler2D _weights_38_5;
[  5] uniform vec2 _tex_size_2_5;
[  6] uniform vec2 _tex_pt_3_5;
[  7] uniform float _const_7_5;
[  8] uniform float _const_8_5;
[  9] uniform float _const_10_5;
[ 10] uniform float _const_11_5;
[ 11] uniform float _const_12_5;
[ 12] uniform float _const_13_5;
[ 13] uniform float _const_14_5;
[ 14] uniform float _dst_range_15_5;
[ 15] uniform float _src_floor_16_5;
[ 16] uniform float _dst_peak_17_5;
[ 17] uniform float _dst_floor_18_5;
[ 18] uniform float _const_19_5;
[ 19] uniform float _dst_avg_20_5;
[ 20] uniform float _const_21_5;
[ 21] uniform float _const_22_5;
[ 22] uniform float _const_23_5;
[ 23] uniform float _const_24_5;
[ 24] uniform float _const_25_5;
[ 25] uniform float _const_26_5;
[ 26] uniform float _const_27_5;
[ 27] uniform mat3 _cms_matrix_28_5;
[ 28] uniform float _const_29_5;
[ 29] uniform float _const_30_5;
[ 30] uniform float _const_32_5;
[ 31] uniform float _const_33_5;
[ 32] uniform float _const_34_5;
[ 33] uniform float _const_35_5;
[ 34] uniform float _const_36_5;
[ 35] uniform float _const_40_5;
[ 36] uniform float _const_41_5;
[ 37] uniform float _const_43_5;
[ 38] uniform float _const_44_5;
[ 39] uniform float _const_45_5;
[ 40] uniform float _const_46_5;
[ 41] uniform float _const_47_5;
[ 42]  varying vec2 _tex_coord_1_5;
[ 43]
[ 44] #define _LUT_POS_6_5(x) mix(_const_7_5, _const_8_5, (x))
[ 45] #define _LUT_POS_9_5(x) mix(_const_10_5, _const_11_5, (x))
[ 46] #define _lut_4_5(pos) (texture2D(_weights_5_5, vec2(\
[ 47]     _LUT_POS_6_5(vec2(pos).x)\
[ 48]    ,_LUT_POS_9_5(vec2(pos).y)\
[ 49]   )).xyzw)
[ 50] #define _luma_coeffs_31_5 vec3(_const_32_5, _const_33_5, _const_34_5)
[ 51] #define _LUT_POS_39_5(x) mix(_const_40_5, _const_41_5, (x))
[ 52] #define _LUT_POS_42_5(x) mix(_const_43_5, _const_44_5, (x))
[ 53] #define _lut_37_5(pos) (texture2D(_weights_38_5, vec2(\
[ 54]     _LUT_POS_39_5(vec2(pos).x)\
[ 55]    ,_LUT_POS_42_5(vec2(pos).y)\
[ 56]   )).x)
[ 57] vec4 _main_50_5() {
[ 58] // pl_shader_sample_ortho
[ 59] vec4 color = vec4(0.0);
[ 60] {
[ 61] vec2 pos = _tex_coord_1_5, size = _tex_size_2_5, pt = _tex_pt_3_5;
[ 62] vec2 dir = vec2(1.0, 0.0);
[ 63] pt *= dir;
[ 64] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 65] float fcoord = dot(fcoord2, dir);
[ 66] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 67] float weight;
[ 68] vec4 ws, c;
[ 69] // scaler samples
[ 70] ws = _lut_4_5(vec2(0.00000000000000000000, fcoord));
[ 71] weight = ws[0];
[ 72] c = texture2D(_src_tex_0_5, base + pt * vec2(0.0));
[ 73] color[0] += weight * c[0];
[ 74] color[1] += weight * c[1];
[ 75] color[2] += weight * c[2];
[ 76] weight = ws[1];
[ 77] c = texture2D(_src_tex_0_5, base + pt * vec2(1.0));
[ 78] color[0] += weight * c[0];
[ 79] color[1] += weight * c[1];
[ 80] color[2] += weight * c[2];
[ 81] weight = ws[2];
[ 82] c = texture2D(_src_tex_0_5, base + pt * vec2(2.0));
[ 83] color[0] += weight * c[0];
[ 84] color[1] += weight * c[1];
[ 85] color[2] += weight * c[2];
[ 86] weight = ws[3];
[ 87] c = texture2D(_src_tex_0_5, base + pt * vec2(3.0));
[ 88] color[0] += weight * c[0];
[ 89] color[1] += weight * c[1];
[ 90] color[2] += weight * c[2];
[ 91] ws = _lut_4_5(vec2(1.00000000000000000000, fcoord));
[ 92] weight = ws[0];
[ 93] c = texture2D(_src_tex_0_5, base + pt * vec2(4.0));
[ 94] color[0] += weight * c[0];
[ 95] color[1] += weight * c[1];
[ 96] color[2] += weight * c[2];
[ 97] weight = ws[1];
[ 98] c = texture2D(_src_tex_0_5, base + pt * vec2(5.0));
[ 99] color[0] += weight * c[0];
[100] color[1] += weight * c[1];
[101] color[2] += weight * c[2];
[102] color *= vec4(_const_12_5);
[103] color.a = 1.0;
[104] }
[105] // pl_shader_color_map
[106] {
[107] // pl_shader_tone_map
[108] {
[109] float sig_peak = _const_13_5;
[110] float sig_avg = _const_14_5;
[111] int sig_idx = 0;
[112] if (color[1] > color[sig_idx]) sig_idx = 1;
[113] if (color[2] > color[sig_idx]) sig_idx = 2;
[114] vec3 sig = clamp(color.rgb, 0.0, sig_peak);
[115] vec3 sig_orig = color.rgb;
[116] float slope = min(_const_19_5, _dst_avg_20_5 / sig_avg);
[117] sig *= slope;
[118] sig_peak *= slope;
[119] vec4 sig_pq = vec4(sig.rgb, sig_peak);
[120] sig_pq *= vec4(1.0/49.26108374384236298501);
[121] sig_pq = pow(max(sig_pq, 0.0), vec4(0.15930175781250000000));
[122] sig_pq = (vec4(0.83593750000000000000) + vec4(18.85156250000000000000) * sig_pq)
[123]           / (vec4(1.0) + vec4(18.68750000000000000000) * sig_pq);
[124] sig_pq = pow(sig_pq, vec4(78.84375000000000000000));
[125] float scale = 1.0 / (sig_pq.a - _const_21_5);
[126] sig = clamp(vec3(scale) * (sig_pq.rgb - vec3(_const_21_5)), 0.0, 1.0);
[127] float maxLum = _const_22_5 * scale;
[128] float ks = 1.5 * maxLum - 0.5;
[129] vec3 tb = (sig - vec3(ks)) / vec3(1.0 - ks);
[130] vec3 tb2 = tb * tb;
[131] vec3 tb3 = tb2 * tb;
[132] vec3 pb = (2.0 * tb3 - 3.0 * tb2 + vec3(1.0)) * vec3(ks) +
[133]           (tb3 - 2.0 * tb2 + tb) * vec3(1.0 - ks) +
[134]           (-2.0 * tb3 + 3.0 * tb2) * vec3(maxLum);
[135] sig = mix(sig, pb, vec3(greaterThan(sig, vec3(ks))));
[136] float minLum = _const_23_5 * scale;
[137] float p = 4.0;
[138] if (minLum >= 0.0)
[139]     p = min(1.0 / minLum, 4.0);
[140] vec3 boost = vec3(minLum) * pow(vec3(1.0) - sig, vec3(p));
[141] vec3 sig_lift = sig + boost;
[142] if (maxLum < 1.0) {
[143] sig_lift -= vec3(minLum);
[144] sig_lift /= 1.0 + minLum / maxLum * pow(1.0 - maxLum, p);
[145] sig_lift += vec3(minLum);
[146] }
[147] sig = mix(sig, sig_lift, vec3(lessThan(sig, vec3(1.0))));
[148] sig = vec3(sig_pq.a - _const_21_5) * sig + vec3(_const_21_5);
[149] sig = pow(max(sig, 0.0), vec3(1.0/78.84375000000000000000));
[150] sig = max(sig - vec3(0.83593750000000000000), 0.0) /
[151]           (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * sig);
[152] sig = pow(sig, vec3(1.0/0.15930175781250000000));
[153] sig *= vec3(49.26108374384236298501);
[154] float orig = max(sig_orig[sig_idx], 1e-10);
[155] vec3 sig_lin = sig_orig * sig[sig_idx] / orig;
[156] float coeff = max(sig[sig_idx] - _const_24_5, 1e-6) /
[157]               max(sig[sig_idx], 1.0);
[158] coeff = _const_25_5 * pow(coeff / _const_26_5, _const_27_5);
[159] color.rgb = mix(sig_lin, sig, coeff);
[160] }
[161] color.rgb = _cms_matrix_28_5 * color.rgb;
[162] float cmin = min(min(color.r, color.g), color.b);
[163] if (cmin < _const_29_5) {
[164]     float luma = dot(_luma_coeffs_31_5, color.rgb);
[165]     float coeff = (_const_29_5 - cmin) / (luma - cmin);
[166]     coeff = clamp(coeff, 0.0, 1.0);
[167]     color.rgb = mix(color.rgb, vec3(luma), coeff);
[168] }
[169] float cmax = 1.0/_const_30_5 * max(max(color.r, color.g), color.b);
[170] if (cmax > 1.0)
[171]     color.rgb /= cmax;
[172] // pl_shader_delinearize
[173] color.rgb = max(color.rgb, 0.0);
[174] color.rgb = pow(vec3(_const_35_5) * color.rgb, vec3(1.0/2.4)) - vec3(_const_36_5);
[175] }
[176] // pl_shader_encode_color
[177] {
[178] }
[179] // pl_shader_dither
[180] {
[181] float bias;
[182] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_45_5);
[183] bias = _lut_37_5(ivec2(pos * _const_46_5));
[184] color = vec4(255.0) * color + vec4(bias);
[185] color = floor(color) * vec4(1.0 / 255.0);
[186] }
[187] color *= vec4(1.0 / _const_47_5);
[188] vec4 _orig_color_48_5 = color;
[189] color = vec4(0.0, 0.0, 0.0, 1.0);
[190] color[0] = _orig_color_48_5[0];
[191] color[1] = _orig_color_48_5[1];
[192] color[2] = _orig_color_48_5[2];
[193] color[3] = _orig_color_48_5[3];
[194] return color;
[195] }
[196]
[197] void main() {
[198] gl_FragColor = _main_50_5();
[199] }
shader compile log (status=1):
shader link log (status=1):
Spent 9.031 ms compiling shader
Dropped frame with PTS 0.350
(Re)creating 1920x1080x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 1728x973x0 texture with format rgba32f
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_5;
[  3] uniform  sampler2D _weights_5_5;
[  4] uniform vec2 _tex_size_2_5;
[  5] uniform vec2 _tex_pt_3_5;
[  6] uniform float _const_7_5;
[  7] uniform float _const_8_5;
[  8] uniform float _const_10_5;
[  9] uniform float _const_11_5;
[ 10] uniform float _const_12_5;
[ 11]  attribute vec2 _tex_coord_1_5_v;
[ 12]  varying vec2 _tex_coord_1_5;
[ 13]  attribute vec2 _position_13_5_v;
[ 14] void main() {
[ 15] _tex_coord_1_5 = _tex_coord_1_5_v;
[ 16] vec2 va_pos = _position_13_5_v;
[ 17] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 18] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _src_tex_0_5;
[  3] uniform  sampler2D _weights_5_5;
[  4] uniform vec2 _tex_size_2_5;
[  5] uniform vec2 _tex_pt_3_5;
[  6] uniform float _const_7_5;
[  7] uniform float _const_8_5;
[  8] uniform float _const_10_5;
[  9] uniform float _const_11_5;
[ 10] uniform float _const_12_5;
[ 11]  varying vec2 _tex_coord_1_5;
[ 12]
[ 13] #define _LUT_POS_6_5(x) mix(_const_7_5, _const_8_5, (x))
[ 14] #define _LUT_POS_9_5(x) mix(_const_10_5, _const_11_5, (x))
[ 15] #define _lut_4_5(pos) (texture2D(_weights_5_5, vec2(\
[ 16]     _LUT_POS_6_5(vec2(pos).x)\
[ 17]    ,_LUT_POS_9_5(vec2(pos).y)\
[ 18]   )).xyzw)
[ 19] vec4 _main_14_5() {
[ 20] // pl_shader_sample_ortho
[ 21] vec4 color = vec4(0.0);
[ 22] {
[ 23] vec2 pos = _tex_coord_1_5, size = _tex_size_2_5, pt = _tex_pt_3_5;
[ 24] vec2 dir = vec2(1.0, 0.0);
[ 25] pt *= dir;
[ 26] vec2 fcoord2 = fract(pos * size - vec2(0.5));
[ 27] float fcoord = dot(fcoord2, dir);
[ 28] vec2 base = pos - fcoord * pt - pt * vec2(2.0);
[ 29] float weight;
[ 30] vec4 ws, c;
[ 31] // scaler samples
[ 32] ws = _lut_4_5(vec2(0.00000000000000000000, fcoord));
[ 33] weight = ws[0];
[ 34] c = texture2D(_src_tex_0_5, base + pt * vec2(0.0));
[ 35] color[0] += weight * c[0];
[ 36] color[1] += weight * c[1];
[ 37] color[2] += weight * c[2];
[ 38] weight = ws[1];
[ 39] c = texture2D(_src_tex_0_5, base + pt * vec2(1.0));
[ 40] color[0] += weight * c[0];
[ 41] color[1] += weight * c[1];
[ 42] color[2] += weight * c[2];
[ 43] weight = ws[2];
[ 44] c = texture2D(_src_tex_0_5, base + pt * vec2(2.0));
[ 45] color[0] += weight * c[0];
[ 46] color[1] += weight * c[1];
[ 47] color[2] += weight * c[2];
[ 48] weight = ws[3];
[ 49] c = texture2D(_src_tex_0_5, base + pt * vec2(3.0));
[ 50] color[0] += weight * c[0];
[ 51] color[1] += weight * c[1];
[ 52] color[2] += weight * c[2];
[ 53] ws = _lut_4_5(vec2(1.00000000000000000000, fcoord));
[ 54] weight = ws[0];
[ 55] c = texture2D(_src_tex_0_5, base + pt * vec2(4.0));
[ 56] color[0] += weight * c[0];
[ 57] color[1] += weight * c[1];
[ 58] color[2] += weight * c[2];
[ 59] weight = ws[1];
[ 60] c = texture2D(_src_tex_0_5, base + pt * vec2(5.0));
[ 61] color[0] += weight * c[0];
[ 62] color[1] += weight * c[1];
[ 63] color[2] += weight * c[2];
[ 64] color *= vec4(_const_12_5);
[ 65] color.a = 1.0;
[ 66] }
[ 67] return color;
[ 68] }
[ 69]
[ 70] void main() {
[ 71] gl_FragColor = _main_14_5();
[ 72] }
shader compile log (status=1):
shader link log (status=1):
Spent 3.445 ms compiling shader
(Re)creating 1728x973x0 texture with format rgba32f
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _frame_0_0;
[  3] uniform  sampler2D _frame_3_0;
[  4] uniform  sampler2D _weights_31_0;
[  5] uniform float _weight_2_0;
[  6] uniform float _weight_5_0;
[  7] uniform float _const_6_0;
[  8] uniform float _const_7_0;
[  9] uniform float _dst_range_8_0;
[ 10] uniform float _src_floor_9_0;
[ 11] uniform float _dst_peak_10_0;
[ 12] uniform float _dst_floor_11_0;
[ 13] uniform float _const_12_0;
[ 14] uniform float _dst_avg_13_0;
[ 15] uniform float _const_14_0;
[ 16] uniform float _const_15_0;
[ 17] uniform float _const_16_0;
[ 18] uniform float _const_17_0;
[ 19] uniform float _const_18_0;
[ 20] uniform float _const_19_0;
[ 21] uniform float _const_20_0;
[ 22] uniform mat3 _cms_matrix_21_0;
[ 23] uniform float _const_22_0;
[ 24] uniform float _const_23_0;
[ 25] uniform float _const_25_0;
[ 26] uniform float _const_26_0;
[ 27] uniform float _const_27_0;
[ 28] uniform float _const_28_0;
[ 29] uniform float _const_29_0;
[ 30] uniform float _const_33_0;
[ 31] uniform float _const_34_0;
[ 32] uniform float _const_36_0;
[ 33] uniform float _const_37_0;
[ 34] uniform float _const_38_0;
[ 35] uniform float _const_39_0;
[ 36] uniform float _const_40_0;
[ 37]  attribute vec2 _tex_coord_1_0_v;
[ 38]  varying vec2 _tex_coord_1_0;
[ 39]  attribute vec2 _tex_coord_4_0_v;
[ 40]  varying vec2 _tex_coord_4_0;
[ 41]  attribute vec2 _position_42_0_v;
[ 42] void main() {
[ 43] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 44] _tex_coord_4_0 = _tex_coord_4_0_v;
[ 45] vec2 va_pos = _position_42_0_v;
[ 46] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 47] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _frame_0_0;
[  3] uniform  sampler2D _frame_3_0;
[  4] uniform  sampler2D _weights_31_0;
[  5] uniform float _weight_2_0;
[  6] uniform float _weight_5_0;
[  7] uniform float _const_6_0;
[  8] uniform float _const_7_0;
[  9] uniform float _dst_range_8_0;
[ 10] uniform float _src_floor_9_0;
[ 11] uniform float _dst_peak_10_0;
[ 12] uniform float _dst_floor_11_0;
[ 13] uniform float _const_12_0;
[ 14] uniform float _dst_avg_13_0;
[ 15] uniform float _const_14_0;
[ 16] uniform float _const_15_0;
[ 17] uniform float _const_16_0;
[ 18] uniform float _const_17_0;
[ 19] uniform float _const_18_0;
[ 20] uniform float _const_19_0;
[ 21] uniform float _const_20_0;
[ 22] uniform mat3 _cms_matrix_21_0;
[ 23] uniform float _const_22_0;
[ 24] uniform float _const_23_0;
[ 25] uniform float _const_25_0;
[ 26] uniform float _const_26_0;
[ 27] uniform float _const_27_0;
[ 28] uniform float _const_28_0;
[ 29] uniform float _const_29_0;
[ 30] uniform float _const_33_0;
[ 31] uniform float _const_34_0;
[ 32] uniform float _const_36_0;
[ 33] uniform float _const_37_0;
[ 34] uniform float _const_38_0;
[ 35] uniform float _const_39_0;
[ 36] uniform float _const_40_0;
[ 37]  varying vec2 _tex_coord_1_0;
[ 38]  varying vec2 _tex_coord_4_0;
[ 39]
[ 40] #define _luma_coeffs_24_0 vec3(_const_25_0, _const_26_0, _const_27_0)
[ 41] #define _LUT_POS_32_0(x) mix(_const_33_0, _const_34_0, (x))
[ 42] #define _LUT_POS_35_0(x) mix(_const_36_0, _const_37_0, (x))
[ 43] #define _lut_30_0(pos) (texture2D(_weights_31_0, vec2(\
[ 44]     _LUT_POS_32_0(vec2(pos).x)\
[ 45]    ,_LUT_POS_35_0(vec2(pos).y)\
[ 46]   )).x)
[ 47] vec4 _main_43_0() {
[ 48] vec4 color;
[ 49] // pl_render_image_mix
[ 50] {
[ 51] vec4 mix_color = vec4(0.0);
[ 52] color = texture2D(_frame_0_0, _tex_coord_1_0);
[ 53] // pl_shader_color_map
[ 54] {
[ 55] }
[ 56] mix_color += _weight_2_0 * color;
[ 57] color = texture2D(_frame_3_0, _tex_coord_4_0);
[ 58] // pl_shader_color_map
[ 59] {
[ 60] }
[ 61] mix_color += _weight_5_0 * color;
[ 62] color = mix_color;
[ 63] }
[ 64] // pl_shader_color_map
[ 65] {
[ 66] // pl_shader_tone_map
[ 67] {
[ 68] float sig_peak = _const_6_0;
[ 69] float sig_avg = _const_7_0;
[ 70] int sig_idx = 0;
[ 71] if (color[1] > color[sig_idx]) sig_idx = 1;
[ 72] if (color[2] > color[sig_idx]) sig_idx = 2;
[ 73] vec3 sig = clamp(color.rgb, 0.0, sig_peak);
[ 74] vec3 sig_orig = color.rgb;
[ 75] float slope = min(_const_12_0, _dst_avg_13_0 / sig_avg);
[ 76] sig *= slope;
[ 77] sig_peak *= slope;
[ 78] vec4 sig_pq = vec4(sig.rgb, sig_peak);
[ 79] sig_pq *= vec4(1.0/49.26108374384236298501);
[ 80] sig_pq = pow(max(sig_pq, 0.0), vec4(0.15930175781250000000));
[ 81] sig_pq = (vec4(0.83593750000000000000) + vec4(18.85156250000000000000) * sig_pq)
[ 82]           / (vec4(1.0) + vec4(18.68750000000000000000) * sig_pq);
[ 83] sig_pq = pow(sig_pq, vec4(78.84375000000000000000));
[ 84] float scale = 1.0 / (sig_pq.a - _const_14_0);
[ 85] sig = clamp(vec3(scale) * (sig_pq.rgb - vec3(_const_14_0)), 0.0, 1.0);
[ 86] float maxLum = _const_15_0 * scale;
[ 87] float ks = 1.5 * maxLum - 0.5;
[ 88] vec3 tb = (sig - vec3(ks)) / vec3(1.0 - ks);
[ 89] vec3 tb2 = tb * tb;
[ 90] vec3 tb3 = tb2 * tb;
[ 91] vec3 pb = (2.0 * tb3 - 3.0 * tb2 + vec3(1.0)) * vec3(ks) +
[ 92]           (tb3 - 2.0 * tb2 + tb) * vec3(1.0 - ks) +
[ 93]           (-2.0 * tb3 + 3.0 * tb2) * vec3(maxLum);
[ 94] sig = mix(sig, pb, vec3(greaterThan(sig, vec3(ks))));
[ 95] float minLum = _const_16_0 * scale;
[ 96] float p = 4.0;
[ 97] if (minLum >= 0.0)
[ 98]     p = min(1.0 / minLum, 4.0);
[ 99] vec3 boost = vec3(minLum) * pow(vec3(1.0) - sig, vec3(p));
[100] vec3 sig_lift = sig + boost;
[101] if (maxLum < 1.0) {
[102] sig_lift -= vec3(minLum);
[103] sig_lift /= 1.0 + minLum / maxLum * pow(1.0 - maxLum, p);
[104] sig_lift += vec3(minLum);
[105] }
[106] sig = mix(sig, sig_lift, vec3(lessThan(sig, vec3(1.0))));
[107] sig = vec3(sig_pq.a - _const_14_0) * sig + vec3(_const_14_0);
[108] sig = pow(max(sig, 0.0), vec3(1.0/78.84375000000000000000));
[109] sig = max(sig - vec3(0.83593750000000000000), 0.0) /
[110]           (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * sig);
[111] sig = pow(sig, vec3(1.0/0.15930175781250000000));
[112] sig *= vec3(49.26108374384236298501);
[113] float orig = max(sig_orig[sig_idx], 1e-10);
[114] vec3 sig_lin = sig_orig * sig[sig_idx] / orig;
[115] float coeff = max(sig[sig_idx] - _const_17_0, 1e-6) /
[116]               max(sig[sig_idx], 1.0);
[117] coeff = _const_18_0 * pow(coeff / _const_19_0, _const_20_0);
[118] color.rgb = mix(sig_lin, sig, coeff);
[119] }
[120] color.rgb = _cms_matrix_21_0 * color.rgb;
[121] float cmin = min(min(color.r, color.g), color.b);
[122] if (cmin < _const_22_0) {
[123]     float luma = dot(_luma_coeffs_24_0, color.rgb);
[124]     float coeff = (_const_22_0 - cmin) / (luma - cmin);
[125]     coeff = clamp(coeff, 0.0, 1.0);
[126]     color.rgb = mix(color.rgb, vec3(luma), coeff);
[127] }
[128] float cmax = 1.0/_const_23_0 * max(max(color.r, color.g), color.b);
[129] if (cmax > 1.0)
[130]     color.rgb /= cmax;
[131] // pl_shader_delinearize
[132] color.rgb = max(color.rgb, 0.0);
[133] color.rgb = pow(vec3(_const_28_0) * color.rgb, vec3(1.0/2.4)) - vec3(_const_29_0);
[134] }
[135] // pl_shader_encode_color
[136] {
[137] }
[138] // pl_shader_dither
[139] {
[140] float bias;
[141] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_38_0);
[142] bias = _lut_30_0(ivec2(pos * _const_39_0));
[143] color = vec4(255.0) * color + vec4(bias);
[144] color = floor(color) * vec4(1.0 / 255.0);
[145] }
[146] color *= vec4(1.0 / _const_40_0);
[147] vec4 _orig_color_41_0 = color;
[148] color = vec4(0.0, 0.0, 0.0, 1.0);
[149] color[0] = _orig_color_41_0[0];
[150] color[1] = _orig_color_41_0[1];
[151] color[2] = _orig_color_41_0[2];
[152] color[3] = _orig_color_41_0[3];
[153] return color;
[154] }
[155]
[156] void main() {
[157] gl_FragColor = _main_43_0();
[158] }
shader compile log (status=1):
shader link log (status=1):
Spent 7.768 ms compiling shader
(Re)creating 1920x1080x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 960x540x0 texture with format r16
gl_buf_write: OpenGL error: GL_INVALID_ENUM
(Re)creating 1728x973x0 texture with format rgba32f
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
vertex shader source:
[  1] #version 120
[  2] uniform  sampler2D _frame_0_0;
[  3] uniform  sampler2D _weights_28_0;
[  4] uniform float _weight_2_0;
[  5] uniform float _const_3_0;
[  6] uniform float _const_4_0;
[  7] uniform float _dst_range_5_0;
[  8] uniform float _src_floor_6_0;
[  9] uniform float _dst_peak_7_0;
[ 10] uniform float _dst_floor_8_0;
[ 11] uniform float _const_9_0;
[ 12] uniform float _dst_avg_10_0;
[ 13] uniform float _const_11_0;
[ 14] uniform float _const_12_0;
[ 15] uniform float _const_13_0;
[ 16] uniform float _const_14_0;
[ 17] uniform float _const_15_0;
[ 18] uniform float _const_16_0;
[ 19] uniform float _const_17_0;
[ 20] uniform mat3 _cms_matrix_18_0;
[ 21] uniform float _const_19_0;
[ 22] uniform float _const_20_0;
[ 23] uniform float _const_22_0;
[ 24] uniform float _const_23_0;
[ 25] uniform float _const_24_0;
[ 26] uniform float _const_25_0;
[ 27] uniform float _const_26_0;
[ 28] uniform float _const_30_0;
[ 29] uniform float _const_31_0;
[ 30] uniform float _const_33_0;
[ 31] uniform float _const_34_0;
[ 32] uniform float _const_35_0;
[ 33] uniform float _const_36_0;
[ 34] uniform float _const_37_0;
[ 35]  attribute vec2 _tex_coord_1_0_v;
[ 36]  varying vec2 _tex_coord_1_0;
[ 37]  attribute vec2 _position_39_0_v;
[ 38] void main() {
[ 39] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 40] vec2 va_pos = _position_39_0_v;
[ 41] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 42] }
shader compile log (status=1):
fragment shader source:
[  1] #version 120
[  2] uniform  sampler2D _frame_0_0;
[  3] uniform  sampler2D _weights_28_0;
[  4] uniform float _weight_2_0;
[  5] uniform float _const_3_0;
[  6] uniform float _const_4_0;
[  7] uniform float _dst_range_5_0;
[  8] uniform float _src_floor_6_0;
[  9] uniform float _dst_peak_7_0;
[ 10] uniform float _dst_floor_8_0;
[ 11] uniform float _const_9_0;
[ 12] uniform float _dst_avg_10_0;
[ 13] uniform float _const_11_0;
[ 14] uniform float _const_12_0;
[ 15] uniform float _const_13_0;
[ 16] uniform float _const_14_0;
[ 17] uniform float _const_15_0;
[ 18] uniform float _const_16_0;
[ 19] uniform float _const_17_0;
[ 20] uniform mat3 _cms_matrix_18_0;
[ 21] uniform float _const_19_0;
[ 22] uniform float _const_20_0;
[ 23] uniform float _const_22_0;
[ 24] uniform float _const_23_0;
[ 25] uniform float _const_24_0;
[ 26] uniform float _const_25_0;
[ 27] uniform float _const_26_0;
[ 28] uniform float _const_30_0;
[ 29] uniform float _const_31_0;
[ 30] uniform float _const_33_0;
[ 31] uniform float _const_34_0;
[ 32] uniform float _const_35_0;
[ 33] uniform float _const_36_0;
[ 34] uniform float _const_37_0;
[ 35]  varying vec2 _tex_coord_1_0;
[ 36]
[ 37] #define _luma_coeffs_21_0 vec3(_const_22_0, _const_23_0, _const_24_0)
[ 38] #define _LUT_POS_29_0(x) mix(_const_30_0, _const_31_0, (x))
[ 39] #define _LUT_POS_32_0(x) mix(_const_33_0, _const_34_0, (x))
[ 40] #define _lut_27_0(pos) (texture2D(_weights_28_0, vec2(\
[ 41]     _LUT_POS_29_0(vec2(pos).x)\
[ 42]    ,_LUT_POS_32_0(vec2(pos).y)\
[ 43]   )).x)
[ 44] vec4 _main_40_0() {
[ 45] vec4 color;
[ 46] // pl_render_image_mix
[ 47] {
[ 48] vec4 mix_color = vec4(0.0);
[ 49] color = texture2D(_frame_0_0, _tex_coord_1_0);
[ 50] // pl_shader_color_map
[ 51] {
[ 52] }
[ 53] mix_color += _weight_2_0 * color;
[ 54] color = mix_color;
[ 55] }
[ 56] // pl_shader_color_map
[ 57] {
[ 58] // pl_shader_tone_map
[ 59] {
[ 60] float sig_peak = _const_3_0;
[ 61] float sig_avg = _const_4_0;
[ 62] int sig_idx = 0;
[ 63] if (color[1] > color[sig_idx]) sig_idx = 1;
[ 64] if (color[2] > color[sig_idx]) sig_idx = 2;
[ 65] vec3 sig = clamp(color.rgb, 0.0, sig_peak);
[ 66] vec3 sig_orig = color.rgb;
[ 67] float slope = min(_const_9_0, _dst_avg_10_0 / sig_avg);
[ 68] sig *= slope;
[ 69] sig_peak *= slope;
[ 70] vec4 sig_pq = vec4(sig.rgb, sig_peak);
[ 71] sig_pq *= vec4(1.0/49.26108374384236298501);
[ 72] sig_pq = pow(max(sig_pq, 0.0), vec4(0.15930175781250000000));
[ 73] sig_pq = (vec4(0.83593750000000000000) + vec4(18.85156250000000000000) * sig_pq)
[ 74]           / (vec4(1.0) + vec4(18.68750000000000000000) * sig_pq);
[ 75] sig_pq = pow(sig_pq, vec4(78.84375000000000000000));
[ 76] float scale = 1.0 / (sig_pq.a - _const_11_0);
[ 77] sig = clamp(vec3(scale) * (sig_pq.rgb - vec3(_const_11_0)), 0.0, 1.0);
[ 78] float maxLum = _const_12_0 * scale;
[ 79] float ks = 1.5 * maxLum - 0.5;
[ 80] vec3 tb = (sig - vec3(ks)) / vec3(1.0 - ks);
[ 81] vec3 tb2 = tb * tb;
[ 82] vec3 tb3 = tb2 * tb;
[ 83] vec3 pb = (2.0 * tb3 - 3.0 * tb2 + vec3(1.0)) * vec3(ks) +
[ 84]           (tb3 - 2.0 * tb2 + tb) * vec3(1.0 - ks) +
[ 85]           (-2.0 * tb3 + 3.0 * tb2) * vec3(maxLum);
[ 86] sig = mix(sig, pb, vec3(greaterThan(sig, vec3(ks))));
[ 87] float minLum = _const_13_0 * scale;
[ 88] float p = 4.0;
[ 89] if (minLum >= 0.0)
[ 90]     p = min(1.0 / minLum, 4.0);
[ 91] vec3 boost = vec3(minLum) * pow(vec3(1.0) - sig, vec3(p));
[ 92] vec3 sig_lift = sig + boost;
[ 93] if (maxLum < 1.0) {
[ 94] sig_lift -= vec3(minLum);
[ 95] sig_lift /= 1.0 + minLum / maxLum * pow(1.0 - maxLum, p);
[ 96] sig_lift += vec3(minLum);
[ 97] }
[ 98] sig = mix(sig, sig_lift, vec3(lessThan(sig, vec3(1.0))));
[ 99] sig = vec3(sig_pq.a - _const_11_0) * sig + vec3(_const_11_0);
[100] sig = pow(max(sig, 0.0), vec3(1.0/78.84375000000000000000));
[101] sig = max(sig - vec3(0.83593750000000000000), 0.0) /
[102]           (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * sig);
[103] sig = pow(sig, vec3(1.0/0.15930175781250000000));
[104] sig *= vec3(49.26108374384236298501);
[105] float orig = max(sig_orig[sig_idx], 1e-10);
[106] vec3 sig_lin = sig_orig * sig[sig_idx] / orig;
[107] float coeff = max(sig[sig_idx] - _const_14_0, 1e-6) /
[108]               max(sig[sig_idx], 1.0);
[109] coeff = _const_15_0 * pow(coeff / _const_16_0, _const_17_0);
[110] color.rgb = mix(sig_lin, sig, coeff);
[111] }
[112] color.rgb = _cms_matrix_18_0 * color.rgb;
[113] float cmin = min(min(color.r, color.g), color.b);
[114] if (cmin < _const_19_0) {
[115]     float luma = dot(_luma_coeffs_21_0, color.rgb);
[116]     float coeff = (_const_19_0 - cmin) / (luma - cmin);
[117]     coeff = clamp(coeff, 0.0, 1.0);
[118]     color.rgb = mix(color.rgb, vec3(luma), coeff);
[119] }
[120] float cmax = 1.0/_const_20_0 * max(max(color.r, color.g), color.b);
[121] if (cmax > 1.0)
[122]     color.rgb /= cmax;
[123] // pl_shader_delinearize
[124] color.rgb = max(color.rgb, 0.0);
[125] color.rgb = pow(vec3(_const_25_0) * color.rgb, vec3(1.0/2.4)) - vec3(_const_26_0);
[126] }
[127] // pl_shader_encode_color
[128] {
[129] }
[130] // pl_shader_dither
[131] {
[132] float bias;
[133] vec2 pos = fract(gl_FragCoord.xy * 1.0/_const_35_0);
[134] bias = _lut_27_0(ivec2(pos * _const_36_0));
[135] color = vec4(255.0) * color + vec4(bias);
[136] color = floor(color) * vec4(1.0 / 255.0);
[137] }
[138] color *= vec4(1.0 / _const_37_0);
[139] vec4 _orig_color_38_0 = color;
[140] color = vec4(0.0, 0.0, 0.0, 1.0);
[141] color[0] = _orig_color_38_0[0];
[142] color[1] = _orig_color_38_0[1];
[143] color[2] = _orig_color_38_0[2];
[144] color[3] = _orig_color_38_0[3];
[145] return color;
[146] }
[147]
[148] void main() {
[149] gl_FragColor = _main_40_0();
[150] }
shader compile log (status=1):
shader link log (status=1):
Spent 4.727 ms compiling shader
Estimated source FPS: 60.000, display FPS: 231.266
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
gl_buf_write: OpenGL error: GL_INVALID_ENUM
Exiting...
Received frame after EOF signaled... discarding frame!
Dropped frame with PTS 1.100
Dropped frame with PTS 1.067
Dropped frame with PTS 1.083

We'd better give up

@CarterLi
Copy link
Contributor Author

More info about the graphic issue

The corrupted image was displayed outside the video image, which depended on the radio of window width / height

The graphic was initially normal, then became corrupted after my video starting to play

https://drive.google.com/file/d/1X13Slc8zrauazlaE88fxPClC2pTF3fEX/view?usp=sharing

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

@CarterLi what about this diff?

diff --git a/src/opengl/gpu.c b/src/opengl/gpu.c
index 88583766..2a519ce2 100644
--- a/src/opengl/gpu.c
+++ b/src/opengl/gpu.c
@@ -432,9 +432,9 @@ void gl_buf_write(pl_gpu gpu, pl_buf buf, size_t offset,
         return;
 
     struct pl_buf_gl *buf_gl = PL_PRIV(buf);
-    glBindBuffer(GL_COPY_WRITE_BUFFER, buf_gl->buffer);
-    glBufferSubData(GL_COPY_WRITE_BUFFER, buf_gl->offset + offset, size, data);
-    glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
+    glBindBuffer(GL_ARRAY_BUFFER, buf_gl->buffer);
+    glBufferSubData(GL_ARRAY_BUFFER, buf_gl->offset + offset, size, data);
+    glBindBuffer(GL_ARRAY_BUFFER, 0);
     gl_check_err(gpu, "gl_buf_write");
     RELEASE_CURRENT();
 }
@@ -446,9 +446,9 @@ bool gl_buf_read(pl_gpu gpu, pl_buf buf, size_t offset,
         return false;
 
     struct pl_buf_gl *buf_gl = PL_PRIV(buf);
-    glBindBuffer(GL_COPY_READ_BUFFER, buf_gl->buffer);
-    glGetBufferSubData(GL_COPY_READ_BUFFER, buf_gl->offset + offset, size, dest);
-    glBindBuffer(GL_COPY_READ_BUFFER, 0);
+    glBindBuffer(GL_ARRAY_BUFFER, buf_gl->buffer);
+    glGetBufferSubData(GL_ARRAY_BUFFER, buf_gl->offset + offset, size, dest);
+    glBindBuffer(GL_ARRAY_BUFFER, 0);
     bool ok = gl_check_err(gpu, "gl_buf_read");
     RELEASE_CURRENT();
     return ok;

We should move the OpenGL debugging to a different issue. I still would like to get OpenGL 2.1 working in libplacebo.

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

@CarterLi I think I know what's going on. This patch should fix it, right?

diff --git a/src/vulkan/gpu_pass.c b/src/vulkan/gpu_pass.c
index 53c5d017..53564473 100644
--- a/src/vulkan/gpu_pass.c
+++ b/src/vulkan/gpu_pass.c
@@ -572,13 +572,13 @@ no_descriptors: ;
             };
         }
 
-        VkAttachmentLoadOp loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+        VkAttachmentLoadOp loadOp;
         if (pass->params.load_target) {
-            if (pass->params.blend_params)
-                loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
             pass_vk->initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+            loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
         } else {
             pass_vk->initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+            loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
         }
 
         VkRenderPassCreateInfo rinfo = {
@@ -991,7 +991,7 @@ void vk_pass_run(pl_gpu gpu, const struct pl_pass_run_params *params)
             .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
             .renderPass = pass_vk->renderPass,
             .framebuffer = tex_vk->framebuffer,
-            .renderArea = (VkRect2D){{0, 0}, {tex->params.w, tex->params.h}},
+            .renderArea.extent = {tex->params.w, tex->params.h},
         };
 
         vk->CmdBeginRenderPass(cmd->buf, &binfo, VK_SUBPASS_CONTENTS_INLINE);

@CarterLi
Copy link
Contributor Author

diff --git a/src/opengl/gpu.c b/src/opengl/gpu.c
index 88583766..2a519ce2 100644
--- a/src/opengl/gpu.c
+++ b/src/opengl/gpu.c
@@ -432,9 +432,9 @@ void gl_buf_write(pl_gpu gpu, pl_buf buf, size_t offset,
         return;
 
     struct pl_buf_gl *buf_gl = PL_PRIV(buf);
-    glBindBuffer(GL_COPY_WRITE_BUFFER, buf_gl->buffer);
-    glBufferSubData(GL_COPY_WRITE_BUFFER, buf_gl->offset + offset, size, data);
-    glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
+    glBindBuffer(GL_ARRAY_BUFFER, buf_gl->buffer);
+    glBufferSubData(GL_ARRAY_BUFFER, buf_gl->offset + offset, size, data);
+    glBindBuffer(GL_ARRAY_BUFFER, 0);
     gl_check_err(gpu, "gl_buf_write");
     RELEASE_CURRENT();
 }
@@ -446,9 +446,9 @@ bool gl_buf_read(pl_gpu gpu, pl_buf buf, size_t offset,
         return false;
 
     struct pl_buf_gl *buf_gl = PL_PRIV(buf);
-    glBindBuffer(GL_COPY_READ_BUFFER, buf_gl->buffer);
-    glGetBufferSubData(GL_COPY_READ_BUFFER, buf_gl->offset + offset, size, dest);
-    glBindBuffer(GL_COPY_READ_BUFFER, 0);
+    glBindBuffer(GL_ARRAY_BUFFER, buf_gl->buffer);
+    glGetBufferSubData(GL_ARRAY_BUFFER, buf_gl->offset + offset, size, dest);
+    glBindBuffer(GL_ARRAY_BUFFER, 0);
     bool ok = gl_check_err(gpu, "gl_buf_read");
     RELEASE_CURRENT();
     return ok;

It works. But HDR mode was not enabled.

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

I wonder what's faster, performance-wise. We have two options for dealing with partial rendering:

  1. Always set the loadOp to VK_ATTACHMENT_LOAD_OP_LOAD, and render to the full framebuffer.
  2. Always set the loadOp to VK_ATTACHMENT_LOAD_OP_DONT_CARE and instead use the render-area to crop to the scissor area, even if that means ignoring the render area granularity requirements.

The vulkan specification just gives the nebulous "may cause a performance penalty" for approach 2, but I have no idea how to quantify the costs of LOAD_OP_LOAD vs LOAD_OP_DONT_CARE since my hardware does not make a distinction here.

I wonder if you're in a position to do benchmarks?

@CarterLi
Copy link
Contributor Author

@CarterLi I think I know what's going on. This patch should fix it, right?

diff --git a/src/vulkan/gpu_pass.c b/src/vulkan/gpu_pass.c
index 53c5d017..53564473 100644
--- a/src/vulkan/gpu_pass.c
+++ b/src/vulkan/gpu_pass.c
@@ -572,13 +572,13 @@ no_descriptors: ;
             };
         }
 
-        VkAttachmentLoadOp loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+        VkAttachmentLoadOp loadOp;
         if (pass->params.load_target) {
-            if (pass->params.blend_params)
-                loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
             pass_vk->initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+            loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
         } else {
             pass_vk->initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+            loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
         }
 
         VkRenderPassCreateInfo rinfo = {
@@ -991,7 +991,7 @@ void vk_pass_run(pl_gpu gpu, const struct pl_pass_run_params *params)
             .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
             .renderPass = pass_vk->renderPass,
             .framebuffer = tex_vk->framebuffer,
-            .renderArea = (VkRect2D){{0, 0}, {tex->params.w, tex->params.h}},
+            .renderArea.extent = {tex->params.w, tex->params.h},
         };
 
         vk->CmdBeginRenderPass(cmd->buf, &binfo, VK_SUBPASS_CONTENTS_INLINE);

Works like a charm, great!

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

It works. But HDR mode was not enabled.

This is known/expected, there's no implementation for HDR switching in OpenGL mode, and no extension for it, so nothing we can do.

@CarterLi
Copy link
Contributor Author

I wonder what's faster, performance-wise. We have two options for dealing with partial rendering:

  1. Always set the loadOp to VK_ATTACHMENT_LOAD_OP_LOAD, and render to the full framebuffer.
  2. Always set the loadOp to VK_ATTACHMENT_LOAD_OP_DONT_CARE and instead use the render-area to crop to the scissor area, even if that means ignoring the render area granularity requirements.

The vulkan specification just gives the nebulous "may cause a performance penalty" for approach 2, but I have no idea how to quantify the costs of LOAD_OP_LOAD vs LOAD_OP_DONT_CARE since my hardware does not make a distinction here.

I wonder if you're in a position to do benchmarks?

I'd like to help. Any guidelines?

@haasn haasn closed this as completed in d4f2fb1 Nov 19, 2021
@haasn
Copy link
Owner

haasn commented Nov 19, 2021

I'd like to help. Any guidelines?

Not sure myself. I think the best way to benchmark something like this currently is via mpv, but getting that to work via MoltenVK would be rather difficult and involve writing new code. Alternatively, we could add some sort of benchmark mode to plplay. Or I could write up a synthetic benchmark.

For the time being I'm going to just not worry about it, I think.

@CarterLi
Copy link
Contributor Author

It works. But HDR mode was not enabled.

This is known/expected, there's no implementation for HDR switching in OpenGL mode, and no extension for it, so nothing we can do.

Off topic. How do you choose colorspace for display to use if a video source doesn't contain mastering display metadata? I'm struggling at this issue: iina/iina#3539 (comment)

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

For reference, this would be the other way of doing it: (applies onto current master)

diff --git a/src/vulkan/gpu_pass.c b/src/vulkan/gpu_pass.c
index 53564473..a12f0b2c 100644
--- a/src/vulkan/gpu_pass.c
+++ b/src/vulkan/gpu_pass.c
@@ -572,10 +572,11 @@ no_descriptors: ;
             };
         }
 
-        VkAttachmentLoadOp loadOp;
+        VkAttachmentLoadOp loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
         if (pass->params.load_target) {
+            if (params->blend_params)
+                loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
             pass_vk->initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
-            loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
         } else {
             pass_vk->initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
             loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
@@ -991,7 +992,7 @@ void vk_pass_run(pl_gpu gpu, const struct pl_pass_run_params *params)
             .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
             .renderPass = pass_vk->renderPass,
             .framebuffer = tex_vk->framebuffer,
-            .renderArea.extent = {tex->params.w, tex->params.h},
+            .renderArea = scissor,
         };
 
         vk->CmdBeginRenderPass(cmd->buf, &binfo, VK_SUBPASS_CONTENTS_INLINE);

@CarterLi
Copy link
Contributor Author

We'd better removing the version check for shaderc too, for the same reason of vulkan. @haasn

@haasn
Copy link
Owner

haasn commented Nov 19, 2021

@CarterLi I'm less comfortable doing that, because the shaderc version is non-negligible, and shaderc is a normal library (not like the vulkan SDK which is a horrific abomination).

I suggest instead figuring out why version infromation isn't resolving for you. (Try asking meson devs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants