| 768 | } |
| 769 | |
| 770 | auto Device::get_supported_image_formats(NativeWindowInfo native_window_info) const -> std::vector<Format> |
| 771 | { |
| 772 | auto const c_native_window_info = std::bit_cast<daxa_NativeWindowInfo>(native_window_info); |
| 773 | u32 surface_format_count = 0; |
| 774 | check_result( |
| 775 | daxa_dvc_report_supported_image_formats( |
| 776 | rc_cast<daxa_Device>(object), |
| 777 | c_native_window_info, |
| 778 | &surface_format_count, |
| 779 | nullptr), |
| 780 | "failed to query surface format count"); |
| 781 | |
| 782 | std::vector<VkSurfaceFormatKHR> c_surface_formats = {}; |
| 783 | c_surface_formats.resize(surface_format_count); |
| 784 | check_result( |
| 785 | daxa_dvc_report_supported_image_formats( |
| 786 | rc_cast<daxa_Device>(object), |
| 787 | c_native_window_info, |
| 788 | &surface_format_count, |
| 789 | c_surface_formats.data()), |
| 790 | "failed to query surface formats"); |
| 791 | c_surface_formats.resize(surface_format_count); |
| 792 | |
| 793 | std::vector<Format> ret = {}; |
| 794 | ret.reserve(surface_format_count); |
| 795 | for (auto const & surface_format : c_surface_formats) |
| 796 | { |
| 797 | ret.push_back(std::bit_cast<Format>(surface_format.format)); |
| 798 | } |
| 799 | return ret; |
| 800 | } |
| 801 | |
| 802 | auto Device::choose_swapchain_surface_format(ChooseSwapchainSurfaceFormatInfo const & info) const -> SurfaceFormat |
| 803 | { |
nothing calls this directly
no test coverage detected